Delete Cloud Composer environments

Cloud Composer 1 | Cloud Composer 2 | Cloud Composer 3

This page explains how to delete your Cloud Composer environment.

Resources that are not deleted automatically

Deleting your environment does not delete the following data in your project:

  • Your environment's Cloud Storage bucket.
  • Cloud Logging logs.

  • 2 GB persistent disk used by the Redis queue.

To avoid incurring charges to your Google Cloud account, export your data and delete the environment's bucket , Cloud Logging logs, and the Redis persistent disk, as needed.

If you use alerting policies to monitor your environment's metrics, delete these policies before deleting your environment.

Your environment's cluster is deleted automatically

Delete a Cloud Composer environment

Console

  1. Delete the Cloud Composer environment:

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

      Go to Environments

    2. Select your environment and click Delete.

    3. Wait until the environment is deleted.

  2. Delete your environment's bucket. Cloud Composer does not delete the environment's bucket automatically.

    1. In the Google Cloud console, go to the Storage > Browser page.

      Go to Storage > Browser

    2. Select the environment's bucket and click Delete. For example, this bucket can be named us-central1-example-environ-c1616fe8-bucket.

  3. Delete the persistent disk of your environment's Redis queue. Deleting the Cloud Composer environment does not delete its persistent disk.

    1. In the Google Cloud console, go to the Compute Engine > Disks.

      Go to Disks

    2. Select the environment's Redis queue persistent disk and click Delete.

      For example, this disk can be named pvc-02bc4842-2312-4347-8519-d87bdcd31115. Disks for Cloud Composer 2 always have the Balanced persistent disk type and the size of 2 GB.

gcloud

  1. Delete the Cloud Composer environment:

    gcloud composer environments delete ENVIRONMENT_NAME \
        --location LOCATION
    

    Replace:

    • ENVIRONMENT_NAME with the name of the environment.
    • LOCATION with the region where the environment is located.
  2. Delete your environment's bucket. Cloud Composer does not delete the environment's bucket automatically.

    gcloud storage rm gs://BUCKET_NAME --recursive
    

    Replace:

    • BUCKET_NAME with the name of your environment's bucket. For example, this bucket can be named us-central1-example-environ-c1616fe8-bucket.
  3. Delete the persistent disk of your environment's Redis queue. Deleting the Cloud Composer environment does not delete its persistent disk.

    You can run gcloud compute disks list to list all disks in your project.

    To delete your environment's persistent disk:

    gcloud compute disks delete PD_NAME \
      --region=PD_LOCATION
    

    Replace:

    • PD_NAME with the name of the persistent disk for your environment

      For example, this disk can be named pvc-02bc4842-2312-4347-8519-d87bdcd31115. Disks for Cloud Composer 2 always have the pd-balanced type and the size of 2 GB.

    • PD_LOCATION with the location of the persistent disk. For example, the location can be us-central1-a.

API

To delete an environment, construct an environments.delete API request with the environment ID.

Terraform

To delete an environment using Terraform, remove the Cloud Composer configuration from your overall resource configuration and run terraform apply.

What's next