Skip to content

Commit

Permalink
revert domain name trim at Create time and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Jul 28, 2020
1 parent 03dd714 commit 3ae10dd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion aws/resource_aws_acm_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func resourceAwsAcmCertificateCreateImported(d *schema.ResourceData, meta interf
func resourceAwsAcmCertificateCreateRequested(d *schema.ResourceData, meta interface{}) error {
acmconn := meta.(*AWSClient).acmconn
params := &acm.RequestCertificateInput{
DomainName: aws.String(d.Get("domain_name").(string)),
DomainName: aws.String(trimTrailingPeriod(d.Get("domain_name").(string))),
IdempotencyToken: aws.String(resource.PrefixedUniqueId("tf")), // 32 character limit
Options: expandAcmCertificateOptions(d.Get("options").([]interface{})),
}
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_route53_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ func cleanRecordName(name string) string {
// If it does not, add the zone name to form a fully qualified name
// and keep AWS happy.
func expandRecordName(name, zone string) string {
rn := strings.ToLower(name)
rn := strings.ToLower(trimTrailingPeriod(name))
zone = strings.TrimSuffix(zone, ".")
if !strings.HasSuffix(rn, zone) {
if len(name) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_ses_domain_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func resourceAwsSesDomainIdentity() *schema.Resource {
func resourceAwsSesDomainIdentityCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).sesconn

domainName := d.Get("domain").(string)
domainName := trimTrailingPeriod(d.Get("domain").(string))

createOpts := &ses.VerifyDomainIdentityInput{
Domain: aws.String(domainName),
Expand Down
13 changes: 9 additions & 4 deletions website/docs/guides/version-3-upgrade.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,25 @@ output "lambda_result" {

## Data Source: aws_route53_resolver_rule

### Removal of domain_name trailing period
### Removal of trailing period in domain_name argument

Previously the data-source returned the Resolver Rule Domain Name directly from the API, which included a `.` suffix. This proves difficult when many other AWS services do not accept this trailing period (e.g. ACM Certificate). This period is now automatically removed. For example, when the attribute would previously return a Resolver Rule Domain Name such as `example.com.`, the attribute now will be returned as `example.com`.
While the returned value will omit the trailing period, use of configurations with trailing periods will not be interrupted.

## Data Source: aws_route53_zone

### Removal of name trailing period
### Removal of trailing period in name argument

Previously the data-source returned the Hosted Zone Domain Name directly from the API, which included a `.` suffix. This proves difficult when many other AWS services do not accept this trailing period (e.g. ACM Certificate). This period is now automatically removed. For example, when the attribute would previously return a Hosted Zone Domain Name such as `example.com.`, the attribute now will be returned as `example.com`.
While the returned value will omit the trailing period, use of configurations with trailing periods will not be interrupted.

## Resource: aws_acm_certificate

### Removal of trailing period in domain_name argument and domain_validation_options.domain_name attribute

Previously the resource returned the Fully Qualified Domain Name of the certificate directly from the API, which included a `.` suffix. This proves difficult when many other AWS services do not accept this trailing period. This period is now automatically removed. For example, when `domain_name` or `domain_validation_options.domain_name` would previously return a Fully Qualified Domain Name such as `example.com.`, it now will be returned as `example.com`.
While the returned value for the `domain_name` argument will omit the trailing period, use of configurations with the trailing period in will not be interrupted.

### domain_validation_options Changed from List to Set

Previously, the `domain_validation_options` attribute was a list type and completely unknown until after an initial `terraform apply`. This generally required complicated configuration workarounds to properly create DNS validation records since referencing this attribute directly could produce errors similar to the below:
Expand Down Expand Up @@ -1040,14 +1045,14 @@ Previously when the `min_capacity` argument in a `scaling_configuration` block w

## Resource: aws_route53_resolver_rule

### Removal of domain_name trailing period
### Removal of trailing period in domain_name argument

Previously the resource returned the Resolver Rule Domain Name directly from the API, which included a `.` suffix. This proves difficult when many other AWS services do not accept this trailing period (e.g. ACM Certificate). This period is now automatically removed. For example, when the attribute would previously return a Resolver Rule Domain Name such as `example.com.`, the attribute now will be returned as `example.com`.
While the returned value will omit the trailing period, use of configurations with trailing periods will not be interrupted.

## Resource: aws_route53_zone

### Removal of name trailing period
### Removal of trailing period in name argument

Previously the resource returned the Hosted Zone Domain Name directly from the API, which included a `.` suffix. This proves difficult when many other AWS services do not accept this trailing period (e.g. ACM Certificate). This period is now automatically removed. For example, when the attribute would previously return a Hosted Zone Domain Name such as `example.com.`, the attribute now will be returned as `example.com`.
While the returned value will omit the trailing period, use of configurations with trailing periods will not be interrupted.
Expand Down

0 comments on commit 3ae10dd

Please sign in to comment.