Il 15 settembre 2026, tutti gli ambienti Cloud Composer 1 e Cloud Composer 2 versione 2.0.x raggiungeranno la fine del ciclo di vita pianificata e non potrai più utilizzarli. Ti consigliamo di pianificare la migrazione a Cloud Composer 3.
Se vuoi utilizzare gli operatori Airflow per interagire con gli ambienti Cloud Composer, inclusi gli ambienti in altri progetti, consulta Attivare i DAG in altri ambienti e progetti.
Ti consigliamo di accedere alle risorse di altri Google Cloud progetti nel seguente modo:
Nei DAG, utilizza le connessioni predefinite preconfigurate nell'ambiente.
Ad esempio, la connessione google_cloud_default viene utilizzata da molti operatoriGoogle Cloud e viene configurata automaticamente quando crei un ambiente.
Concedi autorizzazioni e ruoli IAM aggiuntivi al
service account del tuo ambiente, in modo che possa accedere alle risorse di un altro progetto.
Determina l'account di servizio del tuo ambiente
Per determinare l'account di servizio del tuo ambiente:
Console
Nella Google Cloud console, vai alla pagina Ambienti.
Il valore è un indirizzo email, ad esempioservice-account-name@example-project.iam.gserviceaccount.com.
Concedi ruoli e autorizzazioni IAM per accedere alle risorse di un altro progetto
L'account di servizio del tuo ambiente richiede autorizzazioni per accedere alle risorse di un altro progetto. Questi ruoli e autorizzazioni possono essere diversi in base alla risorsa a cui vuoi accedere.
Accedere a una risorsa specifica
Ti consigliamo di concedere ruoli e autorizzazioni per risorse specifiche, ad esempio un singolo bucket Cloud Storage in un progetto diverso. In questo
approccio, utilizzi l'accesso basato sulle risorse con associazioni di ruoli condizionali.
Dopo aver concesso le autorizzazioni e i ruoli richiesti, puoi accedere alle risorse di un altro progetto con le stesse connessioni Airflow predefinite che utilizzi per accedere alle risorse del progetto in cui si trova il tuo ambiente.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-29 UTC."],[[["\u003cp\u003eThis document explains how to access resources in a different Google Cloud project from your Cloud Composer environment.\u003c/p\u003e\n"],["\u003cp\u003eThe recommended approach is to utilize the default connections in your DAGs and grant necessary IAM permissions to your environment's service account.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine your environment's service account through the Google Cloud console or the gcloud command-line tool, which is listed in the service account field on the environments details page.\u003c/p\u003e\n"],["\u003cp\u003eIAM roles and permissions should be granted to the environment's service account to access resources in other projects, either for specific resources or for an entire resource type.\u003c/p\u003e\n"],["\u003cp\u003eAfter granting permissions, resources in other projects can be accessed using the same default Airflow connections as those within your environment's project.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/access-resources-in-another-project \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/access-resources-in-another-project \"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 describes how to access resources that are located in a different\nGoogle Cloud project than your Cloud Composer environment.\n\nIf you want to use a service account from one project to run environments in\nanother project, see\n[Using a service account from another project](/composer/docs/composer-3/access-control#cross-project).\n\nIf you want to use Airflow operators to interact with Cloud Composer\nenvironments, including environments in other projects, see\n[Trigger DAGs in other environments and projects](/composer/docs/composer-3/trigger-dags-in-other-environments).\n\nWe recommend to access resources in other Google Cloud projects in the\nfollowing way:\n\n1. In your DAGs, use the default connections that are preconfigured in your\n environment.\n\n For example, the `google_cloud_default` connection is used by many\n Google Cloud operators and is automatically configured when you\n create an environment.\n2. Grant extra IAM permissions and roles to the\n [service account of your environment](/composer/docs/composer-3/access-control#service-account), so that it can\n access resources in a different project.\n\nDetermine the service account of your environment\n\nTo determine the service account of your environment: \n\nConsole\n\n1. In Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. In the list of environments, click the name of your environment.\n The **Environment details** page opens.\n\n3. Go to the **Environment configuration** tab.\n\n4. The service account of your environment is listed in\n the **Service account** field.\n\n The value is an email address, such as\n `service-account-name@example-project.iam.gserviceaccount.com`.\n\ngcloud \n\n gcloud composer environments describe \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --format=\"get(config.nodeConfig.serviceAccount)\"\n\nThe value is an email address, such as\n`service-account-name@example-project.iam.gserviceaccount.com`.\n\nGrant IAM roles and permissions to access resources in another project\n\nThe service account of your environment requires permissions to access\nresources in another project. These roles and permissions can be different\nbased on the resource that you want to access.\n\nAccess a specific resource\n\nWe recommend to grant roles and permissions for specific resources, such as a\nsingle Cloud Storage bucket located in a different project. In this\napproach, you use resource-based access with conditional role bindings.\n\nTo access a specific resource:\n\n1. Follow the [Configure resource-based access](/iam/docs/configuring-resource-based-access) guide.\n2. When granting roles and permissions, specify the [service account of your environment](#view-service-account) as a principal.\n\nAccess a resource type\n\nAs an alternative, you can grant roles and permissions based on the resource\ntype, such as all Cloud Storage buckets located in a different\nproject.\n\nTo access a resource type:\n\n1. Follow the [Manage access to other resources](/iam/docs/manage-access-other-resources) guide.\n2. When granting roles and permissions, specify the [service account of your environment](#view-service-account) as a principal.\n\nAfter you grant the required permissions and roles, you can access resources in\na different project with the same default Airflow connections\nthat you use to access resources in the project where your environment is\nlocated.\n\nWhat's next\n\n- [Access control with IAM](/composer/docs/composer-3/access-control)\n- [Manage Airflow connections](/composer/docs/composer-3/manage-airflow-connections)\n- [Configure resource location restrictions](/composer/docs/composer-3/configure-resource-location-restrictions)"]]