-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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_acm_certificate: Automatically trim trailing period from domain_name and subject_alternative_names #6844
Conversation
… domain_name and subject_alternative_names Trailing periods (which may come from other Terraform AWS provider resource references, notably the aws_route53_zone name attribute in version 1.42.0+) will generate errors with the ACM API. Rather than requiring everyone to implement the same workaround, we can automatically trim the trailing period in the resource. Previous output from acceptance testing: ``` --- FAIL: TestAccAWSAcmCertificate_root_TrailingPeriod (2.74s) testing.go:538: Step 0 error: Error applying: 1 error occurred: * aws_acm_certificate.cert: 1 error occurred: * aws_acm_certificate.cert: Error requesting certificate: ValidationException: 1 validation error detected: Value 'OMITTED.' at 'domainName' failed to satisfy constraint: Member must satisfy regular expression pattern: ^(\*\.)?(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])$ status code: 400, request id: 6715d56a-fee5-11e8-9bd0-4dcda69c2aed --- FAIL: TestAccAWSAcmCertificate_san_TrailingPeriod (2.74s) testing.go:538: Step 0 error: Error applying: 1 error occurred: * aws_acm_certificate.cert: 1 error occurred: * aws_acm_certificate.cert: Error requesting certificate: ValidationException: 1 validation error detected: Value '[tf-acc-7681782492806076456-san.OMITTED.]' at 'subjectAlternativeNames' failed to satisfy constraint: Member must satisfy constraint: [Member must have length less than or equal to 253, Member must have length greater than or equal to 1, Member must satisfy regular expression pattern: ^(\*\.)?(((?!-)[A-Za-z0-9-]{0,62}[A-Za-z0-9])\.)+((?!-)[A-Za-z0-9-]{1,62}[A-Za-z0-9])$] status code: 400, request id: 6715fc72-fee5-11e8-8015-e9da8b2fcdff ``` Output from acceptance testing: ``` --- PASS: TestAccAWSAcmCertificate_dnsValidation (11.10s) --- PASS: TestAccAWSAcmCertificate_emailValidation (12.18s) --- PASS: TestAccAWSAcmCertificate_root (10.92s) --- PASS: TestAccAWSAcmCertificate_root_TrailingPeriod (13.64s) --- PASS: TestAccAWSAcmCertificate_rootAndWildcardSan (10.15s) --- PASS: TestAccAWSAcmCertificate_san_multiple (17.00s) --- PASS: TestAccAWSAcmCertificate_san_single (16.21s) --- PASS: TestAccAWSAcmCertificate_san_TrailingPeriod (15.51s) --- PASS: TestAccAWSAcmCertificate_tags (24.08s) --- PASS: TestAccAWSAcmCertificate_wildcard (10.24s) --- PASS: TestAccAWSAcmCertificate_wildcardAndRootSan (15.84s) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This has been released in version 1.52.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Trailing periods (which may come from other Terraform AWS provider resource references, notably the
aws_route53_zone
resourcename
attribute in version 1.42.0+) will generate errors with the ACM API. Rather than requiring everyone to implement the same workaround, we can automatically trim the trailing period in the resource.Fixes #6533
Fixes #6535
Previous output from acceptance testing:
Output from acceptance testing: