File: //snap/google-cloud-cli/current/help/man/man1/gcloud_secrets_versions_add.1
.TH "GCLOUD_SECRETS_VERSIONS_ADD" 1
.SH "NAME"
.HP
gcloud secrets versions add \- create a new version of an existing secret
.SH "SYNOPSIS"
.HP
\f5gcloud secrets versions add\fR \fISECRET\fR \fB\-\-data\-file\fR=\fIPATH\fR [\fB\-\-location\fR=\fILOCATION\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Create a new version of an existing secret with the provided data. The command
will return an error if no such secret exists.
.SH "EXAMPLES"
Create a new version of an existing secret named 'my\-secret' with secret data
"s3cr3t":
.RS 2m
$ printf "s3cr3t" | gcloud secrets versions add my\-secret \e
\-\-data\-file=\-
.RE
Create a new version of an existing secret named 'my\-secret' with secret data
"s3cr3t" using PowerShell (Note: PowerShell will add a newline to the resulting
secret):
.RS 2m
$ Write\-Output "s3cr3t" | gcloud secrets versions add my\-secret \e
\-\-data\-file=\-
.RE
Create a new version of an existing secret named 'my\-secret' with secret data
from a file:
.RS 2m
$ gcloud secrets versions add my\-secret \-\-data\-file=/tmp/secret
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Secret resource \- The secret to create. 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 "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-data\-file\fR=\fIPATH\fR
File path from which to read secret data. Set this to "\-" to read the secret
data from stdin.
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
Location resource \- The location to create secret version. 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
.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 versions add
.RE