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

enabled = false fails with "The given key does not identify an element in this collection value." #40

Closed
karaluh opened this issue Oct 26, 2022 · 1 comment · Fixed by #42
Labels
bug 🐛 An issue with the system

Comments

@karaluh
Copy link

karaluh commented Oct 26, 2022

Describe the Bug

terraform apply fails with the code below

module "test" {
  source  = "git::https://github.com/cloudposse/terraform-aws-security-group?ref=2.0.0-rc1"
  enabled = false
  vpc_id  = "test"
}

with the error below

╷
│ Error: Invalid index
│
│   on .terraform\modules\test\main.tf line 36, in locals:
│   36:   cbd_security_group_id = local.create_security_group ? one(aws_security_group.cbd[*].id) : var.target_security_group_id[0]
│     ├────────────────
│     │ var.target_security_group_id is empty list of string
│
│ The given key does not identify an element in this collection value.
@karaluh karaluh added the bug 🐛 An issue with the system label Oct 26, 2022
@Nuru
Copy link
Sponsor Contributor

Nuru commented Dec 6, 2022

This has been fixed in our internal v2 release candidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants