
Google Cloud Storage (GCS) Upload
CertifiedUpload a file to GCS
Google Cloud Storage (GCS) Upload
Upload a file to GCS
Reads a file from Kestra internal storage and writes it to a gs:// destination. Supports content metadata settings.
type: io.kestra.plugin.gcp.gcs.UploadExamples
Upload a FILE input to GCS
id: gcp_gcs_upload
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: upload
type: io.kestra.plugin.gcp.gcs.Upload
from: "{{ inputs.file }}"
to: "gs://my_bucket/dir/file.csv"
Download data and upload to Google Cloud Storage
id: load_to_cloud_storage
namespace: company.team
tasks:
- id: data
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv
- id: cloud_storage
type: io.kestra.plugin.gcp.gcs.Upload
from: "{{ outputs.data.uri }}"
to: gs://kestra-demo/data.csv
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-gcp --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150cacheControl string
Cache-Control
contentDisposition string
Content-Disposition
contentEncoding string
Content-Encoding
contentType string
Content-Type
expectedCrc32c string
Expected CRC32C of the source
Optional base64-encoded big-endian CRC32C. When set, the task fails if the source data read from Kestra internal storage does not match this checksum.
expectedMd5 string
Expected MD5 of the source
Optional base64-encoded MD5 digest. When set, the task fails if the source data read from Kestra internal storage does not match this digest. Use this to assert end-to-end integrity against a checksum produced upstream.
from string
Source file URI
Kestra internal storage URI to upload
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
impersonatedServiceAccount string
The GCP service account to impersonate
projectId string
The GCP project ID
scopes array
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used
serviceAccount string
The GCP service account
When unset or rendered to an empty value, Application Default Credentials are used (e.g. GOOGLE_APPLICATION_CREDENTIALS or the runtime's attached identity).
to string
Destination object URI
gs:// bucket/path for the uploaded object. Special characters and partition brackets are automatically percent-encoded if unencoded.
validateChecksum booleanstring
trueValidate checksum after upload
When true (default), compute MD5 and CRC32C client-side while streaming and compare them against what GCS reports server-side once the upload completes. When false, the implicit transit integrity check is skipped; explicit expectedMd5/expectedCrc32c assertions are still honored when set.
workloadIdentityAudience string
Audience of the Workload Identity Federation provider
The full resource name of the workload identity pool provider, //iam.googleapis.com/projects/<number>/locations/global/workloadIdentityPools/<pool>/providers/<provider>.
Required with workloadIdentityToken, and must match the aud claim of the token.
workloadIdentityToken string
OIDC token for Workload Identity Federation
When set together with workloadIdentityAudience, the token is exchanged at Google STS for federated credentials and no service account key is needed: Google verifies it against the identity provider that issued it.
Use {{ oidcToken(audience='…') }} to have Kestra Enterprise mint one for the running execution.
Combine with impersonatedServiceAccount to act as a service account the pool may impersonate, and set projectId explicitly since no key file carries it.
Cannot be combined with serviceAccount.
Outputs
crc32c string
Base64-encoded big-endian CRC32C of the uploaded data
md5 string
Base64-encoded MD5 of the uploaded data
uri string
uriUploaded object URI
Metrics
file.size counter
bytesSize of the uploaded file.