询问AWS Launch Template中tag_specifications的resource_type可选值
Terraform aws_launch_template中tag_specifications的resource_type可选值
除了你提供示例里的instance和volume,resource_type字段还支持以下取值:
network-interface:将标签应用到实例创建的弹性网络接口spot-instances-request:将标签应用到Spot实例请求资源
这些取值对应AWS EC2启动模板在创建资源时会生成的关联对象,标签会被自动附加到指定类型的资源上。
你提供的示例代码整理如下:
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" } } }
内容的提问来源于stack exchange,提问作者Catalan Jarvis
相关产品推荐
相关产品推荐

