Resource

dcloud_iam_grant

Grants a principal named capabilities (secret.read-value, repository.push, …) on one resource. Deutsche Cloud writes it as a policy holding exactly those actions on exactly that resource name and attaches it; destroying the grant deletes that policy. The caller must hold every action it hands out.

Example Usage

variable "org_id" {
  type = string
}

# Lets the CI service account read one secret's value, and nothing else.
resource "dcloud_iam_grant" "ci_reads_token" {
  principal_kind = "user"
  principal_id   = dcloud_iam_user.ci.id
  resource       = "rn:ews::${var.org_id}:secrets:secret/${dcloud_secret.api_token.id}"
  capabilities   = ["secret.read-value"]
}

Schema

Required

  • capabilities (Set of String) Capability ids for that kind of resource, e.g. secret.read-value. Changing it replaces the resource.
  • principal_id (String) The IAM user, group or role. Changing it replaces the resource.
  • principal_kind (String) user, group or role. One of: user, group, role. Changing it replaces the resource.
  • resource (String) The resource name (rn:ews:…) of one resource of the organization; not a wildcard. Changing it replaces the resource.

Read-Only

  • actions (Set of String) The actions the capabilities stand for.
  • id (String) The resource's id.
  • policy_name (String) The name of the policy the grant is.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The id is the id of the policy the grant wrote.
terraform import dcloud_iam_grant.ci_reads_token <policy-id>

Generated from the provider's schema.