Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ringanta/terraform-aws-acm-multiple-hosted-zone
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.3
Choose a base ref
...
head repository: ringanta/terraform-aws-acm-multiple-hosted-zone
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Jun 14, 2020

  1. Handle duplicate domains

    ringanta committed Jun 14, 2020
    Copy the full SHA
    4490764 View commit details

Commits on Sep 16, 2020

  1. Copy the full SHA
    2dcb2ef View commit details

Commits on Oct 2, 2020

  1. Copy the full SHA
    43b9f8e View commit details
Showing with 19 additions and 2 deletions.
  1. +17 −0 README.md
  2. +1 −1 main.tf
  3. +1 −1 outputs.tf
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,23 @@ Terraform module to create an ACM resource that contains domains from multiple R
ACM validation is using Route53 only.
This module supports terraform version 0.12 only.

## Module versions

- Module version 1.x is in the `master` branch.
- Module version 2.x is in the `v2xx` branch.

Module version 2 introduces breaking change. You can't use version 1.x configuration with module 2.x and vice versa.
To upgrade your existing Terraform project to module version 2, I suggest to provision a new certificate with the same domain name and subject alternatives name. Here is the step would look like:

1. Instantiate `acm-multiple-hosted-zone` version 2 in your existing terraform project.
1. Provision a new ACM certificate using `acm-multiple-hosted-zone` version 2.

1. Run `terraform plan -out=tfplan.out`.
1. Run `terraform apply tfplan.out`.
1. Write down ARN of the newly created ACM certificate.

1. On the consumer side of ACM certificate (For example, ALB), replace old certificate with the new one. This will guarantee a graceful upgrade without downtime.

## Usage

The `domain_name` and `subject_alternative_names` variables consist of map (object) of string and list of map of string. Each object must consist **zone** and **domain** keys.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ resource "aws_acm_certificate" "self" {
}

resource "aws_route53_record" "validation" {
count = var.validation_set_records ? length(local.all_domains) : 0
count = var.validation_set_records ? length(distinct(local.all_domains)) : 0

zone_id = lookup(local.zone_name_to_id_map, lookup(local.domain_to_zone_map, local.cert_validation_domains[count.index]["domain_name"]))
name = local.cert_validation_domains[count.index]["resource_record_name"]
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ output "certificate_arn" {

output "certificate_domains" {
description = "List of domain names covered by the certificate"
value = concat([aws_acm_certificate.self.domain_name], aws_acm_certificate.self.subject_alternative_names)
value = concat([aws_acm_certificate.self.domain_name], tolist(aws_acm_certificate.self.subject_alternative_names))
}

output "certificate_domain_validation_options" {