Skip to content

Cannot create acm with wildcard domain_name #62

Closed
@ollandos

Description

@ollandos

When using the module like this:

inputs = {
    zone_id      = "XXXXXXXX"
    domain_name  = "*.example.com"
}

This module fails with:

Error: Error in function call

  on main.tf line 31, in resource "aws_route53_record" "validation":
  31:   name    = element(local.validation_domains, count.index)["resource_record_name"]
    |----------------
    | count.index is 1
    | local.validation_domains is empty tuple

Call to function "element" failed: cannot use element function with an empty
list.


Error: Error in function call

  on main.tf line 31, in resource "aws_route53_record" "validation":
  31:   name    = element(local.validation_domains, count.index)["resource_record_name"]
    |----------------
    | count.index is 0
    | local.validation_domains is empty tuple

Call to function "element" failed: cannot use element function with an empty
list.


Error: Error in function call

  on main.tf line 32, in resource "aws_route53_record" "validation":
  32:   type    = element(local.validation_domains, count.index)["resource_record_type"]
    |----------------
    | count.index is 1
    | local.validation_domains is empty tuple

Call to function "element" failed: cannot use element function with an empty
list.


Error: Error in function call

  on main.tf line 32, in resource "aws_route53_record" "validation":
  32:   type    = element(local.validation_domains, count.index)["resource_record_type"]
    |----------------
    | count.index is 0
    | local.validation_domains is empty tuple

Call to function "element" failed: cannot use element function with an empty
list.


Error: Error in function call

  on main.tf line 36, in resource "aws_route53_record" "validation":
  36:     element(local.validation_domains, count.index)["resource_record_value"]
    |----------------
    | count.index is 1
    | local.validation_domains is empty tuple

Call to function "element" failed: cannot use element function with an empty
list.


Error: Error in function call

  on main.tf line 36, in resource "aws_route53_record" "validation":
  36:     element(local.validation_domains, count.index)["resource_record_value"]
    |----------------
    | count.index is 0
    | local.validation_domains is empty tuple

Call to function "element" failed: cannot use element function with an empty
list.

Releasing state lock. This may take a few moments...
[terragrunt] 2020/10/16 12:11:49 Hit multiple errors:
exit status 1

This is caused because the domain_name is not cleaned when calculating distinct_domain_names
https://github.com/terraform-aws-modules/terraform-aws-acm/blob/master/main.tf#L3

This is something that is supported by ACM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions