╷
│ 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.
Describe the Bug
terraform apply fails with the code below
with the error below