Skip to content

Commit

Permalink
add alternative names to aws-acm-cert test (#203)
Browse files Browse the repository at this point in the history
While poking around to debug an issue I added a bit more test coverage here.

### Test Plan
* CI

### References
  • Loading branch information
ryanking authored Jun 15, 2020
1 parent 765e78f commit 9819d21
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions aws-acm-cert/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ func TestAWSACMCertInitAndApply(t *testing.T) {
testutil.UniqueId(),
testutil.EnvVar(testutil.EnvRoute53ZoneName))

alternativeDomainName := fmt.Sprintf(
"%s.%s",
testutil.UniqueId(),
testutil.EnvVar(testutil.EnvRoute53ZoneName))

route53ZoneID := testutil.EnvVar(testutil.EnvRoute53ZoneID)

alternativeNames := map[string]string{
alternativeDomainName: route53ZoneID,
}

options := testutil.Options(
testutil.DefaultRegion,
map[string]interface{}{
Expand All @@ -37,9 +46,10 @@ func TestAWSACMCertInitAndApply(t *testing.T) {
"service": service,
"owner": owner,

"cert_domain_name": certDomainName,
"aws_route53_zone_id": route53ZoneID,
"validation_record_ttl": 5,
"cert_domain_name": certDomainName,
"aws_route53_zone_id": route53ZoneID,
"validation_record_ttl": 5,
"cert_subject_alternative_names": alternativeNames,
},
)

Expand Down
4 changes: 2 additions & 2 deletions aws-acm-cert/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "cert_domain_name" {
}

variable "cert_subject_alternative_names" {
type = map
type = map(string)
description = "A map of <alternative_domain:route53_zone_id>"
default = {}
}
Expand Down Expand Up @@ -48,4 +48,4 @@ variable "subject_alternative_names_order" {
type = list(string)
description = "Order to list the subject alternative names in the ACM cert. Workaround for https://github.com/terraform-providers/terraform-provider-aws/issues/8531"
default = null
}
}

0 comments on commit 9819d21

Please sign in to comment.