【发布时间】:2021-10-27 09:02:15
【问题描述】:
我需要将下面的templatefile 函数传递给 EC2 资源中的user_data。谢谢
userdata.tf
templatefile("${path.module}/init.ps1", {
environment = var.env
hostnames = {"dev":"devhost","test":"testhost","prod":"prodhost"}
})
ec2.tf
resource "aws_instance" "web" {
ami = "ami-xxxxxxxxxxxxxxxxx"
instance_type = "t2.micro"
# how do I pass the templatefile Funtion here
user_data = ...
tags = {
Name = "HelloWorld"
}
}
【问题讨论】:
标签: terraform terraform-provider-aws