【发布时间】:2023-01-19 04:27:43
【问题描述】:
我正在尝试使用可用于 aws terraform 提供程序的 default_tag。
文档:
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs#argument-reference
- 使用示例:https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block
从文档中,它说:
This functionality is supported in all resources that implement tags, with the exception of the aws_autoscaling_group resource.
因此,除了aws_instance.root_block_device,我拥有的所有资源都运行良好。
例如,我有:
provider "aws" {
[...]
default_tags {
tags = {
Env = prod
}
}
}
resource "aws_instance" "instance" {
ami = xxx
instance_type = xxx
root_block_device {
volume_size = xxx
volume_type = xxx
}
}
默认标记Env = prod 已正确添加到实例本身,但不是root_device_block块。
所以我想知道是否支持default_tag。的确,文档说 supported in all **resources** 但 root_block_device 只是一个争论这个资源,所以也许这就是问题所在?
我只是在寻找一种确认,因为文档在这一点上不是很清楚。
谢谢
【问题讨论】:
标签: amazon-web-services terraform terraform-provider-aws