File: //snap/google-cloud-cli/396/help/man/man1/gcloud_secrets_update.1
.TH "GCLOUD_SECRETS_UPDATE" 1
.SH "NAME"
.HP
gcloud secrets update \- update a secret's metadata
.SH "SYNOPSIS"
.HP
\f5gcloud secrets update\fR \fISECRET\fR [\fB\-\-etag\fR=\fIETAG\fR] [\fB\-\-location\fR=\fILOCATION\fR] [\fB\-\-update\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-add\-topics\fR=[\fIADD\-TOPICS\fR,...]\ |\ \fB\-\-clear\-topics\fR\ |\ \fB\-\-remove\-topics\fR=[\fIREMOVE\-TOPICS\fR,...]] [\fB\-\-clear\-annotations\fR\ |\ \fB\-\-remove\-annotations\fR=[\fIKEY\fR,...]\ |\ \fB\-\-update\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-clear\-labels\fR\ |\ \fB\-\-remove\-labels\fR=[\fIKEY\fR,...]] [\fB\-\-clear\-version\-aliases\fR\ |\ \fB\-\-remove\-version\-aliases\fR=[\fIKEY\fR,...]\ |\ \fB\-\-update\-version\-aliases\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-expire\-time\fR=\fIEXPIRE\-TIME\fR\ |\ \fB\-\-remove\-expiration\fR\ |\ \fB\-\-ttl\fR=\fITTL\fR] [\fB\-\-next\-rotation\-time\fR=\fINEXT_ROTATION_TIME\fR\ \fB\-\-remove\-next\-rotation\-time\fR\ \fB\-\-remove\-rotation\-period\fR\ \fB\-\-remove\-rotation\-schedule\fR\ \fB\-\-rotation\-period\fR=\fIROTATION_PERIOD\fR] [\fB\-\-regional\-kms\-key\-name\fR=\fIREGIONAL\-KMS\-KEY\-NAME\fR\ |\ \fB\-\-remove\-regional\-kms\-key\-name\fR] [\fB\-\-remove\-version\-destroy\-ttl\fR\ |\ \fB\-\-version\-destroy\-ttl\fR=\fIVERSION\-DESTROY\-TTL\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Update a secret's metadata (e.g. labels). This command will return an error if
given a secret that does not exist.
.SH "EXAMPLES"
Update the label of a secret named \f5my\-secret\fR.
.RS 2m
$ gcloud secrets update my\-secret \-\-update\-labels=foo=bar
.RE
Update the label of a secret using an etag.
.RS 2m
$ gcloud secrets update my\-secret \-\-update\-labels=foo=bar \-\-etag=123
.RE
Update a secret to have a next\-rotation\-time:
.RS 2m
$ gcloud secrets update my\-secret \e
\-\-next\-rotation\-time="2030\-01\-01T15:30:00\-05:00"
.RE
Update a secret to have a next\-rotation\-time and rotation\-period:
.RS 2m
$ gcloud secrets update my\-secret \e
\-\-next\-rotation\-time="2030\-01\-01T15:30:00\-05:00" \e
\-\-rotation\-period="7200s"
.RE
Update a secret to remove the next\-rotation\-time:
.RS 2m
$ gcloud secrets update my\-secret \-\-remove\-next\-rotation\-time
.RE
Update a secret to clear rotation policy:
.RS 2m
$ gcloud secrets update my\-secret \-\-remove\-rotation\-schedule
.RE
Update version destroy ttl of a secret:
.RS 2m
$ gcloud secrets update my\-secret \-\-version\-destroy\-ttl="86400s"
.RE
Disable delayed secret version destroy:
.RS 2m
$ gcloud secrets update my\-secret \-\-remove\-version\-destroy\-ttl
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Secret resource \- The secret to update. 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 \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5SECRET\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fISECRET\fR
ID of the secret or fully qualified identifier for the secret.
To set the \f5secret\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5SECRET\fR on the command line.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-etag\fR=\fIETAG\fR
Current entity tag (ETag) of the secret. If specified, the secret is updated
only if the ETag provided matches the current secret's ETag.
.TP 2m
Location resource \- The location to update 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 \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-location\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
.RS 2m
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
ID of the location or fully qualified identifier for the location.
To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line.
.RE
.sp
.RE
.sp
.TP 2m
\fB\-\-update\-labels\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of label KEY=VALUE pairs to update. If a label exists, its value is
modified. Otherwise, a new label is created.
Keys must start with a lowercase character and contain only hyphens (\f5\-\fR),
underscores (\f5_\fR), lowercase characters, and numbers. Values must contain
only hyphens (\f5\-\fR), underscores (\f5_\fR), lowercase characters, and
numbers.
.TP 2m
Topics.
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-add\-topics\fR=[\fIADD\-TOPICS\fR,...]
List of Pub/Sub topics to add to the secret.
.TP 2m
\fB\-\-clear\-topics\fR
Clear all Pub/Sub topics from the secret.
.TP 2m
\fB\-\-remove\-topics\fR=[\fIREMOVE\-TOPICS\fR,...]
List of Pub/Sub topics to remove from the secret.
.RE
.sp
.TP 2m
Annotations
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-annotations\fR
Remove all Annotations.
.TP 2m
\fB\-\-remove\-annotations\fR=[\fIKEY\fR,...]
List of Annotations to be removed.
.TP 2m
\fB\-\-update\-annotations\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as Annotations.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-labels\fR
Remove all labels. If \f5\-\-update\-labels\fR is also specified then
\f5\-\-clear\-labels\fR is applied first.
For example, to remove all labels:
.RS 2m
$ gcloud secrets update \-\-clear\-labels
.RE
To remove all existing labels and create two new labels, \f5\fIfoo\fR\fR and
\f5\fIbaz\fR\fR:
.RS 2m
$ gcloud secrets update \-\-clear\-labels \e
\-\-update\-labels foo=bar,baz=qux
.RE
.TP 2m
\fB\-\-remove\-labels\fR=[\fIKEY\fR,...]
List of label keys to remove. If a label does not exist it is silently ignored.
If \f5\-\-update\-labels\fR is also specified then \f5\-\-update\-labels\fR is
applied first.
.RE
.sp
.TP 2m
Version Aliases
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-clear\-version\-aliases\fR
Remove all Version Aliases.
.TP 2m
\fB\-\-remove\-version\-aliases\fR=[\fIKEY\fR,...]
List of Version Aliases to be removed.
.TP 2m
\fB\-\-update\-version\-aliases\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as Version Aliases.
.RE
.sp
.TP 2m
Expiration.
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-expire\-time\fR=\fIEXPIRE\-TIME\fR
Timestamp at which to automatically delete the secret.
.TP 2m
\fB\-\-remove\-expiration\fR
If set, removes scheduled expiration from secret (if it had one).
.TP 2m
\fB\-\-ttl\fR=\fITTL\fR
Duration of time (in seconds) from the running of the command until the secret
is automatically deleted.
.RE
.sp
.TP 2m
Rotation.
.RS 2m
.TP 2m
\fB\-\-next\-rotation\-time\fR=\fINEXT_ROTATION_TIME\fR
Timestamp at which to send rotation notification.
.TP 2m
\fB\-\-remove\-next\-rotation\-time\fR
Remove timestamp at which to send rotation notification.
.TP 2m
\fB\-\-remove\-rotation\-period\fR
If set, removes the rotation period, cancelling all rotations except for the
next one.
.TP 2m
\fB\-\-remove\-rotation\-schedule\fR
If set, removes rotation policy from a secret.
.TP 2m
\fB\-\-rotation\-period\fR=\fIROTATION_PERIOD\fR
Duration of time (in seconds) between rotation notifications.
.RE
.sp
.TP 2m
regional kms key.
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-regional\-kms\-key\-name\fR=\fIREGIONAL\-KMS\-KEY\-NAME\fR
regional kms key name for regional secret.
.TP 2m
\fB\-\-remove\-regional\-kms\-key\-name\fR
If set, removes the regional kms key.
.RE
.sp
.TP 2m
Version destroy ttl.
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-remove\-version\-destroy\-ttl\fR
If set, removes the version destroy TTL from the secret.
.TP 2m
\fB\-\-version\-destroy\-ttl\fR=\fIVERSION\-DESTROY\-TTL\fR
Secret Version TTL after destruction request. For secret with TTL>0, version
destruction does not happen immediately on calling destroy; instead, the version
goes to a disabled state and destruction happens after the TTL expires. See \f5$
gcloud topic datetimes\fR for information on duration formats.
.RE
.RE
.sp
.SH "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 \fB$ gcloud help\fR for details.
.SH "NOTES"
This variant is also available:
.RS 2m
$ gcloud beta secrets update
.RE