Open bharathkkb opened 3 years ago
For further reference, this is officially supported by the API and is documented: https://cloud.google.com/vpc/docs/change-mtu-vpc-network#gcloud
The main issue to note according to the docs is that any VMs using the network should first be stopped before updating the MTU. If supporting an in-place update of the MTU the Terraform docs for google_compute_network.mtu
should call out this issue. This might be a valid reason NOT to support an in-place update of the MTU as Terraform cannot easily manage this life-cycle of stopping and starting the VMs using the network. Though if this is the case, the provider should still document why an in-place update is not permitted and link to the relevent docs on how to update it by hand.
As a workaround you can first update the MTU by hand (e.g. by using gcloud compute networks update NETWORK --mtu=MTU
), then update the MTU in Terraform to match and refresh the state.
I agree we likely should not support this field if we need to operate on another resource for support. Slating this issue for retriage
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
https://github.com/terraform-google-modules/terraform-google-network/pull/221#issuecomment-752152710
Debug Output
Panic Output
Expected Behavior
I am able to update the MTU field
Actual Behavior
Delete recreate due to field being set as
ForceNew
Steps to Reproduce
terraform apply
Important Factoids
I am able to update network via a patch operation
References