| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** 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 Approval" |
| description: |- |
| Access Approval enables you to require your explicit approval whenever Google support and engineering need to access your customer content. |
| --- |
| |
| # google\_project\_access\_approval\_settings |
| |
| Access Approval enables you to require your explicit approval whenever Google support and engineering need to access your customer content. |
| |
| |
| To get more information about ProjectSettings, see: |
| |
| * [API documentation](https://cloud.google.com/access-approval/docs/reference/rest/v1/projects) |
| |
| ## Example Usage - Project Access Approval Full |
| |
| |
| ```hcl |
| resource "google_project_access_approval_settings" "project_access_approval" { |
| project_id = "my-project-name" |
| notification_emails = ["testuser@example.com", "example.user@example.com"] |
| |
| enrolled_services { |
| cloud_product = "all" |
| enrollment_level = "BLOCK_ALL" |
| } |
| } |
| ``` |
| ## Example Usage - Project Access Approval Active Key Version |
| |
| |
| ```hcl |
| resource "google_kms_key_ring" "key_ring" { |
| name = "key-ring" |
| location = "global" |
| project = "my-project-name" |
| } |
| |
| resource "google_kms_crypto_key" "crypto_key" { |
| name = "crypto-key" |
| key_ring = google_kms_key_ring.key_ring.id |
| purpose = "ASYMMETRIC_SIGN" |
| |
| version_template { |
| algorithm = "EC_SIGN_P384_SHA384" |
| } |
| } |
| |
| data "google_access_approval_project_service_account" "service_account" { |
| project_id = "my-project-name" |
| } |
| |
| resource "google_kms_crypto_key_iam_member" "iam" { |
| crypto_key_id = google_kms_crypto_key.crypto_key.id |
| role = "roles/cloudkms.signerVerifier" |
| member = "serviceAccount:${data.google_access_approval_project_service_account.service_account.account_email}" |
| } |
| |
| data "google_kms_crypto_key_version" "crypto_key_version" { |
| crypto_key = google_kms_crypto_key.crypto_key.id |
| } |
| |
| resource "google_project_access_approval_settings" "project_access_approval" { |
| project_id = "my-project-name" |
| active_key_version = data.google_kms_crypto_key_version.crypto_key_version.name |
| |
| enrolled_services { |
| cloud_product = "all" |
| } |
| |
| depends_on = [google_kms_crypto_key_iam_member.iam] |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `enrolled_services` - |
| (Required) |
| A list of Google Cloud Services for which the given resource has Access Approval enrolled. |
| Access requests for the resource given by name against any of these services contained here will be required |
| to have explicit approval. Enrollment can only be done on an all or nothing basis. |
| A maximum of 10 enrolled services will be enforced, to be expanded as the set of supported services is expanded. |
| Structure is [documented below](#nested_enrolled_services). |
| |
| * `project_id` - |
| (Required) |
| ID of the project of the access approval settings. |
| |
| |
| <a name="nested_enrolled_services"></a>The `enrolled_services` block supports: |
| |
| * `cloud_product` - |
| (Required) |
| The product for which Access Approval will be enrolled. Allowed values are listed (case-sensitive): |
| all |
| appengine.googleapis.com |
| bigquery.googleapis.com |
| bigtable.googleapis.com |
| cloudkms.googleapis.com |
| compute.googleapis.com |
| dataflow.googleapis.com |
| iam.googleapis.com |
| pubsub.googleapis.com |
| storage.googleapis.com |
| |
| * `enrollment_level` - |
| (Optional) |
| The enrollment level of the service. |
| Default value is `BLOCK_ALL`. |
| Possible values are: `BLOCK_ALL`. |
| |
| - - - |
| |
| |
| * `notification_emails` - |
| (Optional) |
| A list of email addresses to which notifications relating to approval requests should be sent. |
| Notifications relating to a resource will be sent to all emails in the settings of ancestor |
| resources of that resource. A maximum of 50 email addresses are allowed. |
| |
| * `active_key_version` - |
| (Optional) |
| The asymmetric crypto key version to use for signing approval requests. |
| Empty active_key_version indicates that a Google-managed key should be used for signing. |
| This property will be ignored if set by an ancestor of the resource, and new non-empty values may not be set. |
| |
| * `project` - |
| (Optional, Deprecated) |
| Project id. |
| |
| ~> **Warning:** `project` is deprecated and will be removed in a future major release. Use `project_id` instead. |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `projects/{{project_id}}/accessApprovalSettings` |
| |
| * `name` - |
| The resource name of the settings. Format is "projects/{project_id}/accessApprovalSettings" |
| |
| * `enrolled_ancestor` - |
| If the field is true, that indicates that at least one service is enrolled for Access Approval in one or more ancestors of the Project. |
| |
| * `ancestor_has_active_key_version` - |
| If the field is true, that indicates that an ancestor of this Project has set active_key_version. |
| |
| * `invalid_key_version` - |
| If the field is true, that indicates that there is some configuration issue with the active_key_version |
| configured on this Project (e.g. it doesn't exist or the Access Approval service account doesn't have the |
| correct permissions on it, etc.) This key version is not necessarily the effective key version at this level, |
| as key versions are inherited top-down. |
| |
| |
| ## 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 |
| |
| |
| ProjectSettings can be imported using any of these accepted formats: |
| |
| * `projects/{{project_id}}/accessApprovalSettings` |
| * `{{project_id}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import ProjectSettings using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project_id}}/accessApprovalSettings" |
| to = google_project_access_approval_settings.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), ProjectSettings can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_project_access_approval_settings.default projects/{{project_id}}/accessApprovalSettings |
| $ terraform import google_project_access_approval_settings.default {{project_id}} |
| ``` |