First, add the new subnet with purpose = “REGIONAL_MANAGED_PROXY” and role = “BACKUP”. A typical Terraform input might look like this:
{
name = "old-proxy-only-subnet"
description = null
ip_range = "100.64.1.0/24"
region = "us-central1"
purpose = "INTERNAL_HTTPS_LOAD_BALANCER"
role = "ACTIVE"
},
{
name = "new-proxy-only-subnet"
description = null
region = "us-central1"
ip_range = "100.64.2.0/24"
purpose = "REGIONAL_MANAGED_PROXY"
role = "BACKUP"
},
After the subnet has been created, switch the role to “ACTIVE”
{
name = "new-proxy-only-subnet"
purpose = "REGIONAL_MANAGED_PROXY"
role = "ACTIVE"
},
Google will automatically change the old subnet’s to role = “BACKUP”. It will also change state from “READY” to “DRAINING”. To match the role change, update input:
{
name = "old-proxy-only-subnet"
purpose = "INTERNAL_HTTPS_LOAD_BALANCER"
role = "BACKUP"
},
After 5 minutes, the draining should finish. You may either leave the old subnet as-is, or simply delete it.
To replace a REGIONAL_MANGED_PROXY subnet, follow this process:
- Add the new subnet with a unique name and ip range with role = “BACKUP”
- Change the new subnet’s role from “BACKUP” to “ACTIVE”. Google will change the old subnet’s role to “BACKUP”
- The old subnet can be be deleted after waiting at least 5 minutes for existing sessions to drain
Remember of course to update firewall rules if the IP address has changed! Google does not automatically create firewall rules for you.