From 8a72bfa5a9626fe9a8643ccd3c10b1f66e5be265 Mon Sep 17 00:00:00 2001 From: stack72 Date: Mon, 18 Jul 2016 13:24:14 +0100 Subject: [PATCH] provider/aws: Fix the Destroy func in the Route53 record tests The test didn't expand the record name - therefore, when the name was empty, it wasn't setting it to the domain name (like the normal resource does!) This was causing an error --- builtin/providers/aws/resource_aws_route53_record_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_route53_record_test.go b/builtin/providers/aws/resource_aws_route53_record_test.go index 823d1b67e9..5ec466b7cc 100644 --- a/builtin/providers/aws/resource_aws_route53_record_test.go +++ b/builtin/providers/aws/resource_aws_route53_record_test.go @@ -368,9 +368,11 @@ func testAccCheckRoute53RecordDestroy(s *terraform.State) error { name := parts[1] rType := parts[2] + en := expandRecordName(name, "notexample.com") + lopts := &route53.ListResourceRecordSetsInput{ HostedZoneId: aws.String(cleanZoneID(zone)), - StartRecordName: aws.String(name), + StartRecordName: aws.String(en), StartRecordType: aws.String(rType), } @@ -427,6 +429,7 @@ func testAccCheckRoute53RecordExists(n string) resource.TestCheckFunc { if len(resp.ResourceRecordSets) == 0 { return fmt.Errorf("Record does not exist") } + // rec := resp.ResourceRecordSets[0] for _, rec := range resp.ResourceRecordSets { recName := cleanRecordName(*rec.Name) @@ -992,7 +995,7 @@ resource "aws_route53_record" "sample" { const testAccRoute53RecordConfigEmptyName = ` resource "aws_route53_zone" "main" { - name = "not.example.com" + name = "notexample.com" } resource "aws_route53_record" "empty" {