-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_acm_certificate: Convert domain_validation_options to Ty…
…peSet and calculate elements during plan Reference: #8531 Reference: #10098 Reference: #10404 Reference: #13053 Output from acceptance testing: ``` --- PASS: TestAccAWSAcmCertificate_imported_IpAddress (11.48s) --- PASS: TestAccAWSAcmCertificate_rootAndWildcardSan (15.53s) --- PASS: TestAccAWSAcmCertificate_root_TrailingPeriod (15.53s) --- PASS: TestAccAWSAcmCertificate_root (15.62s) --- PASS: TestAccAWSAcmCertificate_emailValidation (15.91s) --- PASS: TestAccAWSAcmCertificate_san_TrailingPeriod (16.38s) --- PASS: TestAccAWSAcmCertificate_wildcardAndRootSan (16.43s) --- PASS: TestAccAWSAcmCertificate_san_single (16.51s) --- PASS: TestAccAWSAcmCertificate_dnsValidation (16.85s) --- PASS: TestAccAWSAcmCertificate_disableCTLogging (17.06s) --- PASS: TestAccAWSAcmCertificate_wildcard (18.71s) --- PASS: TestAccAWSAcmCertificate_san_multiple (19.49s) --- PASS: TestAccAWSAcmCertificate_privateCert (20.85s) --- PASS: TestAccAWSAcmCertificate_imported_DomainName (26.86s) --- PASS: TestAccAWSAcmCertificate_tags (42.99s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsEmail (11.56s) --- PASS: TestAccAWSAcmCertificateValidation_timeout (19.20s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdns (107.31s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsSan (110.62s) --- PASS: TestAccAWSAcmCertificateValidation_basic (143.58s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcardAndRoot (153.05s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsRoot (212.21s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsRootAndWildcard (212.95s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcard (247.43s) ``` Please note that this was also tested manually with a few iterations of this configuration: ```hcl terraform { required_providers { aws = "2.70.0" } required_version = "0.12.28" } provider "aws" { region = "us-east-2" } variable "public_root_domain" { description = "Publicly accessible domain for ACM testing" type = string } data "aws_route53_zone" "public_root_domain" { name = var.public_root_domain } resource "aws_acm_certificate" "new" { domain_name = "new.${var.public_root_domain}" subject_alternative_names = [ "new1.${var.public_root_domain}", "new2.${var.public_root_domain}", "new3.${var.public_root_domain}", ] validation_method = "DNS" } resource "aws_route53_record" "new" { for_each = { for dvo in aws_acm_certificate.new.domain_validation_options: dvo.domain_name => { name = dvo.resource_record_name record = dvo.resource_record_value type = dvo.resource_record_type } } allow_overwrite = true name = each.value.name records = [each.value.record] ttl = 60 type = each.value.type zone_id = data.aws_route53_zone.public_root_domain.zone_id } resource "aws_acm_certificate_validation" "new" { certificate_arn = aws_acm_certificate.new.arn validation_record_fqdns = [for record in aws_route53_record.new: record.fqdn] } resource "aws_acm_certificate" "wildcard" { domain_name = var.public_root_domain subject_alternative_names = ["*.${var.public_root_domain}"] validation_method = "DNS" } resource "aws_route53_record" "wildcard" { for_each = { for dvo in aws_acm_certificate.wildcard.domain_validation_options: dvo.domain_name => { name = dvo.resource_record_name record = dvo.resource_record_value type = dvo.resource_record_type } } allow_overwrite = true name = each.value.name records = [each.value.record] ttl = 60 type = each.value.type zone_id = data.aws_route53_zone.public_root_domain.zone_id } resource "aws_acm_certificate_validation" "wildcard" { certificate_arn = aws_acm_certificate.wildcard.arn validation_record_fqdns = [for record in aws_route53_record.wildcard: record.fqdn] } ```
- Loading branch information
Showing
6 changed files
with
688 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.