- INFORMATION
-
gcloud secrets enable-managed-rotationis 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 secrets enable-managed-rotation - enable managed rotation for a secret
- SYNOPSIS
-
-
gcloud secrets enable-managed-rotationSECRET--location=LOCATION(--instance-id=INSTANCE_ID--username=USERNAME:--password=PASSWORD) [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
- Enable managed rotation for the specified secret. This command is used for the initial setup of managed rotation, currently supporting Cloud SQL single-user credentials.
- EXAMPLES
-
To enable managed rotation for a secret
my-secrettargeting a Cloud SQL instance:gcloud secrets enable-managed-rotation my-secret --location=us-central1 --instance-id=my-project:my-instance --username=db-userTo enable managed rotation and set an initial password:
gcloud secrets enable-managed-rotation my-secret --location=us-central1 --instance-id=my-project:my-instance --username=db-user --password="s3cr3tPassword" - POSITIONAL ARGUMENTS
-
-
Secret resource - The secret to enable managed rotation for. This represents a
Cloud resource. (NOTE) Some attributes are not given arguments in this group but
can be set in other ways.
To set the
projectattribute:-
provide the argument
SECRETon the command line with a fully specified name; -
provide the argument
--projecton the command line; -
set the property
core/project.
This must be specified.
SECRET-
ID of the secret or fully qualified identifier for the secret.
To set the
secretattribute:-
provide the argument
SECRETon the command line.
-
provide the argument
-
provide the argument
-
Secret resource - The secret to enable managed rotation for. This represents a
Cloud resource. (NOTE) Some attributes are not given arguments in this group but
can be set in other ways.
- REQUIRED FLAGS
-
-
Location resource - The location of the secret. This represents a Cloud
resource. (NOTE) Some attributes are not given arguments in this group but can
be set in other ways.
To set the
projectattribute:-
provide the argument
--locationon the command line with a fully specified name; -
provide the argument
--projecton the command line; -
set the property
core/project.
This must be specified.
--location=LOCATION-
ID of the location or fully qualified identifier for the location.
To set the
locationattribute:-
provide the argument
--locationon the command line.
-
provide the argument
-
provide the argument
-
Cloud SQL single-user credential settings.
This must be specified.
--instance-id=INSTANCE_ID-
The Cloud SQL instance ID.
This flag argument must be specified if any of the other arguments in this group are specified.
--username=USERNAME-
The database username.
This flag argument must be specified if any of the other arguments in this group are specified.
--password=PASSWORD- The initial password to set for the database user. If not provided, a random password will be generated.
-
Location resource - The location of the secret. This represents a Cloud
resource. (NOTE) Some attributes are not given arguments in this group but can
be set in other ways.
- 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.
gcloud secrets enable-managed-rotation
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-07-28 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-07-28 UTC."],[],[]]