This page describes how to edit a parameter's metadata. You can update the encryption type and the labels of a parameter. You can't edit the parameter name or value. To add a new value to your parameter, you must add a parameter version.
Required roles
To get the permissions that
you need to update a parameter's metadata,
ask your administrator to grant you the
Parameter Manager Admin (roles/parametermanager.admin)
IAM role on the project, folder, or organization.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the permissions required to update a parameter's metadata. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to update a parameter's metadata:
-
To update a parameter:
parametermanager.parameters.update
You might also be able to get these permissions with custom roles or other predefined roles.
Edit a parameter
To edit a parameter, use one of the following methods:
Global parameters
Console
-
In the Google Cloud console, go to the Parameter Manager page.
-
To edit a parameter, use one of the following options:
-
Locate the parameter in the list and click the Actions menu associated with that parameter. In the Actions menu, click Edit.
-
Click the parameter name to go to the parameter details page. On the parameter details page, click Edit.
-
-
On the Edit parameter page, update the properties of the parameter as required, and then click Save.
gcloud
Before using any of the command data below, make the following replacements:
- PARAMETER_ID: the unique name of the parameter
- PROJECT_ID: the Google Cloud project ID
- KEY_RING: the name of the KMS key ring that contains the key
- KEY_NAME: the name of the KMS key
- LABEL_KEY=LABEL_VALUE: use a key-value pair to update a label. If the unique key already exists, its associated value is modified; otherwise, a new label is created.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloud parametermanager parameters update PARAMETER_ID \ --location=global \ --kms-key=projects/PROJECT_ID/locations/global/keyRings/KEY_RING/cryptoKeys/KEY_NAME \ --update-labels=LABEL_KEY=LABEL_VALUE
Windows (PowerShell)
gcloud parametermanager parameters update PARAMETER_ID ` --location=global ` --kms-key=projects/PROJECT_ID/locations/global/keyRings/KEY_RING/cryptoKeys/KEY_NAME ` --update-labels=LABEL_KEY=LABEL_VALUE
Windows (cmd.exe)
gcloud parametermanager parameters update PARAMETER_ID ^ --location=global ^ --kms-key=projects/PROJECT_ID/locations/global/keyRings/KEY_RING/cryptoKeys/KEY_NAME ^ --update-labels=LABEL_KEY=LABEL_VALUE
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: the Google Cloud project ID
- PARAMETER_ID: the unique name of the parameter
- LABEL_KEY: the unique name of the label
- LABEL_VALUE: the corresponding value of the label
- KEY_RING: the name of the KMS key ring that contains the key
- KEY_NAME: the name of the KMS key
HTTP method and URL:
PATCH https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/parameters/PARAMETER_ID?update_mask=labels,kmsKey
Request JSON body:
{
"labels": {
"LABEL_KEY": "LABEL_VALUE"
},
"kmsKey": "projects/PROJECT_ID/locations/global/keyRings/KEY_RING/cryptoKeys/KEY_NAME"
}
To send your request, choose one of these options:
curl
Save the request body in a file named request.json,
and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/parameters/PARAMETER_ID?update_mask=labels,kmsKey"
PowerShell
Save the request body in a file named request.json,
and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.googleapis.com/v1/projects/PROJECT_ID/locations/global/parameters/PARAMETER_ID?update_mask=labels,kmsKey" | Select-Object -Expand Content
The response returns the updated parameter.
Regional parameters
Console
-
In the Google Cloud console, go to the Parameter Manager page.
-
To edit a parameter, use one of the following options:
-
Locate the parameter in the list and click the Actions menu associated with that parameter. In the Actions menu, click Edit.
-
Click the parameter name to go to the parameter details page. On the parameter details page, click Edit.
-
-
On the Edit parameter page, update the properties of the parameter as required, and then click Save.
gcloud
Before using any of the command data below, make the following replacements:
- PARAMETER_ID: the unique name of the parameter
- LOCATION: the Google Cloud location of the parameter
- PROJECT_ID: the Google Cloud project ID
- KEY_RING: the name of the KMS key ring that contains the key
- KEY_NAME: the name of the KMS key
- LABEL_KEY=LABEL_VALUE: use a key-value pair to update a label. If the unique key already exists, its associated value is modified; otherwise, a new label is created.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloud parametermanager parameters update PARAMETER_ID \ --location=LOCATION \ --kms-key=projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME \ --update-labels=LABEL_KEY=LABEL_VALUE
Windows (PowerShell)
gcloud parametermanager parameters update PARAMETER_ID ` --location=LOCATION ` --kms-key=projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME ` --update-labels=LABEL_KEY=LABEL_VALUE
Windows (cmd.exe)
gcloud parametermanager parameters update PARAMETER_ID ^ --location=LOCATION ^ --kms-key=projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME ^ --update-labels=LABEL_KEY=LABEL_VALUE
REST
Before using any of the request data, make the following replacements:
- LOCATION: the Google Cloud location of the parameter
- PROJECT_ID: the Google Cloud project ID
- PARAMETER_ID: the unique name of the parameter
- LABEL_KEY: the unique name of the label
- LABEL_VALUE: the corresponding value of the label
- KEY_RING: the name of the KMS key ring that contains the key
- KEY_NAME: the name of the KMS key
HTTP method and URL:
PATCH https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/parameters/PARAMETER_ID?update_mask=labels,kmsKey
Request JSON body:
{
"labels": {
"LABEL_KEY": "LABEL_VALUE"
},
"kmsKey": "projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"
}
To send your request, choose one of these options:
curl
Save the request body in a file named request.json,
and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/parameters/PARAMETER_ID?update_mask=labels,kmsKey"
PowerShell
Save the request body in a file named request.json,
and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://parametermanager.LOCATION.rep.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/parameters/PARAMETER_ID?update_mask=labels,kmsKey" | Select-Object -Expand Content
The response returns the updated parameter.
Edit labels for multiple parameters
In the Google Cloud console, go to the Parameter Manager page.
Select the parameters for which you want to edit the labels.
Click Labels.
In the Editing labels side panel, update the labels as required.
Click Save.