Pada 15 September 2026, semua lingkungan Cloud Composer 1 dan Cloud Composer 2 versi 2.0.x akan mencapai akhir masa pakainya yang direncanakan, dan Anda tidak akan dapat menggunakannya. Sebaiknya rencanakan migrasi ke Cloud Composer 3.
Anda dapat menentukan bucket Cloud Storage kustom sebagai bucket lingkungan
saat Anda membuat lingkungan. Lingkungan Anda menggunakan bucket ini dengan cara yang sama seperti bucket lingkungan default, dan bucket lingkungan default tidak dibuat.
Dengan bucket kustom, Anda dapat:
Gunakan konfigurasi bucket yang sesuai dengan persyaratan Anda.
Gunakan bucket yang ada secara terus-menerus untuk tujuan pengembangan atau pengujian berkala.
Gunakan kembali bucket yang ada dari lingkungan sebelumnya dan pertahankan integrasi data dan CI/CD.
Hapus dan buat ulang lingkungan tanpa perlu mentransfer data antar-bucket.
Isi bucket kustom dengan data yang diperlukan, seperti file DAG, lalu buat lingkungan.
Sebelum memulai
Bucket kustom harus berada di region yang sama dengan lingkungan.
Bucket multi-region dan dual-region tidak didukung.
Bucket kustom dan lingkungan harus berada dalam project yang sama.
Bucket kustom yang sama tidak dapat digunakan dengan beberapa lingkungan secara bersamaan. Cloud Composer akan menghasilkan error jika bucket yang ditentukan sudah digunakan oleh lingkungan lain. Anda dapat
menghapus lingkungan, lalu menggunakan bucket yang sama untuk lingkungan lain.
Cloud Composer tidak menambahkan izin IAM yang tidak ada ke bucket Cloud Storage saat digunakan untuk membuat lingkungan. Pastikan akun layanan lingkungan memiliki
izin dari peran Pekerja Composer di bucket.
Membuat lingkungan dengan bucket kustom
Konsol
Untuk menentukan bucket Cloud Storage kustom saat Anda membuat
lingkungan:
Di halaman Create environment, di bagian Advanced configuration, klik Show advanced configuration.
Pilih Bucket kustom.
Di kolom Bucket name, tentukan atau pilih bucket.
gcloud
Saat Anda membuat lingkungan, argumen --storage-bucket menentukan bucket kustom lingkungan.
CUSTOM_STORAGE_BUCKET: nama bucket Cloud Storage
(tanpa awalan gs://).
Contoh:
// POST https://composer.googleapis.com/v1/{parent=projects/*/locations/*}/environments{"name":"projects/example-project/locations/us-central1/environments/example-environment","storageConfig":{"bucket":"us-central1-example-bucket"}}
Terraform
Saat Anda membuat lingkungan, kolom bucket di blok storage_config menentukan bucket kustom lingkungan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eCloud Composer 3 allows users to specify a custom Cloud Storage bucket for their environment, rather than using the default bucket.\u003c/p\u003e\n"],["\u003cp\u003eCustom buckets offer benefits like using compliant configurations, reusing buckets across environments, and eliminating the need to transfer data during environment recreation.\u003c/p\u003e\n"],["\u003cp\u003eThe custom bucket must reside in the same region and project as the Cloud Composer environment, use the Standard storage class, and must not have any retention policies or locks.\u003c/p\u003e\n"],["\u003cp\u003eWhen creating an environment, users can specify the custom bucket name through the console, gcloud command, API, or Terraform.\u003c/p\u003e\n"],["\u003cp\u003eCloud Composer does not alter the encryption settings of a custom bucket and thus does not encrypt it with a CMEK key, so users can manually configure it.\u003c/p\u003e\n"]]],[],null,["# Use a custom environment's bucket\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/use-custom-bucket \"View this page for Cloud Composer 2\") \\| Cloud Composer 1\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nYou can specify a custom Cloud Storage bucket as an environment's bucket\nwhen you create an environment. Your environment uses this\nbucket in the same way as the [default environment's bucket](/composer/docs/composer-3/cloud-storage),\nand the default environment's bucket is not created.\n\nWith a custom bucket, you can:\n\n- Use a bucket configuration that is compliant with your requirements.\n- Use a continuously existing bucket for periodic development or testing purposes.\n- Reuse an existing bucket from a previous environment and keep CI/CD and data integrations.\n- Delete and re-create an environment without the need to transfer data between buckets.\n- Pre-populate the custom bucket with required data, such as your DAG files, and then create an environment.\n\nBefore you begin\n----------------\n\n- The custom bucket must be located in the same region as the environment. Multi-region and dual-region buckets are not supported.\n- The custom bucket and the environment must be in the same project.\n- The custom bucket must have the [Standard storage class](/storage/docs/storage-classes).\n- The custom bucket must have no [retention policies or retention policy locks](/storage/docs/bucket-lock) applied to it.\n- It is not possible to use the same custom bucket with several environments at\n the same time. Cloud Composer generates an error if the\n specified bucket is already used by another environment. It is possible to\n delete an environment and then use the same bucket for another environment.\n\n- Cloud Composer doesn't add any missing IAM\n permissions to the Cloud Storage bucket when it is used to create an\n environment. Make sure that the environment's service account has\n [permissions from the Composer Worker role](/composer/docs/composer-3/access-control) on the bucket.\n\n| **Warning:** Cloud Composer does not alter the encryption settings of a custom bucket and thus does not [encrypt it with a CMEK key](/composer/docs/composer-3/configure-cmek-encryption) (even if the project's policies require encryption). Specifically, the custom bucket's encryption is not changed if your environment uses CMEK encryption. Your custom bucket follows policies of the project that it belongs to. You can [manually encrypt](/storage/docs/encryption/using-customer-managed-keys) the environment's bucket with CMEK keys before you create an environment.\n\nCreate an environment with a custom bucket\n------------------------------------------\n\n### Console\n\nTo specify a custom Cloud Storage bucket when you create an\nenvironment:\n\n1. On the **Create environment** page, in the **Advanced configuration** section, click **Show advanced configuration**.\n2. Select **Custom bucket**.\n3. In the **Bucket name** field, specify or select a bucket.\n\n### gcloud\n\nWhen you create an environment, the `--storage-bucket` argument specifies the\nenvironment's custom bucket. \n\n gcloud composer environments create \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --storage-bucket \u003cvar translate=\"no\"\u003eCUSTOM_STORAGE_BUCKET\u003c/var\u003e\n\nReplace the following:\n\n- `ENVIRONMENT_NAME`: the name of your environment.\n- `LOCATION`: the region where the environment is located.\n- `CUSTOM_STORAGE_BUCKET`: the name of a Cloud Storage bucket. You can also specify the bucket URI (with the `gs://` prefix).\n\nExample: \n\n gcloud composer environments create example-environment \\\n --location us-cental1 \\\n --storage-bucket us-central1-example-bucket\n\n### API\n\nWhen you create an environment, in the [Environment](/composer/docs/reference/rest/v1/projects.locations.environments#Environment)\n\\\u003e [StorageConfig](/composer/docs/reference/rest/v1/projects.locations.environments#StorageConfig) resource, specify\na custom bucket for your environment. \n\n {\n \"name\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/environments/\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e\",\n \"storageConfig\": {\n \"bucket\": \"\u003cvar translate=\"no\"\u003eCUSTOM_STORAGE_BUCKET\u003c/var\u003e\"\n }\n }\n\nReplace the following:\n\n- `PROJECT_ID`: the [Project ID](/resource-manager/docs/creating-managing-projects).\n- `LOCATION`: the region where the environment is located.\n- `ENVIRONMENT_NAME`: the name of your environment.\n- `CUSTOM_STORAGE_BUCKET`: the name of a Cloud Storage bucket (without the `gs://` prefix).\n\nExample: \n\n // POST https://composer.googleapis.com/v1/{parent=projects/*/locations/*}/environments\n\n {\n \"name\": \"projects/example-project/locations/us-central1/environments/example-environment\",\n \"storageConfig\": {\n \"bucket\": \"us-central1-example-bucket\"\n }\n }\n\n### Terraform\n\nWhen you create an environment, the `bucket` field in the\n`storage_config` block specifies the environment's custom bucket.\n**Caution:** If you change the value of this field for an existing environment, Terraform deletes the existing environment and creates it again. \n\n resource \"google_composer_environment\" \"example\" {\n name = \"\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e\"\n region = \"\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\"\n\n storage_config {\n\n bucket = \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-err\"\u003eCUSTOM_STORAGE_BUCKET\u003c/span\u003e\u003c/var\u003e\n\n }\n }\n\nReplace the following:\n\n- `ENVIRONMENT_NAME`: the name of your environment.\n- `LOCATION`: the region where the environment is located.\n- `CUSTOM_STORAGE_BUCKET`: the name of a Cloud Storage bucket. You can also specify the bucket URI (with the `gs://` prefix).\n\nExample: \n\n resource \"google_composer_environment\" \"example\" {\n name = \"example-environment\"\n region = \"us-central1\"\n\n storage_config {\n\n bucket = \"gs://us-central1-example-bucket\"\n\n }\n }\n\nWhat's next\n-----------\n\n- [About the environment's bucket](/composer/docs/composer-3/cloud-storage)\n- [CMEK in Cloud Composer](/composer/docs/composer-3/configure-cmek-encryption)\n- [Create environments](/composer/docs/composer-3/create-environments)"]]