Reputation: 1
Our accounts come with IGW created and we only need to attach it to new VPCs that are getting created. I'm building AWS infra with terraform. With terraform import I can make it work but for deploying it to different regions and accounts, I am not happy with the import approach.
I have tried data source but can't really make it work. Furthermore, I even tried using template files with data "template_file" but still couldn't attach IGW to the VPC that is getting created by terraform.
Can you help with any method which I can adopt to attach existing IGW to new VPC via terraform?
Upvotes: 0
Views: 335
Reputation: 20726
I think this not possible by AWS.
You can find the limits here: https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html
I would suggest to delete the existing IGW and create a new one with a proper Terraform module and reuse it on other vpcs.
Upvotes: 1