google_access_context_manager_gcp_user_access_binding

Restricts access to Cloud Console and Google Cloud APIs for a set of users using Context-Aware Access.

To get more information about GcpUserAccessBinding, see:

Example Usage - Access Context Manager Gcp User Access Binding Basic

resource "google_cloud_identity_group" "group" {
  display_name = "my-identity-group"

  parent = "customers/A01b123xz"

  group_key {
    id = "my-identity-group@example.com"
  }

  labels = {
    "cloudidentity.googleapis.com/groups.discussion_forum" = ""
  }
}

resource "google_access_context_manager_access_level" "access_level_id_for_user_access_binding" {
  parent = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}"
  name   = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}/accessLevels/chromeos_no_lock"
  title  = "chromeos_no_lock"
  basic {
    conditions {
      device_policy {
        require_screen_lock = true
        os_constraints {
          os_type = "DESKTOP_CHROME_OS"
        }
      }
      regions = [
  "US",
      ]
    }
  }
}

resource "google_access_context_manager_access_policy" "access-policy" {
  parent = "organizations/123456789"
  title  = "my policy"
}



resource "google_access_context_manager_gcp_user_access_binding" "gcp_user_access_binding" {
  organization_id = "123456789"
  group_key       = trimprefix(google_cloud_identity_group.group.id, "groups/")
  access_levels   = [
    google_access_context_manager_access_level.access_level_id_for_user_access_binding.name,
  ]
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

GcpUserAccessBinding can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import GcpUserAccessBinding using one of the formats above. For example:

import {
  id = "{{name}}"
  to = google_access_context_manager_gcp_user_access_binding.default
}

When using the terraform import command, GcpUserAccessBinding can be imported using one of the formats above. For example:

$ terraform import google_access_context_manager_gcp_user_access_binding.default {{name}}