Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

terraform element function

resource "aws_instance" "ec2_instance" {

count = 2
user_data = element([data.template_file.user_data_file1.rendered, 
                     data.template_file.user_data_file2.rendered], 
                     count.index)

tags = {
    Name = element(var.ec2_instance_names, count.index)
  }

}
Source by www.terraform.io #
 
PREVIOUS NEXT
Tagged: #terraform #element #function
ADD COMMENT
Topic
Name
4+1 =