Am 15. September 2026erreichen alle Cloud Composer 1- und Cloud Composer 2-Umgebungen der Version 2.0.x das geplante Ende des Lebenszyklus und können nicht mehr verwendet werden. Wir empfehlen, die Migration zu Cloud Composer 3 zu planen.
Auf dieser Seite wird gezeigt, wie Sie Einschränkungen für Ressourcenstandorte konfigurieren, um dafür zu sorgen, dass Ihre von Cloud Composer gespeicherten Daten an den von Ihnen angegebenen Speicherorten liegen.
Funktionsweise von Standortbeschränkungen
Standortbeschränkungen für Cloud Composer werden anhand der Organisationsrichtlinie festgelegt, die auf das Projekt angewendet wird, in dem die Cloud Composer-Umgebung erstellt wird. Diese Richtlinie wird entweder innerhalb des Projekts zugewiesen oder von der Organisation übernommen.
Bei aktivierten Standortbeschränkungen ist es nicht möglich, eine Umgebung in einer Region zu erstellen, die durch die Richtlinie verboten ist. Wenn eine Region in der Sperrliste aufgeführt oder nicht in der Zulassungsliste" aufgeführt ist, können Sie in dieser Region keine Umgebungen erstellen.
Damit die Erstellung von Umgebungen möglich ist, muss die Richtlinie die gesamte Region und nicht nur eine bestimmte Zone innerhalb dieser Region zulassen. Beispielsweise muss die Region europe-west3 von der Richtlinie zugelassen werden, um Cloud Composer-Umgebungen in dieser Region zu erstellen.
Cloud Composer prüft die Standortbeschränkungen unter:
Umgebung erstellen
Umgebungsupgrade, falls während des Vorgangs zusätzliche Ressourcen erstellt werden
Aktualisierung der Umgebung für ältere Umgebungen, die keine Standorteinschränkungen für Cloud Composer-Abhängigkeiten erzwingen
Neben den Standortbeschränkungen führt Cloud Composer folgende Schritte aus:
Benutzerdefinierte Airflow-Images in regionalen Artifact Registry-Repositories speichern
Wenn die Multiregion US durch die Richtlinie explizit verboten ist, ist die Verwendung von Cloud Build deaktiviert. In diesem Fall werden in Ihrem GKE-Cluster benutzerdefinierte Airflow-Images erstellt.
Python-Abhängigkeit in einer privaten IP-Umgebung mit Einschränkungen für Ressourcenstandorte installieren
Wenn Sie für Ihr Projekt Einschränkungen für den Ressourcenstandort festlegen, kann Cloud Build nicht zum Installieren von Python-Paketen verwendet werden. Daher ist der direkte Zugriff auf Repositories im öffentlichen Internet deaktiviert.
Wenn Sie Python-Abhängigkeiten in einer privaten IP-Umgebung installieren möchten, wenn Ihre Standortbeschränkungen den multiregionalen Standort US nicht zulassen, verwenden Sie eine der folgenden Optionen:
Stellen Sie mit einem Proxyserver in Ihrem VPC-Netzwerk eine Verbindung zu einem PyPI-Repository im öffentlichen Internet her. Geben Sie die Proxyadresse in der Datei /config/pip/pip.conf im Cloud Storage-Bucket an.
Wenn Ihre Sicherheitsrichtlinie den Zugriff auf Ihr VPC-Netzwerk von externen IP-Adressen aus zulässt, können Sie Cloud NAT konfigurieren.
Speichern Sie die Python-Abhängigkeiten im Ordner dags im Cloud Storage-Bucket, um sie als lokale Bibliotheken zu installieren.
Dies ist möglicherweise keine gute Option, wenn die Abhängigkeitsstruktur groß ist.
Standorte für Cloud Composer-Logs einschränken
Wenn Ihre Cloud Composer-Logs sensible Daten enthalten, sollten Sie Cloud Composer-Logs an einen regionalen Cloud Storage-Bucket weiterleiten. Verwenden Sie dazu eine Logsenke. Nachdem Sie Logs an einen Cloud Storage-Bucket weitergeleitet haben, werden Ihre Logs nicht an Cloud Logging gesendet.
LOCATION durch die Region, in der sich die Umgebung befindet.
BUCKET_NAME durch den Namen des Buckets. Beispiel: composer-logs-us-central1-example-environment
Erstellen Sie eine neue Logsenke.
gcloudloggingsinkscreate\
composer-log-sink-ENVIRONMENT_NAME\
storage.googleapis.com/BUCKET_NAME\
--log-filter"resource.type=cloud_composer_environment AND \resource.labels.environment_name=ENVIRONMENT_NAME AND \resource.labels.location=LOCATION"
Ersetzen Sie:
ENVIRONMENT_NAME durch den Namen der Umgebung.
BUCKET_NAME durch den Namen des Buckets.
LOCATION durch die Region, in der sich die Umgebung befindet.
Die Ausgabe des vorherigen Befehls enthält die Dienstkontonummer. Weisen Sie diesem Dienstkonto die Rolle Storage-Objekt-Ersteller zu:
SA_NUMBER durch die Dienstkontonummer, die im vorherigen Schritt durch den Befehl gcloud logging sinks create bereitgestellt wurde.
Schließen Sie die Logs für Ihre Umgebung von Logging aus.
gcloudloggingsinksupdate_Default\
--add-exclusionname=ENVIRONMENT_NAME-exclusion,filter=\"resource.type=cloud_composer_environment AND \resource.labels.environment_name=ENVIRONMENT_NAME AND \resource.labels.location=LOCATION"
Ersetzen Sie:
ENVIRONMENT_NAME durch den Namen der Umgebung.
LOCATION durch die Region, in der sich die Umgebung befindet.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-26 (UTC)."],[[["\u003cp\u003eThis document details how to configure resource location restrictions for Cloud Composer environments, ensuring data remains within specified locations, which is determined by the organizational policy applied to the project.\u003c/p\u003e\n"],["\u003cp\u003eWith location restrictions, environments cannot be created in denied regions, and the policy must allow the entire region, not just a specific zone, for environment creation within it to be possible.\u003c/p\u003e\n"],["\u003cp\u003eWhen using Private IP environments and resource location restrictions disallow the \u003ccode\u003eUS\u003c/code\u003e multi-region, users must utilize a private PyPI repository, a proxy server, Cloud NAT, or local library installation from the \u003ccode\u003edags\u003c/code\u003e folder to install Python dependencies.\u003c/p\u003e\n"],["\u003cp\u003eTo redirect Cloud Composer logs containing sensitive data to a regional Cloud Storage bucket, users can employ a log sink, after which logs will no longer be sent to Cloud Logging, and certain steps are outlined to make this possible.\u003c/p\u003e\n"],["\u003cp\u003eThe location restrictions are checked at the time of environment creation, environment upgrade if it causes additional resource creation, and environment update for older environments.\u003c/p\u003e\n"]]],[],null,["# Configure resource location restrictions\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/configure-resource-location-restrictions \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/configure-resource-location-restrictions \"View this page for 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\nThis page shows how to configure\n[resource location restrictions](/resource-manager/docs/organization-policy/defining-locations)\nso that your data stored by Cloud Composer is kept within\nthe locations you specify.\n\nHow location restrictions work\n------------------------------\n\nLocation restrictions for Cloud Composer are determined based\non the organizational policy that is applied to the project where\nthe Cloud Composer environment is created. This policy is assigned\neither within the project or is inherited from the organization.\n\nWith location restrictions enabled, it is not possible to create\nan environment in a region that is prohibited by the policy. If a region\nis listed in the Deny list, or is not listed in the Allow list, then you\ncannot create environments in this region.\n\nTo enable the creation of environments, the policy must allow the whole region\nand not a specific zone within this region. For example, the `europe-west3`\nregion must be allowed by the policy in order to create\nCloud Composer environments in this region.\n\nCloud Composer checks location restrictions at:\n\n- Environment creation.\n- Environment upgrade, if any additional resources are created during the operation.\n- Environment update, for older environments that do not enforce location restrictions on Cloud Composer dependencies.\n\nIn addition to checking the location restrictions, Cloud Composer\ndoes the following:\n\n- Stores user-customized Airflow images in regional Artifact Registry repositories. As an example, such images are created when you install custom PyPI images in your environment.\n- If the [`US` multi-region](/storage/docs/locations#location-mr) is explicitly prohibited by the policy, Cloud Build use is disabled. In this case, user-customized Airflow images are built in your environment's cluster.\n\nInstall a Python dependency to a private IP environment with resource location restrictions\n-------------------------------------------------------------------------------------------\n\nIf you set resource location restrictions for your project, then\nCloud Build can't be used to install Python packages. As a consequence,\ndirect access to repositories on the public internet is disabled.\n\nTo install Python dependencies in a Private IP environment when your\nlocation restrictions don't allow the [`US` multi-region](/storage/docs/locations#location-mr), use\none of the following options:\n\n- Use a private\n [PyPI repository hosted in your VPC network](/composer/docs/composer-3/install-python-dependencies#install-private-repo).\n\n- Use a\n [proxy server](https://pip.pypa.io/en/stable/user_guide/#using-a-proxy-server)\n in your VPC network to connect to a PyPI repository on the public\n internet. Specify the proxy address in the `/config/pip/pip.conf` file in\n the Cloud Storage bucket.\n\n- If your security policy permits access to your VPC network from external\n IP addresses, you can configure [Cloud NAT](/nat/docs/overview).\n\n- Store the Python dependencies in the `dags` folder in\n the Cloud Storage bucket, to\n [install them as local libraries](/composer/docs/composer-3/install-python-dependencies#install-local).\n This might not be a good option if the dependency tree is large.\n\nRestrict locations for Cloud Composer logs\n------------------------------------------\n\nIf your Cloud Composer logs contain sensitive data, you might want\nto redirect Cloud Composer logs to a regional\nCloud Storage bucket. To do so, use\na [log sink](/logging/docs/export/configure_export_v2). After you redirect logs to\na Cloud Storage bucket, your logs are not sent to Cloud Logging.\n**Caution:** To get support from Cloud Customer Care, you might need to grant Google support engineers access to the Cloud Composer logs stored in Cloud Storage. \n\n### gcloud\n\n1. Create a new Cloud Storage bucket.\n\n gcloud storage buckets create gs://\u003cvar translate=\"no\"\u003eBUCKET_NAME\u003c/var\u003e --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\n Replace:\n - `LOCATION` with the region where the environment is located.\n - `BUCKET_NAME` with the name of the bucket. For example, `composer-logs-us-central1-example-environment`.\n2. Create a new log sink.\n\n gcloud logging sinks create \\\n composer-log-sink-\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n storage.googleapis.com/\u003cvar translate=\"no\"\u003eBUCKET_NAME\u003c/var\u003e \\\n --log-filter \"resource.type=cloud_composer_environment AND \\\n resource.labels.environment_name=\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e AND \\\n resource.labels.location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\"\n\n Replace:\n - `ENVIRONMENT_NAME` with the name of the environment.\n - `BUCKET_NAME` with the name of the bucket.\n - `LOCATION` with the region where the environment is located.\n3. The output of the previous command contains the service\n account number. Grant the **Storage Object Creator** role to this\n service account:\n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:\u003cvar translate=\"no\"\u003eSA_NUMBER\u003c/var\u003e@gcp-sa-logging.iam.gserviceaccount.com\" \\\n --role='roles/storage.objectCreator' \\\n --condition=None\n\n Replace:\n - `PROJECT_ID` with the [Project ID](/resource-manager/docs/creating-managing-projects).\n - `SA_NUMBER` with the service account number provided by the `gcloud logging sinks create` command on the previous step.\n4. Exclude the logs for your environment from Logging.\n\n **Caution:** [Audit logs](/logging/docs/audit) cannot be excluded. They are always sent to the default storage. \n\n gcloud logging sinks update _Default \\\n --add-exclusion name=\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e-exclusion,filter=\\\n \"resource.type=cloud_composer_environment AND \\\n resource.labels.environment_name=\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e AND \\\n resource.labels.location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\"\n\n Replace:\n - `ENVIRONMENT_NAME` with the name of the environment.\n - `LOCATION` with the region where the environment is located.\n\nWhat's next\n-----------\n\n- [Cloud Composer security overview](/composer/docs/composer-3/composer-security-overview)\n- [Access control](/composer/docs/composer-3/access-control)"]]