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

resource/aws_route53_record: Switch allow_overwrite default from true to false #7734

Merged
merged 2 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions aws/resource_aws_route53_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,10 @@ func resourceAwsRoute53Record() *schema.Resource {
},

"allow_overwrite": {
Type: schema.TypeBool,
Optional: true,
Default: true,
Type: schema.TypeBool,
Optional: true,
Computed: true,
Deprecated: "The next major version of the Terraform AWS Provider will require importing existing records",
},
},
}
Expand Down
27 changes: 27 additions & 0 deletions website/docs/guides/version-2-upgrade.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Upgrade topics:
- [Data Source: aws_ami_ids](#data-source-aws_ami_ids)
- [Data Source: aws_iam_role](#data-source-aws_iam_role)
- [Data Source: aws_kms_secret](#data-source-aws_kms_secret)
- [Data Source: aws_lambda_function](#data-source-aws_lambda_function)
- [Data Source: aws_region](#data-source-aws_region)
- [Resource: aws_api_gateway_api_key](#resource-aws_api_gateway_api_key)
- [Resource: aws_api_gateway_integration](#resource-aws_api_gateway_integration)
Expand All @@ -44,6 +45,7 @@ Upgrade topics:
- [Resource: aws_network_acl](#resource-aws_network_acl)
- [Resource: aws_redshift_cluster](#resource-aws_redshift_cluster)
- [Resource: aws_route_table](#resource-aws_route_table)
- [Resource: aws_route53_record](#resource-aws_route53_record)
- [Resource: aws_route53_zone](#resource-aws_route53_zone)
- [Resource: aws_wafregional_byte_match_set](#resource-aws_wafregional_byte_match_set)

Expand Down Expand Up @@ -644,6 +646,31 @@ Previously, importing this resource resulted in an `aws_route` resource for each
addition to the `aws_route_table`, in the Terraform state. Support for importing `aws_route` resources has been added and importing this resource only adds the `aws_route_table`
resource, with in-line routes, to the state.

## Resource: aws_route53_record

### allow_overwrite Default Value Change

The resource now requires existing Route 53 Records to be imported into the Terraform state for management unless the `allow_overwrite` argument is enabled. The `allow_overwrite` flag is considered deprecated for removal in the next major version of the Terraform AWS Provider (version 3.0.0).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: don't name a specific version, just say "a future version". Then if you forget for 3.0.0, you didn't break a promise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Great suggestion


For example, if the `www.example.com` Route 53 Record in the `example.com` Route 53 Hosted Zone existed previously and this new Terraform configuration was introduced:

```hcl
resource "aws_route53_record" "www" {
# ... other configuration ...
name = "www.example.com"
}
```

During resource creation in version 1.X and prior, it would silently perform an `UPSERT` changeset to the existing Route 53 Record and not report back an error. In version 2.0.0 of the Terraform AWS Provider, the resource now performs a `CREATE` changeset, which will error for existing Route 53 Records.

The `allow_overwrite` argument provides a temporary workaround to keep the old behavior, but existing workflows should be updated to perform a `terraform import` command like the following instead:

```console
$ terraform import aws_route53_record.www ZONEID_www.example.com_TYPE
```

More information can be found in the [`aws_route53_record` resource documentation](https://www.terraform.io/docs/providers/aws/r/route53_record.html#import).

## Resource: aws_route53_zone

### vpc_id and vpc_region Argument Removal
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/route53_record.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The following arguments are supported:
* `latency_routing_policy` - (Optional) A block indicating a routing policy based on the latency between the requestor and an AWS region. Conflicts with any other routing policy. Documented below.
* `weighted_routing_policy` - (Optional) A block indicating a weighted routing policy. Conflicts with any other routing policy. Documented below.
* `multivalue_answer_routing_policy` - (Optional) Set to `true` to indicate a multivalue answer routing policy. Conflicts with any other routing policy.
* `allow_overwrite` - (Optional) Allow creation of this record in Terraform to overwrite an existing record, if any. This does not prevent other resources within Terraform or manual Route53 changes from overwriting this record. `true` by default.
* `allow_overwrite` - (Optional, **DEPRECATED**) Allow creation of this record in Terraform to overwrite an existing record, if any. This does not affect the ability to update the record in Terraform and does not prevent other resources within Terraform or manual Route 53 changes outside Terraform from overwriting this record. `false` by default. The next major version of the Terraform AWS Provider will always require importing existing Route 53 Records.

Exactly one of `records` or `alias` must be specified: this determines whether it's an alias record.

Expand Down