-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/aws: IGW prevents VPC from changing CIDR #4754
Comments
Ran into something similar today:
|
+1, also ran into this. |
👍 |
2 similar comments
👍 |
👍 |
Just to add a possibly less obvious fact (and reason this issue stayed here and wasn't migrated away as part of the provider split) that emerged in our conversation over in hashicorp/terraform-provider-aws#1248 This bug affects all resources inside the VPC - |
@radeksimko is it possible to move resources between VPCs without recreating them, assuming a situation where the VPCs are not being deleted/replaced? Putting This issue feels like it's in a similar area as #8099. Ideally Terraform (with help from the provider) would be able to figure out on its own that when an A tricky part of this is that the replacement of the
|
That's my understanding as well. I'm pretty sure EC2 instances and compute generally can't be moved between VPCs, neither subnets, but I can imagine moving route tables and IGWs. Admittedly I haven't tried this. Either way the solution will involve some enhancements in the core (schema) prior to fixing it in the provider/resource code. |
I may be misunderstanding something, but I don't think this applies equally to ALL resources that depend on a VPC. Changing the vpc id for a subnet correctly says
Another resource directly VPC dependent, an S3 gateway:
But in the same changeset, the internet gateway:
Just seems to be inconsistent behavior by the provider |
On the Terraform Core side of this problem, we now have #22094 as a description of the generalized problem (giving Terraform more information about relationships between objects), and so we're going to close this AWS-specific issue to consolidate over there, while also creating a record of the use-case. (A variant of this use-case with VPC subnets is already an example in that issue, though.) It's possible that a change to |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I understand it is probably a rare case when one needs to change CIDR of the whole VPC, but I believe this should be working without any errors:
I'm thinking easy the fix can be to just make
aws_internet_gateway.vpc_id
ForceNew: true
.The text was updated successfully, but these errors were encountered: