How can I rename a subnet in gcp?

Viewed 714

Is there a way to rename a subnet in gcp? either in console or with terraform.

I rather not drop and recreate the subnet as there are other resources using the subnet.

According to Google docs, you can't change the subnet name once it is created.

Example:

Change subnet name = sn-env-north-01

to this = sn-dev-north-01

thanks.

1 Answers

Actually, you've already answered your question - it's not possible.

Accordingly to the documentation Using VPC networks section Working with subnets:

You cannot change the name or region of a subnet after you have created it. However, you can delete a subnet and replace it, as long as no resources are using it.

You can try to change this behaviour by filling a feature request at Google Public Issue Tracker.

Related