You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If var.service_ports is an empty list, Terraform fail and return the following error:
Error: Unsupported block type
on aws.tf line 9, in resource "aws_security_group" "example":
9: dynamic "ingress" {
Blocks of type "ingress" are not expected here.
Expected Behavior
If var.service_ports is an empty list, Terraform should not generate any ingress block in the security group and continue successfully instead of failing.
Steps to Reproduce
terraform init
terraform apply (This will use the default empty list for var.service_ports).
The text was updated successfully, but these errors were encountered:
Thanks filing the issue! Sorry, I initially misunderstood the issue, that syntax does work in this case, but you are correct that does fail only with the empty collection.
@jbardin @xlz-jgoutin I am interested in helping out here! Is this a change that we definitely want to make, or is it potentially a feature to fail on an empty collection?
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.
ghost
locked and limited conversation to collaborators
Jul 25, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
This is based on the dynamic block example from the 0.12 documentation:
Actual Behavior
If
var.service_ports
is an empty list, Terraform fail and return the following error:Expected Behavior
If
var.service_ports
is an empty list, Terraform should not generate anyingress
block in the security group and continue successfully instead of failing.Steps to Reproduce
terraform init
terraform apply
(This will use the default empty list forvar.service_ports
).The text was updated successfully, but these errors were encountered: