Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

element function in terraform

#Element retrieves single element from the list
element(list, index)

#Example to Understand
element(["a", "b", "c"], 1)
b

element(["a", "b" , "c"], 0)
a
Comment

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)
  }

}
Comment

PREVIOUS NEXT
Code Example
Shell :: docker desktop for fedora 
Shell :: cp command 
Shell :: git bring back deleted branch from local 
Shell :: ? For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository) 
Shell :: mac shell echo command 
Shell :: visual studio 2022 cannot install nuget package 
Shell :: Bootable flash from ubuntu terminal 
Shell :: how to execute script and pass a parameterin linux 
Shell :: pull all branches from remote git 
Shell :: how to save curl output to a file 
Shell :: how to create a text file list of the contents of a folder 
Shell :: close vim 
Shell :: heroku docker 
Shell :: revert the revert 
Shell :: linux nano how to go to a certain line 
Shell :: export function in shell script 
Shell :: search for substring 
Shell :: github max file size 
Shell :: install windows 10 on virtualbox mac 
Shell :: add user linux 
Shell :: vba run shell command with arguments 
Shell :: how to upen image in kali linux 
Shell :: mpicc command not found debian 
Shell :: mac end process shortcut 
Shell :: lxc bash script source 
Shell :: supprimer fichier selon nom linux 
Shell :: ocamlfind cannot find package 
Shell :: dos assign carriage return to variable 
Shell :: Setting File Permission Allow Webserver di linux 
Shell :: problem with dependency and installation mariadb-server in ubuntu server 18.04LTS 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =