Sou*_*uad 4 amazon-web-services terraform
我们如何制作 terraform 创建的 launch_template 资源,将标签添加到创建的 EBS 卷并将其附加到使用的 AMI ?
kic*_*hik 10
tag_specifications与resource_type一起使用volume。
resource "aws_launch_template" "foo" {
name = "foo"
block_device_mappings {
device_name = "/dev/sda1"
ebs {
volume_size = 20
}
}
image_id = "ami-test"
instance_type = "t2.micro"
key_name = "test"
tag_specifications {
resource_type = "instance"
tags = {
Name = "test"
}
}
tag_specifications {
resource_type = "volume"
tags = {
Name = "test"
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2197 次 |
| 最近记录: |