I'd love to see some extra documentation around the aws_launch_template's tagging functionality - in particular, the valid resource_types that can be used other than instance.
launch_template itselfI agree this would be helpful.
For others looking for which resource types are supported, the only two I know of are instance and volume.
To tag both instances and volumes simply use two blocks:
tag_specifications {
resource_type = "volume"
tags = "${var.tags}"
}
tag_specifications {
resource_type = "instance"
tags = "${var.tags}"
}
FYI the resource documentation page lives at: https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/launch_template.html.markdown
Generally we prefer to point to existing AWS documentation in this case, in fact this seems like a good start: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateTagSpecificationRequest.html
I've submitted a PR to add the link and validate the two currently valid values in the schema: #4765
The documentation update will release with version 1.23.0 of the AWS provider, likely middle of next week. 👍
This has been released in version 1.23.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
I agree this would be helpful.
For others looking for which resource types are supported, the only two I know of are
instanceandvolume.To tag both instances and volumes simply use two blocks: