Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: fix aws_route53_zone force_destroy behavior #12421

Merged
merged 1 commit into from
Apr 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_route53_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func deleteAllRecordsInHostedZoneId(hostedZoneId, hostedZoneName string, conn *r
changes := make([]*route53.Change, 0)
// 100 items per page returned by default
for _, set := range sets {
if *set.Name == hostedZoneName+"." && (*set.Type == "NS" || *set.Type == "SOA") {
if strings.TrimSuffix(*set.Name, ".") == strings.TrimSuffix(hostedZoneName, ".") && (*set.Type == "NS" || *set.Type == "SOA") {
// Zone NS & SOA records cannot be deleted
continue
}
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_route53_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ resource "aws_route53_zone" "main" {

const testAccRoute53ZoneConfig_forceDestroy = `
resource "aws_route53_zone" "destroyable" {
name = "terraform.io"
name = "terraform.io."
force_destroy = true
}
`
Expand Down