[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-28 UTC."],[[["\u003cp\u003eThis document outlines the process for deleting environments within Apigee hybrid, using the example of removing a "prod" environment.\u003c/p\u003e\n"],["\u003cp\u003eDeleting an environment requires first removing it from any associated environment groups via API calls, with distinct commands for data residency and no data residency environments.\u003c/p\u003e\n"],["\u003cp\u003eA dry run using \u003ccode\u003ehelm delete\u003c/code\u003e with the \u003ccode\u003e--dry-run=server\u003c/code\u003e flag is recommended to preview the removal of runtime components before actual deletion.\u003c/p\u003e\n"],["\u003cp\u003eAfter successful dry-run and environment component removal, the environment definition needs to be removed from the overrides file to finalize the deletion process.\u003c/p\u003e\n"],["\u003cp\u003eAccess credentials through gcloud authentication are necessary to perform the deletion of an environment.\u003c/p\u003e\n"]]],[],null,["# Delete environments\n\n| You are currently viewing version 1.13 of the Apigee hybrid documentation. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis topic explains how to delete environments in Apigee hybrid. See also\n[About environments and environment groups](/apigee/docs/api-platform/fundamentals/environments-overview).\n\nHow to delete an environment\n----------------------------\n\nAssume that you have two environments, **test** and **prod**. In\nyour overrides file, the definitions might look something like this:\n\n```scdoc\n...\nenvs:\n - name: test\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n - name: prod\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n...\n```\n\nTo delete the **prod** environment, follow these steps:\n\n1. Get your gcloud authentication credentials: \n\n ```\n TOKEN=$(gcloud auth print-access-token)\n ```\n2. Delete the environment from any associated environment groups, one at a time:\n\n ### No data residency\n\n ```\n curl -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n \"https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments/prod\"\n ```\n\n ### Data residency\n\n ```\n curl -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n \"https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments/prod\"\n ```\n3. Do a dry run to test removal of the runtime components: \n\n ```\n helm delete $ENV_NAME -n APIGEE_NAMESPACE --dry-run=server\n ```\n\n The `--dry-run` command will return the same results as the command without the\n `--dry-run` option. For example: \n\n helm -n apigee delete example-env\n release \"example-env\" uninstalled\n\n4. If the dry run is error-free, remove the runtime components: \n\n ```\n helm delete $ENV_NAME -n APIGEE_NAMESPACE\n ```\n5. Open your overrides file and remove the `prod` environment definition from `envs` and `virtualhosts`, leaving only the **test** definitions. For example: \n\n ```scdoc\n ...\n envs:\n - name: test\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n ...\n ```\n6. Save the file."]]