gcloud alpha kms keys versions create [--ekm-connection-key-path=EKM_CONNECTION_KEY_PATH] [--external-key-uri=EXTERNAL_KEY_URI] [--key=KEY] [--keyring=KEYRING] [--location=LOCATION] [--primary] [GCLOUD_WIDE_FLAG …]
(ALPHA) Creates a new version within the given key.
frodo key,
fellowship keyring, and global location and sets it as
the primary version:
gcloud alpha kms keys versions create --location=global --keyring=fellowship --key=frodo --primary
The following command creates a new version within the legolas key,
fellowship keyring, us-central1 location,
https://example.kms/v0/some/key/path as the address for its
external key, and sets it as the key's primary version:
gcloud alpha kms keys versions create --location=us-central1 --keyring=fellowship --key=legolas --external-key-uri=https://example.kms/v0/some/key/path --primary
The following command creates a new version within the bilbo key,
fellowship keyring, us-central1 location,
v0/some/key/path as the ekm connection key path for its external
key, and sets it as the key's primary version:
gcloud alpha kms keys versions create --location=us-central1 --keyring=fellowship --key=bilbo --ekm-connection-key-path=v0/some/key/path --primary--ekm-connection-key-path=EKM_CONNECTION_KEY_PATH--external-key-uri=EXTERNAL_KEY_URI--key=KEY--keyring=KEYRING--location=LOCATION--primaryencryption purpose.
--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 help for details.
gcloud kms keys versions creategcloud beta kms keys versions create
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-05-27 UTC.