Skip to content

Instantly share code, notes, and snippets.

@khaliqgant
Created March 29, 2022 11:45
Show Gist options
  • Save khaliqgant/1a75cb1346302d6e472c6f4ca1b8d742 to your computer and use it in GitHub Desktop.
Save khaliqgant/1a75cb1346302d6e472c6f4ca1b8d742 to your computer and use it in GitHub Desktop.
[Terraform Multi Line Ternary] Ternary condition that spans multiple lines #terraform #infrastructure
locals {
iam_access_creds = (
var.create ?
var.create_livewire_accesser ?
[module.iam[0].access_key_id, module.iam[0].access_key_secret, module.iam-restriction[0].access_key_id, module.iam-restriction[0].access_key_secret] :
[module.iam[0].access_key_id, module.iam[0].access_key_secret] :
[]
)
}
// source: https://github.com/hashicorp/hcl/issues/343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment