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

Setting create_security_group to false doesn't work #37

Closed
rpadovani opened this issue Mar 23, 2022 · 2 comments · Fixed by #48
Closed

Setting create_security_group to false doesn't work #37

rpadovani opened this issue Mar 23, 2022 · 2 comments · Fixed by #48
Labels
bug 🐛 An issue with the system

Comments

@rpadovani
Copy link
Contributor

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

If you set create_security_group to false, and provide your security groups with associated_security_group_ids, terraform will fail to plan with this error:

│ Error: Null value found in list
│ 
│   with module.ec2_client_vpn[0].aws_ec2_client_vpn_network_association.default[0],
│   on .terraform/modules/ec2_client_vpn/main.tf line 226, in resource "aws_ec2_client_vpn_network_association" "default":
│  226:   security_groups = concat(
│  227:     [module.vpn_security_group.id],
│  228:     local.associated_security_group_ids
│  229:   )
│ 
│ Null values are not allowed for this attribute value.

As soon as I set it to true, it works (with the same security groups!).

I think the problem is that basically the value is a list of [null, my-ids], and aws_ec2_client_vpn_network_association don't like it.:

➜ terraform console
> concat([null], ["my-id"])
[
  null,
  "my-id",
]

Expected Behavior

Being able to set create_security_group to false

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: Linux
  • Version: Terraform 1.16, module 0.11.0
@rpadovani rpadovani added the bug 🐛 An issue with the system label Mar 23, 2022
@zliebersbach
Copy link

Bug confirmed here!

@korenyoni
Copy link
Member

Maybe we could try

  security_groups = concat(
    module.vpn_security_group.id != null ? [module.vpn_security_group.id] : [],
    local.associated_security_group_ids
  )
}

for

security_groups = concat(
[module.vpn_security_group.id],
local.associated_security_group_ids
)
}

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.

3 participants