1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-15 01:15:34 +00:00
gcloud-help/gcloud/beta/secrets/versions/access
2024-03-13 09:56:22 +00:00

91 lines
3.2 KiB
Text

NAME
gcloud beta secrets versions access - access a secret version's data
SYNOPSIS
gcloud beta secrets versions access
(VERSION : --location=LOCATION --secret=SECRET)
[--out-file=OUT-FILE-PATH] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) Access the data for the specified secret version.
EXAMPLES
Access the data for version 123 of the secret 'my-secret':
$ gcloud beta secrets versions access 123 --secret=my-secret
Note: The output will be formatted as UTF-8 which can corrupt binary
secrets.
To write raw bytes to a file use --out-file flag:
$ gcloud beta secrets versions access 123 --secret=my-secret \
--out-file=/tmp/secret
To get the raw bytes, have Google Cloud CLI print the response as
base64-encoded and decode:
$ gcloud beta secrets versions access 123 --secret=my-secret \
--format='get(payload.data)' | tr '_-' '/+' | base64 -d
POSITIONAL ARGUMENTS
Global or regional secret version resource - to access The arguments in
this group can be used to specify the attributes of this resource. (NOTE)
Some attributes are not given arguments in this group but can be set in
other ways.
To set the project attribute:
◆ provide the argument version on the command line with a fully
specified name;
◆ provide the argument --project on the command line;
◆ set the property core/project. This resource can be one of the
following types: [version, regional version].
This must be specified.
VERSION
ID of the global or regional secret version or fully qualified
identifier for the global or regional secret version.
To set the version attribute:
▸ provide the argument version on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--location=LOCATION
[EXPERIMENTAL] The location of the global or regional secret version.
To set the location attribute:
▸ provide the argument version on the command line with a fully
specified name;
▸ provide the argument --location on the command line. Must be
specified for resource of type [regional version].
--secret=SECRET
The secret of the global or regional secret version.
To set the secret attribute:
▸ provide the argument version on the command line with a fully
specified name;
▸ provide the argument --secret on the command line.
FLAGS
--out-file=OUT-FILE-PATH
File path to which secret data is written. If this flag is not provided
secret data will be written to stdout in UTF-8 format.
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 help for details.
NOTES
This command is currently in beta and might change without notice. This
variant is also available:
$ gcloud secrets versions access