Skip to main content

Google Cloud Storage (GCS)

This page guides you through setting up the Google Cloud Storage (GCS) destination connector.

The GCS destination writes each stream to one or more objects in a GCS bucket. You choose the output format (Avro, CSV, JSON Lines, or Parquet), and you can control the directory layout and the object names with path templates. The connector authenticates with an HMAC key and uses the GCS XML API, which is compatible with the Amazon S3 API.

info

This page covers the Google Cloud Storage destination, which writes plain files. If you want an Apache Iceberg lakehouse on GCS, use the separate GCS Data Lake destination instead.

Prerequisites​

  • A GCS bucket. Create a bucket or choose an existing one. Bucket retention policies and object holds must allow Airbyte to delete the objects it creates (see Permissions).
  • A Google Cloud service account with an HMAC key. If your organization uses the constraints/storage.restrictAuthTypes organization policy, it must allow HMAC authentication.
  • Network access from the Airbyte deployment to https://storage.googleapis.com.

Setup guide​

Step 1: Create a service account and HMAC key​

  1. In the Google Cloud console, create a dedicated service account for Airbyte.
  2. Create an HMAC key for that service account. Copy the Access ID and the Secret immediately. Google Cloud doesn't display the secret again.

Step 2: Grant permissions​

Grant the service account the Storage Object User role (roles/storage.objectUser) on the bucket. If you prefer a custom role, it must include at least these permissions:

storage.objects.create
storage.objects.get
storage.objects.list
storage.objects.delete
storage.multipartUploads.create
storage.multipartUploads.abort

Why each permission is needed:

PermissionUsed for
storage.objects.create, storage.multipartUploads.createWriting output objects. Objects are uploaded as multipart uploads.
storage.multipartUploads.abortCleaning up a multipart upload that fails part-way.
storage.objects.list, storage.objects.getDiscovering existing objects and reading their generation metadata so Full Refresh - Overwrite can remove stale data.
storage.objects.deleteDeleting the connection-check probe object and stale objects in Full Refresh - Overwrite syncs.

Step 3: Set up the destination in Airbyte​

  1. In the Airbyte UI, go to Destinations, click New destination, and select Google Cloud Storage (GCS).
  2. Enter a Destination name.
  3. Fill in the fields described in Configuration.
  4. Click Set up destination. Airbyte runs a connection check that uploads a small probe object under the bucket path, lists it, and deletes it.

Configuration​

FieldRequiredDefaultDescription
GCS Bucket NameYesName of the bucket that receives the data.
GCS Bucket PathYesPrefix inside the bucket under which all objects are written. A trailing / is optional.
GCS Bucket RegionNousLocation of the bucket. See GCS locations.
Authentication → HMAC Access IDYesAccess ID of the service account's HMAC key.
Authentication → HMAC SecretYesSecret of the HMAC key.
Output FormatYesOne of Avro, CSV, JSON Lines, or Parquet, with format-specific options. See Output formats.
GCS Path FormatNo${NAMESPACE}/${STREAM_NAME}/${YEAR}_${MONTH}_${DAY}_${EPOCH}_Template for the object key below the bucket path. See GCS Path Format.
File Name PatternNo{part_number}{format_extension}Template for the final file name. See File Name Pattern.

Authentication​

The connector supports HMAC key authentication only. Service account JSON keys, OAuth, and Application Default Credentials aren't supported by this connector. Because the connector talks to the GCS XML API through an S3-compatible client, error messages from Google Cloud are reported in S3 terminology (for example AccessDenied or SignatureDoesNotMatch). See Troubleshooting.

Encryption​

Both Google-managed and customer-managed encryption keys (CMEK) are supported. The connector doesn't set an encryption key itself; it uses the bucket's default encryption, which you can review in the Configuration tab of the bucket under Encryption type.

Output layout​

Every object key is built from the bucket path, the resolved GCS Path Format, and the resolved File Name Pattern:

<bucket-name>/<bucket-path>/<resolved GCS Path Format><resolved File Name Pattern>

