aws_acm_certificate SAN treatment doesn't match API if domain_name is duplicated #3543
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/acm
Issues and PRs that pertain to the acm service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Example config that will recreate the cert on every run:
Example config that works as expected:
Or the slightly more complex but less baloney option of slicing the list:
Expected Behavior
Terraform should make the cert once and then stop.
Actual Behavior
AWS silently dedupes the primary domain name from the SANs list, even though they're including the primary domain name in the actual x509 cert's SAN field. This means that if you have a list of domains and use the first domain as primary, and the full list as SANs, the terraform applies as expected, creating a cert valid for all domains, but on subsequent runs, terraform will check for the full domain list in the list of SANs, find a mismatch, and always try to recreate the cert.
I suspect the "right" behavior here would be to always concat the primary domain and SAN fields on both sides and dedupe before comparing the SAN field, since in the cert itself will always contain the primary domain as an actual SAN attribute.
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: