Clean up a load balancing setup

After you set up a load balancer, you can delete the resources that you made so that you aren't billed for them in the future. If these resources were created within their own project, you can delete the entire project. Otherwise, you can delete the resources individually.

Deleting the project

Console

  1. In the Google Cloud console, go to the Projects page.

    Go to Projects

  2. In the project list, select the project that you want to delete, and then click Delete.

  3. In the dialog, type the PROJECT_ID, and then click Shut down to delete the project.

gcloud

Run the following command, replacing PROJECT_ID with your project ID:

gcloud projects delete PROJECT_ID

Deleting individual resources

Deleting the load balancer

  1. In the Google Cloud console, go to the Load balancing page.

    Go to Load balancing

  2. Select the checkbox next to your load balancer name.

  3. At the top of the page, click Delete.

  4. Select the checkboxes next to all the additional resources, including backend services, backend buckets, health checks, and SSL certificates.

  5. Click Delete load balancer and the selected resources.

Deleting the Cloud Storage buckets

If you created backend buckets, deleting the load balancer and backend buckets doesn't delete the underlying Cloud Storage buckets or the objects contained within them.

For information about deleting Cloud Storage buckets and the objects contained within them, see Deleting buckets.

Deleting the instance groups

If you created instance groups, delete them. Deleting the instance group also deletes the individual VMs.

  1. In the Google Cloud console, go to the Instance groups page.

    Go to Instance groups

  2. To select all instance groups, select the checkbox next to Name, and then click Delete.

  3. In the confirmation window, click Delete.

Deleting the VM instances

If you created standalone VM instances, delete them.

  1. In the Google Cloud console, go to the VM instances page.

    Go to VM instances

  2. Select the checkbox next to Name to select all instances, and then click Delete.

  3. In the confirmation window, click Delete.

Deleting the NEGs

If you created any network endpoint groups (NEGs), delete them. Deleting a NEG also deletes network endpoints contained in the NEG.

  1. In the Google Cloud console, go to the Network Endpoint Groups page.

    Go to Network Endpoint Groups

  2. Locate the network endpoint group that you want to delete.

  3. In that row, click Delete.

Releasing reserved IP addresses

If your load balancer uses one or more a reserved IP addresses, make sure you delete them.

  1. In the Google Cloud console, go to the External IP addresses page.

    Go to External IP addresses

  2. Select the checkboxes next to your reserved IP addresses.

  3. Click Release static address.

  4. In the confirmation window, click Delete.

Deleting the VPC network

If you created a custom VPC network, delete it. Deleting a VPC network also deletes its subnetworks, routes, and firewall rules.

  1. In the Google Cloud console, go to the VPC networks page.

    Go to VPC networks

  2. Click your custom VPC network.

  3. On the network details page, click Delete VPC network.

  4. In the confirmation window, click Delete.

Deleting custom firewall rules in the default VPC network

If you created custom firewall rules in the default VPC network, delete them.

  1. In the Google Cloud console, go to the Firewall policies page.

    Go to Firewall policies

  2. Select the checkboxes next to your custom firewall rules.

  3. Click Delete.

  4. In the confirmation window, click Delete.