Einige oder alle Informationen auf dieser Seite gelten möglicherweise nicht für Trusted Cloud von S3NS. Weitere Informationen finden Sie unter
Unterschiede zu Google Cloud.
Organisationsrichtlinie mit Resource Manager erzwingen
Hinweise
-
Verify that billing is enabled for your Trusted Cloud project.
-
Enable the Compute Engine and Resource Manager APIs.
Enable the APIs
-
Make sure that you have the following role or roles on the organization:
Organization Policy > Organization Policy Administrator, Compute Engine > Compute Storage Admin
Check for the roles
-
In the Trusted Cloud console, go to the IAM page.
Go to IAM
-
Select the organization.
-
In the Principal column, find all rows that identify you or a group that
you're included in. To learn which groups you're included in, contact your
administrator.
-
For all rows that specify or include you, check the Role column to see whether
the list of roles includes the required roles.
Grant the roles
-
In the Trusted Cloud console, go to the IAM page.
Zu IAM
-
Wählen Sie die Organisation aus.
-
Klicken Sie auf person_add Zugriff erlauben.
-
Geben Sie im Feld Neue Hauptkonten Ihre Nutzer-ID ein.
Dies ist in der Regel die Kennung eines Nutzers in einem Workforce Identity-Pool. Weitere Informationen finden Sie unter
Workforce-Pool-Nutzer in IAM-Richtlinien darstellen oder Ihren Administrator.
-
Wählen Sie in der Liste Rolle auswählen eine Rolle aus.
-
Wenn Sie weitere Rollen hinzufügen möchten, klicken Sie auf add Weitere Rolle hinzufügen und fügen Sie weitere Rollen hinzu.
-
Klicken Sie auf Speichern.
Neues Projekt erstellen
So erstellen Sie eine Projektressource:
So erstellen Sie ein neues Projekt:
-
Öffnen Sie in der Trusted Cloud Console die Seite Ressourcen verwalten.
Zur Seite „Ressourcen verwalten“
Die verbleibenden Schritte werden in der Trusted Cloud Console angezeigt.
-
Wählen Sie oben auf der Seite in der Drop-down-Liste Organisation auswählen die Organisationsressource aus, in der Sie ein Projekt erstellen möchten. Wenn Sie eine kostenlose Testversion verwenden, überspringen Sie diesen Schritt, da diese Liste dann nicht angezeigt wird.
- Klicken Sie auf Projekt erstellen.
-
Geben Sie im angezeigten Fenster Neues Projekt einen Projektnamen ein und wählen Sie ggf. ein Rechnungskonto aus. Ein Projektname darf nur Buchstaben, Zahlen, einfache Anführungszeichen, Bindestriche, Leerzeichen oder Ausrufezeichen enthalten und muss zwischen 4 und 30 Zeichen lang sein.
-
Geben Sie die übergeordnete Organisations- oder Ordnerressource in das Feld Speicherort ein. Diese Ressource ist das hierarchisch übergeordnete Element des neuen Projekts. Wenn die Option Keine Organisation angezeigt wird, können Sie sie auswählen, um das neue Projekt als oberste Ebene seiner eigenen Ressourcenhierarchie zu erstellen.
- Nachdem Sie die Details zum neuen Projekt eingegeben haben, klicken Sie auf Erstellen.
Nach Erstellung des Projekts haben Sie die Rolle Inhaber.
Diese Rolle enthält alle Berechtigungen, die Sie in dieser Kurzanleitung benötigen.
Weitere Informationen zu Berechtigungen finden Sie unter Zugriff auf Ressourcen erteilen, ändern und entziehen.
Compute Engine-Laufwerk erstellen
Sie können die Funktion der Einschränkung für Ressourcenstandorte testen. Richten Sie dafür regionale, nichtflüchtige Speicher in Compute Engine ein. Zum Erstellen von regionalem nichtflüchtigem Speicher müssen Sie den Speicherort angeben. Weitere Informationen zum Erstellen regionaler nichtflüchtiger Speicher in Compute Engine finden Sie unter Regionale nichtflüchtige Speicher-Volumes erstellen und verwalten.
Rufen Sie in der Trusted Cloud Console die Seite Laufwerke auf.
Zur Seite „Laufwerke“
Wählen Sie das Projekt aus, das Sie zuvor erstellt haben.
- Wenn Sie aufgefordert werden, ein Rechnungskonto mit Ihrem Projekt zu verknüpfen, tun Sie dies jetzt.
Weitere Informationen zum Aktivieren der Abrechnung finden Sie unter Abrechnungseinstellungen eines Projekts ändern.
Klicken Sie auf Laufwerk erstellen.
Geben Sie einen Namen für Ihr Laufwerk an.
Wählen Sie Dieses Laufwerk innerhalb der Region replizieren aus.
Wählen Sie unter Region europe-north1 (Finland)
aus.
Wählen Sie unter Zonen europe-north1-a
und europe-north1-b
aus.
Klicken Sie auf Erstellen.
Wenn das Laufwerk erfolgreich erstellt wurde, wird neben dem Namen ein grünes Häkchen angezeigt.
Organisationsrichtlinie festlegen
So legen Sie für das erstellte Projekt eine Organisationsrichtlinie fest:
Rufen Sie in der Trusted Cloud Console die Seite Organisationsrichtlinien auf.
Zu den Organisationsrichtlinien
Klicken Sie auf Auswählen.
Wählen Sie das von Ihnen erstellte Projekt aus.
Klicken Sie auf Google Cloud Platform – Ressourcenstandorte definieren und anschließend auf Bearbeiten.
Wählen Sie unter Gilt für die Option Anpassen aus.
Wählen Sie unter Richtlinienwerte die Option Benutzerdefiniert aus.
Wählen Sie unter Richtlinientyp Zulassen aus.
Geben Sie in das Feld Richtlinienwert in:asia-locations
ein.
Klicken Sie auf Speichern. Es wird eine Benachrichtigung angezeigt, die die Richtlinienaktualisierung bestätigt.
asia-locations
ist eine Wertgruppe, die von Google ausgewählt wird, um alle Standorte in einer bestimmten geografischen Region einzubeziehen.
In diesem Fall ist jede Region in Asien als zulässiger Standort für Ressourcen definiert, die anschließend an diesen Punkt erstellt werden. Der zuvor erstellte, regionale nichtflüchtige Speicher ist von dieser neuen Richtlinie nicht betroffen, da diese nicht rückwirkend gilt.
Organisationsrichtlinie testen
Die Organisationsrichtlinie ist nun in Kraft und Sie können nur Ressourcen in Regionen erstellen, die in die Organisationsrichtlinie aufgenommen wurden. Zu Testzwecken können Sie versuchen, einen regionalen nichtflüchtigen Speicher an einem ungültigen Speicherort zu erstellen:
Rufen Sie in der Trusted Cloud Console die Seite Laufwerke auf.
Zur Seite „Laufwerke“
Wählen Sie das Projekt aus, das Sie oben erstellt haben.
Klicken Sie auf Laufwerk erstellen.
Geben Sie einen Namen für Ihr Laufwerk an.
Wählen Sie Dieses Laufwerk innerhalb der Region replizieren aus.
Wählen Sie unter Region europe-north1 (Finland)
aus.
Wählen Sie unter Zonen europe-north1-a
und europe-north1-b
aus.
Klicken Sie auf Erstellen.
Neben dem Namen wird ein rotes Ausrufezeichen angezeigt und eine Fehlermeldung wird eingeblendet:
Location ZONE:europe-north1-a violates constraint
constraints/gcp.resourceLocations on the resource RESOURCE_ID
Dabei ist RESOURCE_ID der vollständige Ressourcenpfad Ihres Projekts und des Laufwerks.
Das Laufwerk wird nicht erstellt.
Regionalen nichtflüchtigen Speicher an einem gültigen Speicherort erstellen
Die Einschränkung der Organisationsrichtlinie verhindert das Erstellen von Ressourcen, sofern Sie keinen gültigen Speicherort angeben:
Rufen Sie in der Trusted Cloud Console die Seite Laufwerke auf.
Zur Seite „Laufwerke“
Wählen Sie das Projekt aus, das Sie zuvor erstellt haben.
Klicken Sie auf Laufwerk erstellen.
Geben Sie einen Namen für Ihr Laufwerk an.
Wählen Sie Dieses Laufwerk innerhalb der Region replizieren aus.
Wählen Sie unter Region asia-east2 (Hong Kong)
aus.
Wählen Sie unter Zonen asia-east2-a
und asia-east2-b
aus.
Klicken Sie auf Erstellen.
Die Ressource wird erstellt, da alle Zonen unter asia-east2
innerhalb der Wertegruppe asia-locations
liegen.
Bereinigen
Mit den folgenden Schritten vermeiden Sie, dass Ihrem Trusted Cloud -Konto die auf dieser Seite verwendeten Ressourcen in Rechnung gestellt werden:
Regionalen nichtflüchtigen Speicher löschen
Löschen Sie die regionalen nichtflüchtigen Speicher, die Sie für diese Kurzanleitung erstellt haben:
Rufen Sie in der Trusted Cloud Console die Seite Laufwerke auf.
Zur Seite „Laufwerke“
Wählen Sie in der angezeigten Liste die beiden von Ihnen erstellten Laufwerke aus.
Klicken Sie rechts neben der Schaltfläche Laufwerk erstellen auf Löschen.
Klicken Sie im nun eingeblendeten Bestätigungsdialog auf Löschen.
Es wird ein Dialogfeld mit der Bestätigung angezeigt, dass die Laufwerke gelöscht wurden.
Projekt löschen
Löschen Sie das Projekt, das Sie für diese Kurzanleitung erstellt haben:
Rufen Sie in der Trusted Cloud Console die Seite Ressourcen verwalten auf.
Zur Seite „Ressourcen verwalten“
Wählen Sie im Drop-down-Menü oben auf der Seite die Organisation aus, in der Sie das Projekt erstellt haben.
Wählen Sie in der angezeigten Liste der Projektressourcen das von Ihnen erstellte Projekt aus und klicken Sie auf Löschen.
Geben Sie im Dialogfeld Projekt beenden die Projekt-ID ein und klicken Sie auf Beenden.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-08-18 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-18 (UTC)."],[],[],null,["# Quickstart: Enforce organization policy by using Resource Manager\n\nEnforce organization policy by using Resource Manager\n=====================================================\n\nThis guide describes how to set an [organization policy](/resource-manager/docs/organization-policy/overview) that\nincludes the [resource locations](/resource-manager/docs/organization-policy/defining-locations) constraint, and\nhow to test that constraint after it is applied in the\n[Google Cloud console](https://console.cloud.google.com/).\n\nBefore you begin\n----------------\n\n1.\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n2.\n\n\n Enable the Compute Engine and Resource Manager APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=compute.googleapis.com,cloudresourcemanager.googleapis.com&redirect=https://console.cloud.google.com)\n3.\n\n Make sure that you have the following role or roles on the organization:\n\n Organization Policy \\\u003e Organization Policy Administrator, Compute Engine \\\u003e Compute Storage Admin\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=organizationId)\n 2. Select the organization.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=organizationId)\n 2. Select the organization.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\nCreate new Project\n------------------\n\nTo create a Project resource, follow the steps below:\n\nTo create a new project, do the following:\n\n1. Go to the **Manage resources** page in the Google Cloud console.\n\n [Go to Manage Resources](https://console.cloud.google.com/cloud-resource-manager?walkthrough_id=resource-manager--create-project&start_index=1#step_index=1)\n\n The remaining steps appear in the Google Cloud console.\n2. On the **Select organization** drop-down list at the top of the page, select the organization resource in which you want to create a project. If you are a free trial user, skip this step, as this list does not appear.\n3. Click **Create Project**.\n4. In the **New Project** window that appears, enter a project name and select a billing account as applicable. A project name can contain only letters, numbers, single quotes, hyphens, spaces, or exclamation points, and must be between 4 and 30 characters.\n5. Enter the parent organization or folder resource in the **Location** box. That resource will be the hierarchical parent of the new project. If **No organization** is an option, you can select it to create your new project as the top level of its own resource hierarchy.\n6. When you're finished entering new project details, click **Create**.\n\nAfter you create the Project, the **Owner** role is assigned to you.\nThis role includes all of the permissions you need for the following quickstart.\nFor more information about permissions, see\n[Granting, changing, and revoking access to resources](/iam/docs/granting-changing-revoking-access).\n\nCreate a Compute Engine disk\n----------------------------\n\nTo test the functionality of the resource locations constraint, set up\nCompute Engine regional persistent disks. When you create a regional\npersistent disk, you must specify the location where it will reside. For more\ninformation about creating Compute Engine regional persistent disks, see\n[Create and manage regional Persistent Disk volumes](/compute/docs/disks/regional-persistent-disk).\n\n1. In the Google Cloud console, go to the **Disks** page.\n\n [Go to Disks](https://console.cloud.google.com/compute/disks)\n2. Select the Project you created previously.\n\n 1. If you are prompted to link a billing account to your Project, do so now. For more information about enabling billing, see [Modify a Project's Billing Settings](/billing/docs/how-to/modify-project#enable_billing_for_a_project).\n3. Click **Create Disk**.\n\n4. Specify a **Name** for your disk.\n\n5. Select **Replicate this disk within region**.\n\n6. Under **Region** , select `europe-north1 (Finland)`.\n\n7. Under **Zones** , select `europe-north1-a` and `europe-north1-b`.\n\n8. Click **Create**.\n\nWhen the disk is successfully created, a green check mark appears next to the\nname.\n\nSet the organization policy\n---------------------------\n\nTo set an organization policy on the Project you created:\n\n1. In the Google Cloud console, go to the **Organization policies** page.\n\n [Go to Organization policies](https://console.cloud.google.com/iam-admin/orgpolicies)\n2. Click **Select**.\n\n3. Select the Project you created.\n\n4. Click **Google Cloud Platform - Define Resource Locations** , and then\n click **Edit**.\n\n5. Under **Applies to** , select **Customize**.\n\n6. Under **Policy values** , select **Custom**.\n\n7. Under **Policy type** , select **Allow**.\n\n8. In the **Policy value** box, enter `in:asia-locations`.\n\n9. Click **Save**. A notification appears to confirm the policy update.\n\n`asia-locations` is a [value group](/resource-manager/docs/organization-policy/defining-locations#value_groups) that is\ncurated by Google to include every location in a particular geographic region.\nIn this case, every region in Asia is defined as an allowed location for any\nresources created after this point. Note that the regional persistent disk you\ncreated above is not affected by this new policy, because the policy is not\nretroactive.\n\nTesting the organization policy\n-------------------------------\n\nNow that the organization policy is in effect, you cannot create resources in\nregions that were not specified as part of the organization policy. To test\nthis, try to create a regional persistent disk in an invalid location:\n\n1. In the Google Cloud console, go to the **Disks** page.\n\n [Go to Disks](https://console.cloud.google.com/compute/disks)\n2. Select the Project you created above.\n\n3. Click **Create Disk**.\n\n4. Specify a **Name** for your disk.\n\n5. Select **Replicate this disk within region**.\n\n6. Under **Region** , select `europe-north1 (Finland)`.\n\n7. Under **Zones** , select `europe-north1-a` and `europe-north1-b`.\n\n8. Click **Create**.\n\nA red exclamation point appears next to the name, and an error notification\ndisplays: \n\n```\nLocation ZONE:europe-north1-a violates constraint\nconstraints/gcp.resourceLocations on the resource RESOURCE_ID\n```\n\nWhere \u003cvar translate=\"no\"\u003eRESOURCE_ID\u003c/var\u003e is the full resource path of your Project and disk.\nThe disk is not created.\n\nCreate regional persistent disk in valid location\n-------------------------------------------------\n\nThe organization policy constraint blocks the creation of resources unless you\nspecify a valid location:\n\n1. In the Google Cloud console, go to the **Disks** page.\n\n [Go to Disks](https://console.cloud.google.com/compute/disks)\n2. Select the Project you created previously.\n\n3. Click **Create Disk**.\n\n4. Specify a **Name** for your disk.\n\n5. Select **Replicate this disk within region**.\n\n6. Under **Region** , select `asia-east2 (Hong Kong)`.\n\n7. Under **Zones** , select `asia-east2-a` and `asia-east2-b`.\n\n8. Click **Create**.\n\nThe resource is created successfully because all zones under `asia-east2` are\nwithin the `asia-locations` value group.\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n### Delete regional persistent disks\n\nDelete the regional persistent disks you created for this quickstart:\n\n1. In the Google Cloud console, go to the **Disks** page.\n\n [Go to Disks](https://console.cloud.google.com/compute/disks)\n2. In the list that appears, select both of the disks that you created.\n\n3. To the right of the **Create Disk** button, click **Delete**.\n\n4. In the confirmation dialog that appears, click **Delete**.\n\nA notification dialog appears to confirm the disks were deleted.\n\n### Delete the Project\n\nDelete the Project you created for this quickstart:\n\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/cloud-resource-manager)\n2. In the drop-down at the top of the page, select the Organization in which\n you created the quickstart Project.\n\n3. In the list of Project resources that appears, select the Project that you\n created, then click **Delete**.\n\n4. On the **Shut down project** dialog that appears, enter the Project ID,\n and then click **Shut down**.\n\nWhat's next\n-----------\n\n- Learn more about [creating and managing organization policies](/resource-manager/docs/organization-policy/creating-managing-policies).\n- Review the [services that support the resource locations constraint](/resource-manager/docs/organization-policy/defining-locations-supported-services)."]]