Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I rename a subnet in gcp?

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.

like image 269
Stryker Avatar asked Oct 20 '25 08:10

Stryker


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.

like image 83
Serhii Rohoza Avatar answered Oct 22 '25 04:10

Serhii Rohoza



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!