Note that the path format and the file name are concatenated directly. If the path format doesn't end with /, its last segment becomes a prefix of the file name. With the default settings, a sync of the users stream in the public namespace produces objects such as:

my-bucket/landing/public/users/2026_10_30_1761820800000_0.csv.gz
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
| | | | | | | format extension
| | | | | | part number
| | | | | epoch milliseconds of the sync
| | | | sync date (YYYY_MM_DD)
| | | stream name
| | namespace (omitted when the stream has none)
| bucket path
bucket name

A sync writes one or more part files per stream. Files roll over at roughly 200 MB compressed, so large streams produce several part numbers from the same sync.

GCS Path Format​

GCS Path Format is a template for the directory structure under the bucket path. Variables use the ${VARIABLE} syntax and are substituted at the start of the sync. Consecutive / characters are collapsed, so an empty ${NAMESPACE} doesn't create an empty directory.

VariableDescriptionExample
${NAMESPACE}Namespace of the stream (empty if none)public
${STREAM_NAME}Name of the streamusers
${YEAR}Year of the sync (UTC, four digits)2026
${MONTH}Month of the sync (UTC, zero-padded)10
${DAY}Day of the sync (UTC, zero-padded)30
${HOUR}Hour of the sync (UTC, zero-padded)09
${MINUTE}Minute of the sync (UTC, zero-padded)30
${SECOND}Second of the sync (UTC, zero-padded)45
${MILLISECOND}Millisecond of the sync (UTC)0123
${EPOCH}Milliseconds since the Unix epoch at the start of the sync1761820800000
${UUID}Random UUIDa1b2c3d4-e5f6-...
${SYNC_ID}Unique ID of the sync101

If you leave the field empty, the default template is used. Multiple syncs of the same stream never overwrite each other's files because ${EPOCH} (default template) or the part number differs.

Example: Hive-style partitions​

To lay out each stream as a partitioned table that Hive, Spark, BigQuery external tables, and similar engines can read, end the template with / so that each sync lands in its own partition directory:

${STREAM_NAME}/dt=${YEAR}-${MONTH}-${DAY}/

With the default File Name Pattern, this produces:

my-bucket/landing/users/dt=2026-10-30/0.parquet
my-bucket/landing/users/dt=2026-10-30/1.parquet

Because the file name no longer includes a timestamp, add {timestamp} or {sync_id} to the File Name Pattern if you run the stream more than once a day in an append mode:

{sync_id}_{part_number}{format_extension}

Example: flat layout without the stream name​

To write all files for a stream directly under the bucket path, use a template that contains no directory separators, for example ${YEAR}_${MONTH}_${DAY}_. You need one connection (or one bucket path) per stream in this layout; otherwise streams share the same directory.

File Name Pattern​

File Name Pattern is a template for the file name. Variables use the {variable} syntax.

VariableDescriptionExample
{date}Date of the sync in yyyy_MM_dd format2026_10_30
{date:yyyy_MM}Date of the sync in yyyy_MM format2026_10
{timestamp}Wall-clock time in milliseconds when the file is created1761820845123
{part_number}Part number of the file within the sync (0, 1, 2, ...)0
{sync_id}Unique ID of the sync101
{format_extension}File extension including the compression suffix.csv.gz

Always include {part_number} so that part files from the same sync get distinct names, and {format_extension} so that the extension matches the configured format. If you leave the field empty, the default pattern is used.

note

Path format variables use ${VARIABLE}; file name variables use {variable}.

Sync modes​

Sync modeSupported?
Full Refresh - OverwriteYes
Full Refresh - AppendYes
Full Refresh - Overwrite + DedupedNo
Incremental Sync - AppendYes
Incremental Sync - Append + DedupedNo

Each stream's directory holds the complete data set for that stream. Think of the directory as the equivalent of a table.

  • Append modes add new files containing only the new data.
  • Full Refresh - Overwrite writes the new files first and, after the sync completes successfully, deletes the stream's objects from earlier generations. Objects are matched by the resolved path template (including any ${...} variables) and by the Airbyte generation ID stored in object metadata, so stale files are removed even when the path contains date variables.
