This topic explains how to delete environments in Apigee hybrid. See also About environments and environment groups .
How to delete an environment
Assume that you have two environments, testand prod. 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 the prodenvironment, follow these steps:
- Get your gcloud authentication credentials:
TOKEN=$(gcloud auth print-access-token)
- 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"
- Do a dry run to test removal of the runtime components:
helm delete $ENV_NAME -n apigee --dry-run
The
--dry-runcommand will return the same results as the command without the--dry-runoption. For example:helm -n apigee delete example-envrelease "example-env" uninstalled - If the dry run is error-free, remove the runtime components:
helm delete $ENV_NAME -n apigee
- Open your overrides file and remove the
prodenvironment definition fromenvsandvirtualhosts, leaving only the testdefinitions. For example:... envs: - name: test serviceAccountPaths: synchronizer: "your_keypath/synchronizer-manager-service-account.json udca: "your_keypath/analytic-agent-service-account.json ...
- Save the file.

