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

Cannot use conditional in locals block #21855

Closed
oonisim opened this issue Jun 22, 2019 · 2 comments
Closed

Cannot use conditional in locals block #21855

oonisim opened this issue Jun 22, 2019 · 2 comments

Comments

@oonisim
Copy link

oonisim commented Jun 22, 2019

Terraform Version

0.12.2

Terraform Configuration Files

locals {
  sg_lb_chat_service_api_ips = [
    "10.5.1.72",
    "10.5.2.21",
    "10.5.0.16"
  ]
  cidr_blocks = true ? [ for ip in local.sg_lb_chat_service_api_ips : "${ip}/32" ] : null   # <---- Does not work.
}

output "hoge" {
  value = local.cidr_blocks # <---- Does not show anything
}

Debug Output

Crash Output

Expected Behavior

Condition can be used in locals block.

Actual Behavior

When condition is specified in loccals block, no error and does not work.

Steps to Reproduce

Additional Context

References

@jbardin
Copy link
Member

jbardin commented Jul 8, 2019

Closed by #21957

@jbardin jbardin closed this as completed Jul 8, 2019
@ghost
Copy link

ghost commented Aug 13, 2019

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 ghost locked and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants