Stay organized with collections Save and categorize content based on your preferences.
gcloud storage sign-url
URL
[URL
…] [--duration
=DURATION
, -d
DURATION
; default=3600] [--headers
=[KEY
=VALUE
,…]] [--http-verb
=HTTP_VERB
, -m
HTTP_VERB
; default="GET"] [--private-key-file
=PRIVATE_KEY_FILE
] [--private-key-password
=PRIVATE_KEY_PASSWORD
, -p
PRIVATE_KEY_PASSWORD
] [--query-params
=[KEY
=VALUE
,…]] [--region
=REGION
, -r
REGION
] [GCLOUD_WIDE_FLAG …
]
gcloud storage sign-url
will generate a signed URL that embeds authentication data so the URL can be used by someone who does not have a Google account. Use the global --impersonate-service-account
flag to specify the service account that will be used to sign the specified URL or authenticate with a service account directly. Otherwise, a service account key is required. Please see the Signed URLs documentation for background about signed URLs.
Note, gcloud storage sign-url
does not support operations on sub-directories. For example, unless you have an object named some-directory/
stored inside the bucket some-bucket
, the following command returns an error: gcloud storage sign-url gs://some-bucket/some-directory/
.
gcloud storage sign-url gs://my-bucket/file.txt --duration=10m --impersonate-service-account=sa@my-project.iam.gserviceaccount.com
To create a signed url that will bill to my-billing-project when already authenticated as a service account:
gcloud storage sign-url gs://my-bucket/file.txt --query-params=userProject=my-billing-project
To create a signed url, valid for one hour, for uploading a plain text file via HTTP PUT:
gcloud storage sign-url gs://my-bucket/file.txt --http-verb=PUT --duration=1h --headers=content-type=text/plain --impersonate-service-account=sa@my-project.iam.gserviceaccount.com
To create a signed URL that initiates a resumable upload for a plain text file using a private key file:
gcloud storage sign-url gs://my-bucket/file.txt --http-verb=POST --headers=x-goog-resumable=start,content-type=text/plain --private-key-file=key.json
URL
[URL
…]
--duration
=DURATION
, -d
DURATION
; default=3600
The max duration allowed is 12 hours. This limitation exists because the system-managed key used to sign the URL may not remain valid after 12 hours.
Alternatively, the max duration allowed is 7 days when signing with either the
flag or an account that authorized with --private-key-file
.gcloud auth activate-service-account
--http-verb
=HTTP_VERB
, -m
HTTP_VERB
; default="GET"
x-goog-resumable:start
header in the request or else signature validation will fail.
--private-key-file
=PRIVATE_KEY_FILE
notasecret
).
Note: Service account keys are a security risk if not managed correctly. Review best practices for managing service account keys before using this option.
--private-key-password
=PRIVATE_KEY_PASSWORD
, -p
PRIVATE_KEY_PASSWORD
--query-params
=[KEY
=VALUE
,…]
--region
=REGION
, -r
REGION
Default value is
which will cause gcloud storage sign-url to fetch the region for the resource. When auto-detecting the region, the current user's credentials, not the credentials from PRIVATE_KEY_FILE, are used to fetch the bucket's metadata.auto
--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 alpha storage sign-url
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 2025-05-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5