Delete environments

You are currently viewing version 1.13 of the Apigee hybrid documentation.This version is end of life. You should upgrade to a newer version. For more information, seeSupported versions.

This topic explains how to delete environments in Apigee hybrid. See alsoAbout environments and environment groups.

How to delete an environment

Assume that you have two environments,test andprod. In your overrides file, the definitions might look something like this:

...envs:- name: test    serviceAccountPaths:      synchronizer: "your_keypath/synchronizer-manager-service-account.json      udca: "your_keypath/analytic-agent-service-account.json- name: prod    serviceAccountPaths:      synchronizer: "your_keypath/synchronizer-manager-service-account.json      udca: "your_keypath/analytic-agent-service-account.json...

To delete theprod environment, follow these steps:

  1. Get your gcloud authentication credentials:
    TOKEN=$(gcloud auth print-access-token)
  2. Delete the environment from any associated environment groups, one at a time:

    No data residency

    curl -X DELETE -H "Authorization: Bearer$TOKEN" \  "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments/prod"

    Data residency

    curl -X DELETE -H "Authorization: Bearer$TOKEN" \  "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments/prod"
  3. Do a dry run to test removal of the runtime components:
    helm delete$ENV_NAME -nAPIGEE_NAMESPACE --dry-run=server

    The--dry-run command will return the same results as the command without the--dry-run option. For example:

    helm -n apigee delete example-envrelease "example-env" uninstalled
  4. If the dry run is error-free, remove the runtime components:
    helm delete$ENV_NAME -nAPIGEE_NAMESPACE
  5. Open your overrides file and remove theprod environment definition fromenvs andvirtualhosts, leaving only thetest definitions. For example:
    ...envs:- name: test    serviceAccountPaths:      synchronizer: "your_keypath/synchronizer-manager-service-account.json      udca: "your_keypath/analytic-agent-service-account.json...
  6. Save the file.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.