Cloud Deployment Manager will reach end of support on December 31, 2025. If you currently use Deployment Manager, please migrate to Infrastructure Manager or an alternative deployment technology by December 31, 2025 to ensure your services continue without interruption.
If you want to recursively delete all variables under a specific pass,
provide a payload with your request that has the recursive property
set to true:
{
"recursive": true
}
If successful, the API returns an empty response.
To learn more about the method, read the
variables().delete
documentation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis feature is currently in Beta, meaning it's subject to the "Pre-GA Offerings Terms," is available "as is," and may have limited support.\u003c/p\u003e\n"],["\u003cp\u003eVariables can be deleted individually or recursively by path using the \u003ccode\u003egcloud\u003c/code\u003e command-line tool or the REST API.\u003c/p\u003e\n"],["\u003cp\u003eTo delete a variable via the \u003ccode\u003egcloud\u003c/code\u003e command-line tool, you must use the \u003ccode\u003eruntime-config configs variables delete\u003c/code\u003e command with the relevant variable key and config name.\u003c/p\u003e\n"],["\u003cp\u003eIn the REST API, a \u003ccode\u003eDELETE\u003c/code\u003e request must be made to a specific URI, and all variables under a specific path can be deleted by adding a payload with the \u003ccode\u003erecursive\u003c/code\u003e property set to \u003ccode\u003etrue\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eVariables in a deployment can be deleted by either updating the deployment to exclude the variable or by deleting the entire deployment.\u003c/p\u003e\n"]]],[],null,["# Deleting a Variable\n\n| **Beta**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page explains how to delete variables. To learn more about variables and\nthe Runtime Configurator service,\n[Runtime Configurator Fundamentals](/deployment-manager/runtime-configurator).\n\nTo learn how to create a variable, see\n[Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables).\n\nBefore you begin\n----------------\n\n- If you want to use the command-line examples in this guide, install the [\\`gcloud\\` command-line tool](/sdk).\n- If you want to use the API examples in this guide, set up [API access](/deployment-manager/docs/reference/latest).\n- Read [Runtime Configurator Fundamentals](/deployment-manager/runtime-configurator).\n- Read [Creating and Deleting RuntimeConfig Resources](/deployment-manager/runtime-configurator/create-and-delete-runtimeconfig-resources).\n- Read [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables).\n\nDeleting a variable\n-------------------\n\nYou can delete a single variable or recursively delete all variables\nunder a specific path. \n\n### Deployment Manager\n\nDelete a variable that is part of a deployment using one\nof the following methods:\n\n- [Update the deployment](/deployment-manager/docs/deployments/updating-deployments) to omit the variable and redeploy the deployment.\n- [Delete the deployment and the resources it contains](/deployment-manager/docs/deployments/deleting-deployments).\n\n### gcloud\n\nTo delete a variable with the Google Cloud CLI, use the\n`runtime-config configs variables delete` command: \n\n gcloud beta runtime-config configs variables unset [VARIABLE_KEY] --config-name [CONFIG_NAME]\n\nwhere `[VARIABLE_KEY]` is the key of the variable and `[CONFIG_NAME]` is the\nname of the config this variable belongs to.\n\nIf you want to recursively delete all variables under a certain path,\nprovide the `--recursive` flag.\n\nThe gcloud CLI returns a response like:\n\n\u003cbr /\u003e\n\n```\nDeleted [https://runtimeconfig.googleapis.com/v1beta1/projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_KEY].\n```\n\n\u003cbr /\u003e\n\n### API\n\nIn the REST API, make a `DELETE` request to the following URI to delete\na new variable: \n\n https://runtimeconfig.googleapis.com/v1beta1/projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_KEY]\n\nwhere:\n\n- `[PROJECT_ID]` is the project ID for this request.\n- `[CONFIG_NAME]` is the name for this configuration.\n- `[VARIABLE_KEY]` is the variable to delete.\n\n If you want to recursively delete all variables under a specific pass,\n provide a payload with your request that has the `recursive` property\n set to `true`:\n\n {\n \"recursive\": true\n }\n\n If successful, the API returns an empty response.\n\n To learn more about the method, read the\n [`variables().delete`](/deployment-manager/runtime-configurator/reference/rest/v1beta1/projects.configs.variables/delete)\n documentation.\n\nWhat's next?\n------------\n\n- Learn about [Runtime Configurator](/deployment-manager/runtime-configurator).\n- [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables).\n- [Watching a Specific Variable](/deployment-manager/runtime-configurator/watching-a-variable).\n- [Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter).\n- Refer to the [v1beta1 reference](/deployment-manager/runtime-configurator/reference/rest).\n- Refer to the [Quotas for Runtime Configurator](/deployment-manager/pricing-and-quotas#runtime_configurator)."]]