google_project_iam_custom_role

Allows management of a customized Cloud IAM project role. For more information see the official documentation and API.

Example Usage

This snippet creates a customized IAM role.

resource "google_project_iam_custom_role" "my-custom-role" {
  role_id     = "myCustomRole"
  title       = "My Custom Role"
  description = "A description"
  permissions = ["iam.roles.list", "iam.roles.create", "iam.roles.delete"]
}

Argument Reference

The following arguments are supported:

Attributes Reference

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

Import

Custom Roles can be imported using any of these accepted formats:

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

import {
  id = "projects/{{project}}/roles/{{role_id}}"
  to = google_project_iam_custom_role.default
}

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

$ terraform import google_project_iam_custom_role.default projects/{{project}}/roles/{{role_id}}
$ terraform import google_project_iam_custom_role.default {{project}}/{{role_id}}
$ terraform import google_project_iam_custom_role.default {{role_id}}