FEATURES PRICING ABOUT DOCS LOGIN

google_iam_policy

Generates an IAM policy document that may be referenced by and applied to other Google Cloud Platform resources, such as the google_project resource.

data "google_iam_policy" "admin" {
  binding {
    role = "roles/compute.instanceAdmin"
    members = [
      "serviceAccount:your-custom-sa@your-project.iam.gserviceaccount.com",
    ]
  }
  binding {
    role = "roles/storage.objectViewer"
    members = [
      "user:evanbrown@google.com",
    ]
  }
}

This data source is used to define IAM policies to apply to othe resources. Currently, defining a policy through a datasource and referencing that policy from another resource is the only way to apply an IAM policy to a resource.

Argument Reference

The following arguments are supported:

Each document configuration must have one or more binding blocks, which each accept the following arguments:

Attributes Reference

The following attribute is exported:


See the source of this document at Terraform.io

REQUEST A DEMO