warning

Full Refresh - Overwrite deletes objects that match the stream's path template under the bucket path. Use a dedicated bucket or bucket path for Airbyte and double-check your path configuration to avoid deleting unrelated data.

Objects written by connector versions before 1.0.0 carry no generation metadata and are never deleted by Full Refresh - Overwrite. Remove them manually after upgrading. See the migration guide.

Output formats​

All formats include these Airbyte metadata fields in every record:

FieldDescription
_airbyte_raw_idUUID assigned by Airbyte to the record.
_airbyte_extracted_atTime the record was extracted from the source, in Unix epoch milliseconds.
_airbyte_metaRecord metadata: sync_id and a changes array describing any modifications Airbyte made to the record (for example a field set to NULLED because it didn't match the declared type).
_airbyte_generation_idGeneration of the stream the record belongs to. Full Refresh - Overwrite starts a new generation.

Avro​

Apache Avro is a compact binary format with an embedded schema. The connector writes binary-encoded Avro object container files and derives the Avro schema from the stream's JSON schema. Learn how Airbyte maps JSON types to Avro, and the current limitations, in JSON to Avro conversion.

Available compression codecs:

CodecOptions
No compression
deflateCompression level 0–9 (default 0). 0 is fastest with no compression, 9 is smallest and slowest.
bzip2
xzCompression level 0–9 (default 6). 0–3 are fast with medium compression; 4–6 are slower with high compression; 7–9 use larger dictionaries and more memory and only help for files above 8, 16, or 32 MiB respectively.
zstandardCompression level -5–22 (default 3). Negative levels are fast modes similar to lz4/snappy; levels above 9 are for archival use and levels above 18 use a lot of memory. Optionally include a checksum in each data block.
snappy

CSV​

CSV output supports two flattening modes:

  • No flattening: the source record is serialized as a JSON string in the _airbyte_data column.
  • Root level flattening: each top-level field of the source record becomes its own column. Nested objects and arrays are serialized as JSON strings.
ColumnPresent whenDescription
_airbyte_raw_idAlwaysSee Output formats.
_airbyte_extracted_atAlways
_airbyte_metaAlwaysSerialized as a JSON string.
_airbyte_generation_idAlways
_airbyte_dataNo flatteningSource record serialized as a JSON string.
Source fieldsRoot level flatteningOne column per top-level source field.

For example, this source record:

{
"user_id": 123,
"name": {
"first": "John",
"last": "Doe"
}
}

With no flattening:

_airbyte_raw_id_airbyte_extracted_at_airbyte_meta_airbyte_generation_id_airbyte_data
26d73cde-7eb1-4e1e-b7db-a4c03b4cf2061622135805000{"sync_id":10111,"changes":[]}11{"user_id":123,"name":{"first":"John","last":"Doe"}}

With root level flattening:

_airbyte_raw_id_airbyte_extracted_at_airbyte_meta_airbyte_generation_iduser_idname
26d73cde-7eb1-4e1e-b7db-a4c03b4cf2061622135805000{"sync_id":10111,"changes":[]}11123{"first":"John","last":"Doe"}

CSV files are GZIP-compressed by default (.csv.gz). Choose No Compression in the format options to write plain .csv files.

JSON Lines (JSONL)​

JSON Lines writes one JSON object per line. It supports the same No flattening and Root level flattening options as CSV. With no flattening, the source record is nested under _airbyte_data; with root level flattening, the source fields appear next to the Airbyte metadata fields.

Example output with no flattening for two source records:

{"_airbyte_raw_id":"26d73cde-7eb1-4e1e-b7db-a4c03b4cf206","_airbyte_extracted_at":1622135805000,"_airbyte_meta":{"sync_id":10111,"changes":[]},"_airbyte_generation_id":11,"_airbyte_data":{"user_id":123,"name":{"first":"John","last":"Doe"}}}
{"_airbyte_raw_id":"0a61de1b-9cdd-4455-a739-93572c9a5f20","_airbyte_extracted_at":1631948170000,"_airbyte_meta":{"sync_id":10112,"changes":[]},"_airbyte_generation_id":12,"_airbyte_data":{"user_id":456,"name":{"first":"Jane","last":"Roe"}}}

JSONL files are GZIP-compressed by default (.jsonl.gz). Choose No Compression to write plain .jsonl files.

Fields that are absent from a source record are absent from the output record as well; the connector doesn't backfill them with null.

Parquet​

Apache Parquet is a columnar format. Records are first converted to Avro using the same mapping as the Avro format, then written as Parquet.

OptionTypeDefaultDescription
Compression CodecenumUNCOMPRESSEDOne of UNCOMPRESSED, SNAPPY, GZIP, LZO, BROTLI, LZ4, ZSTD.
Block Size (Row Group Size)integer (MB)128Size of a row group buffered in memory. Larger values improve read performance but use more memory while writing.
Max Padding Sizeinteger (MB)8Maximum padding used to align row groups; also the minimum row group size.
Page Sizeinteger (KB)1024Size of a data page, the smallest unit that must be read to access a record. Very small pages reduce compression efficiency.
Dictionary Page Sizeinteger (KB)1024Size of the dictionary page per column per row group when dictionary encoding is on.
Dictionary EncodingbooleantrueWhether to use dictionary encoding.

These options map to Parquet's ParquetOutputFormat settings. See the Parquet configuration guide for recommended values.

Namespace support​

This destination uses namespaces through the ${NAMESPACE} variable in GCS Path Format. If a stream has no namespace, the variable resolves to an empty string and the directory segment is omitted. Stream and namespace names are sanitized to characters that are safe in object keys.

Troubleshooting​

Connection check fails with AccessDenied​

The connector reports Google Cloud errors in S3 terminology because it uses the S3-compatible XML API. AccessDenied means the HMAC key's service account is missing one of the required permissions on the bucket, most often storage.multipartUploads.create or storage.objects.delete. Grant Storage Object User on the bucket or add the missing permissions to your custom role.

Connection check fails with SignatureDoesNotMatch or InvalidAccessKeyId​

The HMAC access ID or secret is incorrect, or the key belongs to a different project. Make sure you copied the secret exactly and that the key is active. If your organization restricts authentication types, confirm that HMAC keys are allowed by the constraints/storage.restrictAuthTypes policy.

Output objects are written directly under the bucket path with no directory​

The GCS Path Format doesn't end with / and contains no / at all, so its resolved value is used as a file name prefix. Add / where you want a directory boundary, or clear the field to use the default template. In connector versions before 1.0.2, clearing the field could also produce this layout; upgrade to 1.0.2 or later.

Old files remain after a Full Refresh - Overwrite sync​

Only objects that match the stream's current path template and carry generation metadata are deleted. Files written by connector versions before 1.0.0, or written under a different GCS Path Format, are left in place. Remove them manually.

Upgrading to 1.0.0​

Version 1.0.0 is a rewrite on the Bulk Load CDK and changes the default compression and output layout. See the GCS migration guide before upgrading.

Performance​

The connector uses tuned object-storage pipeline defaults and exposes no performance-tuning settings, matching the other Bulk CDK object-storage destinations. Throughput scales with the destination pod's CPU and memory and, for socket-mode syncs, with the source's read concurrency and the number of streams synced in parallel. In socket mode the CDK sizes the socket count, part size, and upload parallelism from the negotiated CPU limits automatically.

Reference​

Config fields reference

Field
Type
Property name
object
credential
object
format
string
gcs_bucket_name
string
gcs_bucket_path
string
file_name_pattern
string
gcs_bucket_region
string
gcs_path_format

Changelog​

Expand to review
VersionDatePull RequestSubject
1.0.22026-10-3090272Promote to certified (GA). Treat blank gcs_path_format / file_name_pattern as the default patterns; declare allowedHosts in metadata; report connection-check failures as configuration errors with GCS/HMAC-specific guidance (90279).
1.0.12026-10-2289650Upgrade to Bulk CDK 1.1.9: fix critical CVEs in Apache MINA (mina-core 2.0.31), MINA SSHD 2.20.0 and BouncyCastle 1.86; netty 4.1.139, Hadoop 3.4.3, Parquet 1.18.1.
1.0.02026-07-1581376Migrate to the Bulk Load CDK for significantly higher throughput on large syncs through parallel, back-pressured multipart uploads and SOCKET/PROTOBUF data transfer with compatible sources. Streams larger than approximately 200 MB may produce multiple objects, CSV and JSONL output is GZIP-compressed by default, and Airbyte metadata field names change. See Upgrading to 1.0.0.
0.4.92025-03-2155906Use M4 Compatible base image.
0.4.82025-01-1051479Use a non root base image
0.4.72024-12-1849884Use a base image: airbyte/java-connector-base:1.0.0
0.4.62024-02-1535285Adopt CDK 0.20.8
0.4.52024-02-0834745Adopt CDK 0.19.0
0.4.42023-07-1428345Increment patch to trigger a rebuild
0.4.32023-07-0527936Internal code update
0.4.22023-06-3027891Internal code update
0.4.12023-06-2827268Internal code update
0.4.02023-06-2627725License Update: Elv2
0.3.02023-04-2825570Fix: all integer schemas should be converted to Avro longs
0.2.172023-04-2725346Internal code cleanup
0.2.162023-03-1723788S3-Parquet: added handler to process null values in arrays
0.2.152023-03-1023466Changed S3 Avro type from Int to Long
0.2.142022-11-2321682Add support for buckets with Customer-Managed Encryption Key
0.2.132023-01-1821087Wrap Authentication Errors as Config Exceptions
0.2.122022-10-1817901Fix logging to GCS
0.2.112022-09-0116243Fix Json to Avro conversion when there is field name clash from combined restrictions (anyOf, oneOf, allOf fields)
0.2.102022-08-0514801Fix multiple log bindings
0.2.92022-06-2414114Remove "additionalProperties": false from specs for connectors with staging
0.2.82022-06-1713753Deprecate and remove PART_SIZE_MB fields from connectors based on StreamTransferManager
0.2.72022-06-1413483Added support for int, long, float data types to Avro/Parquet formats.
0.2.62022-05-1712820Improved 'check' operation performance
0.2.52022-05-0412578In JSON to Avro conversion, log JSON field values that do not follow Avro schema for debugging.
0.2.42022-04-2212167Add gzip compression option for CSV and JSONL formats.
0.2.32022-04-2211795Fix the connection check to verify the provided bucket path.
0.2.22022-04-0511728Properly clean-up bucket when running OVERWRITE sync mode
0.2.12022-04-0511499Updated spec and documentation.
0.2.02022-04-0411686Use serialized buffering strategy to reduce memory consumption; compress CSV and JSONL formats.
0.1.222022-02-1210256Add JVM flag to exist on OOME.
0.1.212022-02-1210299Fix connection check to require only the necessary permissions.
0.1.202022-01-119367Avro & Parquet: support array field with unknown item type; default any improperly typed field to string.
0.1.192022-01-109121Fixed check method for GCS mode to verify if all roles assigned to user
0.1.182021-12-308809Update connector fields title/description
0.1.172021-12-218574Added namespace to Avro and Parquet record types
0.1.162021-12-208974Release a new version to ensure there is no excessive logging.
0.1.152021-12-038386Add new GCP regions
0.1.142021-12-017732Support timestamp in Avro and Parquet
0.1.132021-11-037288Support Json additionalProperties.
0.1.22021-09-125720Added configurable block size for stream. Each stream is limited to 10,000 by GCS
0.1.12021-08-265296Added storing gcsCsvFileLocation property for CSV format. This is used by destination-bigquery (GCS Staging upload type)
0.1.02021-07-164329Initial release.