Size: a a a

2020 March 03

AP

Ali Pali in terraform_ru
всем привет коллеги
а ктонить когданить пробывал делать terraform import в ресурс не на прямую с рут модуле описанный а если в рутмодуле вызывается модуль в котороу уже создается ресурс
источник

i

inqfen in terraform_ru
Сложна, расшифруй
источник

AP

Ali Pali in terraform_ru
секу
источник

AP

Ali Pali in terraform_ru
в main.tf написанно вот так
module "module_name" {
 source = "./module_1"
#bla
}


сам module_1 эта папка в корне в которой тоже есть main.tf

и уже в нем есть
resource "aws_iam_user" "iam_user" {
#bla
}
источник

AP

Ali Pali in terraform_ru
я хочу в конревом модуле сделать
 terraform import aws_iam_user.iam_user myawsuserid


и получить его в главном стейте
источник

OB

Oleksii Borodai in terraform_ru
источник

i

inqfen in terraform_ru
А, ну ресурс модуля это ресурс модуля
источник

AP

Ali Pali in terraform_ru
спасибули
да дапер
при импорте ресурсы модуля видны также как и обычто

terraform import module.module_name.aws_iam_user.iam_user myawsuserid
источник

AP

Ali Pali in terraform_ru
хранивасбог товарищи))
источник

NF

Nelson Florez in terraform_ru
Hi, see what terraform module can I use to run a script when an EC2 instance is launched in aws?

When I create an instance manually in aws in "Advanced details" you can insert the bash script, but I can't find the module for terraform
источник

VT

Victor Tur in terraform_ru
Nelson Florez
Hi, see what terraform module can I use to run a script when an EC2 instance is launched in aws?

When I create an instance manually in aws in "Advanced details" you can insert the bash script, but I can't find the module for terraform
источник

NF

Nelson Florez in terraform_ru
I don't run the script
источник

NF

Nelson Florez in terraform_ru
data "template_file" "init" {
   template = "${file("apache.init.tpl")}"
   
}
источник

NF

Nelson Florez in terraform_ru
resource "aws_instance" "web_server" {
 user_data = "${data.template_file.init.rendered}"
источник

NF

Nelson Florez in terraform_ru
}
источник

NF

Nelson Florez in terraform_ru
any ideas?
источник

IM

Iurii Medvedev in terraform_ru
Nelson Florez
any ideas?
What the error?
источник

NF

Nelson Florez in terraform_ru
the only error when I run, terraform apply
источник

NF

Nelson Florez in terraform_ru
Warning: Interpolation-only expressions are deprecated

 on ec2.tf line 17, in resource "aws_instance" "web_server":
 17:   user_data = "${data.template_file.init.rendered}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

Do you want to perform these actions?
 Terraform will perform the actions described above.
 Only 'yes' will be accepted to approve.

 Enter a value: yes

aws_instance.web_server: Creating...
aws_instance.web_server: Still creating... [10s elapsed]
aws_instance.web_server: Still creating... [20s elapsed]
aws_instance.web_server: Creation complete after 27s [id=i-012b7fa506156dca3]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
источник

NF

Nelson Florez in terraform_ru
the script installs an apache
источник