I'm using Terraform to deploy my infrastructure, and i would like to know if there is a way to propagate my EKS tags to any resources that it create (EC2, SG, ELB, EBS...)?
for the the moment i use this in Terraform to tag all my resources:
default_tags {
tags = {
Environment = "Prod"
Project = "my project"
}
But all the resources created by EKS, or by the node groups are not tagged with those. Someone know how to manage this?
Thanks a lot for your help.
You can create a map variable called tags and refer to that variable in any resource you want to add those tags in.
variable "global_tags" {
description = "A mapping of tags to assign to multiple aws resources"
default = {}
}
global_tags = {
Terraform_Managed = "true"
Environment = "prod"
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.