Sets the project's IAM policy and replaces any existing policy.
data "hcp_iam_policy" "example" {
bindings = [
{
role = "roles/contributor"
principals = [
"example-user-id-1",
"example-group-id-1",
"example-sp-1"
]
},
]
}
resource "hcp_project" "my_project" {
name = "example"
}
resource "hcp_project_iam_policy" "project_policy" {
project_id = hcp_project.my_project.resource_id
policy_data = data.hcp_iam_policy.example.policy_data
}
policy_data
(String) The policy to apply.project_id
(String) The ID of the HCP project to apply the IAM Policy to. If unspecified, the project configured on the provider is used.etag
(String) The etag captures the existing state of the policy.Import is supported using the following syntax:
# Project IAM Policy can be imported by specifying the project id
terraform import hcp_project_iam_policy.example 840e3701-55b6-4f86-8c17-b1fe397303c5