| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Access Context Manager (VPC Service Controls)" |
| description: |- |
| AccessPolicy is a container for AccessLevels (which define the necessary |
| attributes to use GCP services) and ServicePerimeters (which define |
| regions of services able to freely pass data within a perimeter). |
| --- |
| |
| # google\_access\_context\_manager\_access\_policy |
| |
| AccessPolicy is a container for AccessLevels (which define the necessary |
| attributes to use GCP services) and ServicePerimeters (which define |
| regions of services able to freely pass data within a perimeter). An |
| access policy is globally visible within an organization, and the |
| restrictions it specifies apply to all projects within an organization. |
| |
| |
| To get more information about AccessPolicy, see: |
| |
| * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies) |
| * How-to Guides |
| * [Access Policy Quickstart](https://cloud.google.com/access-context-manager/docs/quickstart) |
| |
| ~> **Warning:** If you are using User ADCs (Application Default Credentials) with this resource, |
| you must specify a `billing_project` and set `user_project_override` to true |
| in the provider configuration. Otherwise the ACM API will return a 403 error. |
| Your account must have the `serviceusage.services.use` permission on the |
| `billing_project` you defined. |
| |
| ## Example Usage - Access Context Manager Access Policy Basic |
| |
| |
| ```hcl |
| resource "google_access_context_manager_access_policy" "access-policy" { |
| parent = "organizations/123456789" |
| title = "Org Access Policy" |
| } |
| ``` |
| ## Example Usage - Access Context Manager Access Policy Scoped |
| |
| |
| ```hcl |
| resource "google_project" "project" { |
| project_id = "acm-test-proj-123" |
| name = "acm-test-proj-123" |
| org_id = "123456789" |
| } |
| |
| resource "google_access_context_manager_access_policy" "access-policy" { |
| parent = "organizations/123456789" |
| title = "Scoped Access Policy" |
| scopes = ["projects/${google_project.project.number}"] |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `parent` - |
| (Required) |
| The parent of this AccessPolicy in the Cloud Resource Hierarchy. |
| Format: organizations/{organization_id} |
| |
| * `title` - |
| (Required) |
| Human readable title. Does not affect behavior. |
| |
| |
| - - - |
| |
| |
| * `scopes` - |
| (Optional) |
| Folder or project on which this policy is applicable. |
| Format: folders/{{folder_id}} or projects/{{project_id}} |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{name}}` |
| |
| * `name` - |
| Resource name of the AccessPolicy. Format: {policy_id} |
| |
| * `create_time` - |
| Time the AccessPolicy was created in UTC. |
| |
| * `update_time` - |
| Time the AccessPolicy was updated in UTC. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| AccessPolicy can be imported using any of these accepted formats: |
| |
| * `{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import AccessPolicy using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{name}}" |
| to = google_access_context_manager_access_policy.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), AccessPolicy can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_access_context_manager_access_policy.default {{name}} |
| ``` |