AWS - TempletFile

Terraform

4

, , Terraform. , () .

? , . user_data = file (), - , . : user_data = templetfile().

. . , {}, , . , _.tpl. -. .

. :

f_name =  Olya , l_name = Vasilkova, names = [Masha, Vasya, Rik, Petya, Oleg]
names

, , . , 2 . , .

html , , . .

index.html

- cp user_data.sh user_data.sh.tpl. html .

user_data.sh.tpl

. . , names. , x names. , %{ for x in names ~} % { endfor~} ! , Hello to ${x} from ${f_name}. . user_data . , index.html .

, . Lesson-4. terraform init. .

terraform init

, . terraform apply, yes. , . AWS .

, user_data . terraform apply.

user_data

AWS , , user_data. instance .

instance

user_data. .

user_data

, . , . , .

, .

-

html , . - AWS.

, IP AWS . http IP .

IP

- . terraform console. . :

templatefile("user_data.sh.tpl", {  f_name = "Olya",l_name = "Vasilkova", names  = ["Masha", "Vasya", "Rik", "Petya", "Oleg"] }) 

.

terraform console

AWS.


50% Merion Academy