简体   繁体   中英

How to add Tags to ECS existing Service, Task definition using Terraform

I have a requirement to add tags to all ECS services, task definition and tasks. I just added below to add tags to my existing code. when new service is creating tags getting added and propagating which is good, But when I tried to add tags to existing ecs service its creating same service by destroying the existing one. How to add tags without recreating existing ECS service, and should propagate tags to tasks when task rotated

    tags = {
    Name = local.name_env
    name2 = local.name2
    owner = var.sowner
    env = var.env
  }
  propagate_tags = "SERVICE"

i think you can used terraform state command for this. just add the tag manually in ecs then add the same thing in terraform tfstate file it should work i guess.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM