Resource

dcloud_iam_policy

A custom IAM policy. Managed policies (AdministratorAccess, …) already exist in every organization.

Example Usage

resource "dcloud_iam_policy" "dns_read" {
  name        = "dns-read"
  description = "Read every hosted zone"
  document = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Action   = ["dns:ListZones", "dns:GetZone"]
      Resource = "*"
    }]
  })
}

Schema

Required

  • document (String) Policy document (JSON); use jsonencode.
  • name (String) The policy’s name. Up to 128 characters.

Optional

  • description (String) What the policy is for. Up to 512 characters.

Read-Only

  • id (String) The resource's id.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import dcloud_iam_policy.dns_read <policy-id>

Generated from the provider's schema.