이 페이지에서는 개발자의 프로젝트에 속하는 유형 및 유형 공급자를 다른 프로젝트와 공유하는 방법을 설명합니다. 예를 들어 개발자의 회사를 위해 사전 승인된 유형 공급자를 유지 관리해야 하는 프로젝트가 있다고 가정해보세요. 이를 위해서는 개발자가 해당 프로젝트의 유형 공급자를 다른 프로젝트와 공유하고 프로젝트를 유형 중앙 저장소로 사용해야 할 수 있습니다.
또한 이 메서드를 사용하여 프로젝트 간에 복합 유형을 공유할 수도 있습니다.
액세스 권한을 설정하려면 이 유형을 소유하는 프로젝트의 프로젝트 소유자가 이 유형을 사용할 프로젝트의 서비스 계정에 deploymentmanager.typeViewer (베타) 역할을 부여해야 합니다. 또한 다른 프로젝트의 유형을 보고 나열할 사용자에게도 이 역할을 부여해야 합니다.
프로젝트의 서비스 계정에 deploymentmanager.typeViewer 역할을 부여하면 프로젝트가 구성에서 이러한 유형을 배포할 수 있지만 사용자가 이러한 유형을 보거나 나열할 수 없습니다. 개별 사용자가 유형을 볼 수 있도록 하려면 각 사용자에게 deploymentmanager.typeViewer 역할을 부여해야 합니다.
예를 들어 Jane이 자신에게 속하지 않는 프로젝트에 gcloud beta deployment-manager types list --project another-project 명령어를 실행할 수 있도록 하려면 another-project 소유자가 Jane에게 deploymentmanager.typeViewer 역할을 부여해야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis page outlines how to share project-specific types and type providers with other projects by granting the \u003ccode\u003edeploymentmanager.typeViewer\u003c/code\u003e (beta) role.\u003c/p\u003e\n"],["\u003cp\u003eSharing types requires a project owner to grant the \u003ccode\u003edeploymentmanager.typeViewer\u003c/code\u003e role to the consuming project's Google APIs service account, allowing the project to deploy those types.\u003c/p\u003e\n"],["\u003cp\u003eTo enable individual users to list and view shared types, the project owner must also grant each user the \u003ccode\u003edeploymentmanager.typeViewer\u003c/code\u003e role.\u003c/p\u003e\n"],["\u003cp\u003eThe shared types can then be specified in configurations using the syntax \u003ccode\u003e[PROJECT_ID]/composite:[TYPE]\u003c/code\u003e for composite types or \u003ccode\u003e[PROJECT_ID]/[TYPE]:[COLLECTION]\u003c/code\u003e for type providers, where \u003ccode\u003e[PROJECT_ID]\u003c/code\u003e is the project owning the type.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edeploymentmanager.typeViewer\u003c/code\u003e role is a beta offering which is subject to the Pre-GA Offerings Terms and has certain limitations, such as not being able to limit sharing to individual types or to use it with \u003ccode\u003eallAuthenticatedUsers\u003c/code\u003e or \u003ccode\u003eallUsers\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Sharing Types Across Projects\n\n| **Beta**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to share\n[types and type providers](/deployment-manager/docs/fundamentals#types) that\nbelong to your project with other projects. For example, assume you have a\nproject that is responsible for maintaining pre-approved type providers for your\ncompany. You want to be able to share these type providers from that project\nwith other projects and to use the project as a central repository of types.\nSimilarly, you can also use this method to share composite types across\nprojects.\n\nTo set up access, a project owner from the project that owns the type\nwill need to grant the `deploymentmanager.typeViewer` (beta) role to the service\naccount of the project that wants to consume the types. They also need to\ngrant the role to users who want to view and list types from another project..\n\nBefore you begin\n----------------\n\n- If you want to use the command-line examples in this guide, install the [\\`gcloud\\` command-line tool](/sdk).\n- If you want to use the API examples in this guide, set up [API access](/deployment-manager/docs/reference/latest).\n- Read about Deployment Manager [configurations](/deployment-manager/docs/configuration/create-basic-configuration).\n- Read about [Types](/deployment-manager/docs/fundamentals#types).\n- Read the [Identity and Access Management (IAM)](/iam) documentation.\n\nLimitations\n-----------\n\nThe following are restrictions for using this feature:\n\n- Granting the `deploymentmanager.typeViewer` role grants permissions to all types in the specific project. It is not possible to limit sharing to individual types.\n- It is not possible to grant this role to [`allAuthenticatedUsers`](/iam/docs/principals-overview#allauthenticatedusers) or [`allUsers`](/iam/docs/principals-overview#allusers).\n\nGranting a project access to use types\n--------------------------------------\n\nTo grant access to types that belong to other projects, the owner of the\nproject that owns the types in question must grant the `deploymentmanager.typeViewer`\nrole to the\n[Google APIs service account](/deployment-manager/docs/access-control#access_control_for_deployment_manager)\nof the project that wants to consume the types.\n\n1. Go to the IAM page in the Google Cloud console of the project that will be consuming the types. [Go to the IAM page](https://console.cloud.google.com/iam-admin/iam/)\n\n2. If prompted, select your project from the list.\n3. Look for the **Google APIs service account**, which has the email\n address in the following format:\n\n [PROJECT_NUMBER]@cloudservices.gserviceaccount.com\n\n | **Note:** This email address requires the project number, not the project ID. To learn how to identify the project number, see [Identifying projects](/compute/docs/projects#projectids).\n4. Make note of the email address above. Next, a project owner of the project\n where the desired types live can grant the Google APIs service account\n the `roles/deploymentmanager.typeViewer` role.\n\n\n ### Console\n\n 1. While still in the Google Cloud console, go to the IAM page of the project that contains the types you want to share. [Go to the IAM page](https://console.cloud.google.com/iam-admin/iam/)\n\n 2. Select the project from the project list.\n 3. Click the **Add** button to add a new member.\n 4. In the **Members** box, enter the email address of the service account.\n 5. Expand the **Roles** dropdown and select **Other \\\u003e Deployment Manager Types Viewer (beta)**.\n 6. Click **Add** to add the account.\n\n ### gcloud\n\n With the Google Cloud CLI, add a binding to the IAM policy for the project: \n\n ```\n gcloud projects add-iam-policy-binding [PROJECT_ID] \\\n --member serviceAccount:[SERVICE_ACCOUNT_EMAIL] --role roles/deploymentmanager.typeViewer\n ```\n\n where:\n - `[PROJECT_ID]` is the ID of the project containing images you want to share.\n - `[SERVICE_ACCOUNT_EMAIL]` is the email of the service account in the project you want to share types with.\n\n For example: \n\n ```\n gcloud projects add-iam-policy-binding database-images \\\n --member serviceAccount:123456789012@cloudservices.gserviceaccount.com \\\n --role roles/deploymentmanager.typeViewer\n ```\n\n ### API\n\n In the API, make a `POST` request to the following URL, where\n `[PROJECT_ID]` is the ID of the project containing the types you want to\n share. \n\n POST https://cloudresourcemanager.googleapis.com/v1/projects/$[PROJECT_ID]:setIamPolicy\n\n The request body should contain the list of bindings you want to apply\n to this project. The `roles/deploymentmanager.typeViewer` role should be part\n of the binding. For example: \n\n {\n \"policy\": {\n \"version\": \"0\",\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:example@gmail.com\"\n ]\n },\n {\n \"role\": \"roles/deploymentmanager.typeViewer\",\n \"members\": [\n \"serviceAccount:123456789012@cloudservices.gserviceaccount.com\"\n ]\n }\n ]\n }\n\n }\n\n \u003cbr /\u003e\n\nUsing types from other projects in your configuration\n-----------------------------------------------------\n\nOnce you have access to your types, you can specify the type in\nconfigurations using the syntax. For\n[composite types](/deployment-manager/docs/configuration/composite-types/creating-composite-types): \n\n type: [PROJECT_ID]/composite:[TYPE]\n\nFor [type providers](/deployment-manager/docs/configuration/type-providers/process-adding-api): \n\n type: [PROJECT_ID]/[TYPE]:[COLLECTION]\n\nWhere:\n\n- `[PROJECT_ID]` is the project ID that owns the type.\n- `[TYPE]` is the name of the type provider or the composite type.\n- `[COLLECTION]` is the specific resource you are creating. This is only applicable for base types. For more information on specifying base types, read [Calling a Type Provider in a Configuration](/deployment-manager/docs/configuration/type-providers/calling-type-provider).\n\nFor example, if the project ID is `my-type-repository`, then you might\nprovide the following type specification: \n\n```\nresources:\n- name: a-special-vm\n type: my-type-repository/composite:autoscaled-igm\n properties:\n ...\n```\n\nGranting users the ability to list and view types\n-------------------------------------------------\n\nGranting the project's service account the `deploymentmanager.typeViewer` role\nallows the project to deploy these types in your configurations but does not\nallow users to view or list these types. If you want to grant individual users\nto ability to view types, you must grant the `deploymentmanager.typeViewer`\nrole to each user.\n\nFor example, in order for Jane to run the\n`gcloud beta deployment-manager types list --project another-project`\ncommand for a project that doesn't belong to her, the owner of `another-project`\nmust grant Jane the `deploymentmanager.typeViewer` role.\n\nUsing the gcloud CLI, you can grant Jane the role like so: \n\n gcloud projects add-iam-policy-binding another-project \\\n --member user:jane@gmail.com --role deploymentmanager.typeViewer\n\nFor comprehensive instructions on adding and removing roles from users,\nread the documentation for\n[granting, changing, and revoking access to project members](/iam/docs/granting-changing-revoking-access).\n\nWhat's next?\n------------\n\n- Read about other [IAM roles](/iam/docs/understanding-roles) you can grant.\n- Learn more about [service accounts](/compute/docs/access/service-accounts)."]]