Skip to content

Multiple domain in one certificate #3

@noizo

Description

@noizo

Hi.
Great job You've done with that module.
I found an issue.

If i'm trying to provision certificate with multiple domain names:

data "aws_route53_zone" "external" {
  name = "example.com"
}

module "cert" {
  source                    = "github.com/azavea/terraform-aws-acm-certificate?ref=0.1.0"
  domain_name               = "*.example.com"
  subject_alternative_names = ["*.example.io"]
  hosted_zone_id            = "${data.aws_route53_zone.external.zone_id}"
  validation_record_ttl     = "60"
}

or
subject_alternative_names = ["*.example.io", "*.example.net"]

Terraform cant properly interpolate zone_id for each domain.
Module trying to write dns verification only for domain, listed in aws_route53_zone"
It uses same zone_id for different domain name. And ends up with an error.

* module.cert.aws_route53_record.validation[1]: 1 error(s) occurred:

* aws_route53_record.validation.1: [ERR]: Error building changeset: InvalidChangeBatch: FATAL problem: DomainLabelEmpty (Domain label is empty) encountered with '_f8a5abb93431b2ffa4a52f601bd3189f.example.io..example.com'
	status code: 400, request id: 06c85bcd-90e3-11e8-9267-c1e76a4a292e

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Besides that it gives an error, provisioning finishes just fine, correct entries are being added to dns verification records in each domain.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions