- INFORMATION
-
gcloud compute snapshots update-kms-keyis supported in universe domainuniverse; however, some of the values used in the help text may not be available. Command examples may not work as-is and may requires changes before execution. - NAME
-
- gcloud compute snapshots update-kms-key - update the KMS key of a Compute Engine snapshot
- SYNOPSIS
-
-
gcloud compute snapshots update-kms-keySNAPSHOT_NAME[--region=REGION] [--kms-key=KMS_KEY:--kms-keyring=KMS_KEYRING--kms-location=KMS_LOCATION--kms-project=KMS_PROJECT] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
-
gcloud compute snapshots update-kms-key
updates the KMS key of a Compute Engine persistent snapshot by rotating it to the primary version of the key or to the primary version of a new KMS key.
-
gcloud compute snapshots update-kms-key
- EXAMPLES
-
To update the KMS key of a snapshot named example-snapshot-1, run:
gcloud compute snapshots update-kms-key example-snapshot-1To update the KMS key of a snapshot named example-snapshot-2 to a new KMS key named example-key in a key ring named example-key-ring in the global scope, run:
gcloud compute snapshots update-kms-key example-snapshot-2 --kms-key=example-key --kms-keyring=example-key-ring --kms-location=global - POSITIONAL ARGUMENTS
-
SNAPSHOT_NAME- Name of the snapshot to update the KMS key for.
- FLAGS
-
--region=REGION- The region of the snapshot to update.
- Key resource - The Cloud KMS (Key Management Service) cryptokey that will be used to protect the snapshot. The 'Compute Engine Service Agent' service account must hold permission 'Cloud KMS CryptoKey Encrypter/Decrypter'. The arguments in this group can be used to specify the attributes of this resource.
--kms-key=KMS_KEY-
ID of the key or fully qualified identifier for the key.
To set the
kms-keyattribute:-
provide the argument
--kms-keyon the command line.
This flag argument must be specified if any of the other arguments in this group are specified.
-
provide the argument
--kms-keyring=KMS_KEYRING-
The KMS keyring of the key.
To set the
kms-keyringattribute:-
provide the argument
--kms-keyon the command line with a fully specified name; -
provide the argument
--kms-keyringon the command line.
-
provide the argument
--kms-location=KMS_LOCATION-
The Google Cloud location for the key.
To set the
kms-locationattribute:-
provide the argument
--kms-keyon the command line with a fully specified name; -
provide the argument
--kms-locationon the command line; -
provide the argument
--regionon the command line.
-
provide the argument
--kms-project=KMS_PROJECT-
The Google Cloud project for the key.
To set the
kms-projectattribute:-
provide the argument
--kms-keyon the command line with a fully specified name; -
provide the argument
--kms-projecton the command line; -
set the property
core/project.
-
provide the argument
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - NOTES
-
These variants are also available:
gcloud alpha compute snapshots update-kms-keygcloud beta compute snapshots update-kms-key
gcloud compute snapshots update-kms-key
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-03-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-03-31 UTC."],[],[]]