Terraform EKS tagging

后端 未结 3 598
悲哀的现实
悲哀的现实 2021-01-23 18:59

I am having this issue of Terraform EKS tagging and don\'t seem to find workable solution to tag all the VPC subnets when a new cluster is created.

To provide some cont

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-23 19:32

    This problem will always exist when there are 2 pieces of code with different state files trying to act on the same resource.

    One way to solve this is to re-import the VPC resource into your VPC state file everytime you apply your EKS terraform code. This will import your tags as well. Same goes with subnets, but it is a manual and tedious process in the long run.

    terraform import aws_vpc.test_vpc vpc-a01106c2

    Ref: https://www.terraform.io/docs/providers/aws/r/vpc.html

    Cheers!

提交回复
热议问题