Terraform module to request an ACM certificate for a domain name and create a CNAME record in the DNS zone to complete certificate validation
APACHE-2.0 License
Bot releases are visible (Hide)
Published by cloudpossebot over 1 year ago
resource "aws_route53_record" "default" {
for_each = {
for dvo in module.acm_certificate.domain_validation_options[0] : dvo.domain_name => {
name = dvo.resource_record_name
record = dvo.resource_record_value
type = dvo.resource_record_type
}
}
name = each.value.name
records = [each.value.record]
type = each.value.type
zone_id = data.aws_route53_zone.default[local.domain_to_zone[each.key]].id
ttl = 300
}
This fixes what was mentioned in - https://github.com/cloudposse/terraform-aws-acm-request-certificate/pull/66
Adding a simple length check to where domains get update in an array fixes the mentioned issue.
Error: no matching Route53Zone found
with module.acm_request_certificate.data.aws_route53_zone.default["io"],
on .terraform/modules/acm_request_certificate/main.tf line 38, in data "aws_route53_zone" "default":
38: data "aws_route53_zone" "default" {
Published by cloudpossebot about 2 years ago
This is a pre-release due to https://github.com/cloudposse/terraform-aws-acm-request-certificate/issues/62
NOTE: This feature requires that the zone to use for validation is the immediate parent of the name in the SAN. See #62.
resource "aws_route53_record" "default" {
for_each = {
for dvo in module.acm_certificate.domain_validation_options[0] : dvo.domain_name => {
name = dvo.resource_record_name
record = dvo.resource_record_value
type = dvo.resource_record_type
}
}
name = each.value.name
records = [each.value.record]
type = each.value.type
zone_id = data.aws_route53_zone.default[local.domain_to_zone[each.key]].id
ttl = 300
}
Published by cloudpossebot about 2 years ago
Published by cloudpossebot about 2 years ago
Change all references to git.io/build-harness
into cloudposse.tools/build-harness
, since git.io
redirects will stop working on April 29th, 2022.
Published by cloudpossebot almost 3 years ago
Published by cloudpossebot almost 3 years ago
This is an auto-generated PR that updates the README.md and docs
To have most recent changes of README.md and doc from origin templates
Published by cloudpossebot about 3 years ago
context.tf
.make github/init
.0.13
.context.tf
(null-label:0.25.0
), contains new labels. A module instantiating this module with version 0.25.0
of null-label
and making use of new labels will not be able to use this module.make github/init
updates build-harness assets, which includes GitHub Actions Workflows and related files.context.tf
(null-label:0.25.0
) is not compatible with Terraform 0.12.*
because it makes use of validation blocks.Published by cloudpossebot about 3 years ago
Published by cloudpossebot over 3 years ago
Published by cloudpossebot over 3 years ago
This is an auto-generated PR that updates the README.md and docs
To have most recent changes of README.md and doc from origin templates
Published by cloudpossebot over 3 years ago
Published by cloudpossebot almost 4 years ago
there is no need to convert to a list anymore as its a set
fixes bug introduced by me :)
Published by cloudpossebot almost 4 years ago
Previously, the domain_validation_options
attribute was a list type and completely unknown until after an initial terraform apply
. This generally required complicated configuration workarounds to properly create DNS validation records since referencing this attribute directly could produce errors similar to the below:
Error: Invalid for_each argument
on main.tf line 16, in resource "aws_route53_record" "existing":
16: for_each = aws_acm_certificate.existing.domain_validation_options
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.
The domain_validation_options
attribute is now a set type and the resource will attempt to populate the information necessary during the planning phase to handle the above situation in most environments without workarounds. This change also prevents Terraform from showing unexpected differences if the API returns the results in varying order.
Published by cloudpossebot almost 4 years ago
Published by aknysh almost 4 years ago
var.zone_name
> var.domain_name