Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Index? #33

Closed
mgoldman-solarwinds opened this issue Jan 6, 2020 · 2 comments
Closed

Invalid Index? #33

mgoldman-solarwinds opened this issue Jan 6, 2020 · 2 comments

Comments

@mgoldman-solarwinds
Copy link

mgoldman-solarwinds commented Jan 6, 2020

Using terraform-0.12.18 and I'm trying to deploy this and I'm hitting an issue:

Error: Invalid index

  on .terraform/modules/acm.acm/terraform-aws-modules-terraform-aws-acm-3c76105/main.tf line 6, in locals:
   6:   validation_domains = var.create_certificate ? [for k, v in aws_acm_certificate.this[0].domain_validation_options : tomap(v) if contains(local.distinct_domain_names, replace(v.domain_name, "*.", ""))] : []
    |----------------
    | aws_acm_certificate.this is empty tuple

The given key does not identify an element in this collection value.

My main.tf:

module "acm" {
  source  = "terraform-aws-modules/acm/aws"

  create_certificate = var.create_certificate
  domain_name        = var.domain_name
  zone_id            = var.zone_id
  validation_method  = var.validation_method
  subject_alternative_names = var.subject_alternative_names

  tags = {
    Environment = "${var.territory}"
    Automation  = "Terraform"
  }
}

I've tried deleting my entire .terraform directory and re-init'ing, making sure my AWS tokens are valid, but this still keeps popping up.

@mgoldman-solarwinds
Copy link
Author

Tainted the existing validation resources, targeted the certificate itself, then did an apply again. Works now, closing.

mslipets added a commit to mslipets/terraform-aws-acm that referenced this issue Jan 22, 2021
@mslipets mslipets mentioned this issue Jan 22, 2021
mslipets added a commit to mslipets/terraform-aws-acm that referenced this issue Jan 22, 2021
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant