Difference between revisions of "Terraform conditional expressions"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
  
 
  count = var.env == "prod" ? 1 : 0
 
  count = var.env == "prod" ? 1 : 0
 +
 +
 +
https://www.hashicorp.com/blog/announcing-terraform-0-12
 +
locals {
 +
  public_instances_by_az = {
 +
    for i in aws_instance.example : i.availability_zone => i...
 +
    if i.associate_public_ip_address
 +
  }
 +
}
  
 
== Related ==
 
== Related ==
Line 14: Line 23:
 
* <code>[[if]]</code>
 
* <code>[[if]]</code>
 
* [[Terraform meta argument]]: <code>[[Terraform meta argument: count|count]]</code>
 
* [[Terraform meta argument]]: <code>[[Terraform meta argument: count|count]]</code>
 +
[[Error: Unsupported attribute]]
  
 
== See also ==
 
== See also ==

Latest revision as of 15:44, 19 April 2023

Advertising: