diff --git a/README.md b/README.md index 6036d13..b6cf636 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,41 @@ Please refer to the [variables.tf](variables.tf) and [iam\_group\_variable\_type # Outputs -No outputs \ No newline at end of file +No outputs + +## Requirements + +| Name | Version | +|------|---------| +| [dynatrace](#requirement\_dynatrace) | ~> 1.0 | + +## Providers + +| Name | Version | +|------|---------| +| [dynatrace](#provider\_dynatrace) | ~> 1.0 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [groups\_and\_bindings](#module\_groups\_and\_bindings) | ./groups_and_bindings | n/a | + +## Resources + +| Name | Type | +|------|------| +| [dynatrace_iam_policy.env_policy](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/iam_policy) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [accountUUID](#input\_accountUUID) | Root account UUID | `string` | n/a | yes | +| [groups\_and\_permissions](#input\_groups\_and\_permissions) | Map containing group name, federated values and policy attachment configuration |
map(object({| `{}` | no | +| [iam\_policies](#input\_iam\_policies) | Map of policy names and their policy query statement. | `map(string)` | n/a | yes | + +## Outputs + +No outputs. + \ No newline at end of file diff --git a/examples/main.tf b/examples/main.tf index 32df16c..55613d7 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -1,23 +1,22 @@ module "example" { source = "../" groups_and_permissions = { - autogroupasdtwo = { + group_one = { attached_policies = { - anotherautomated = { # Custom policy - policy_parameters = { # Options parameters for the policy binding - param1 = "value1" - } - policy_metadata = { # Options metadata for the policy binding - meta1 = "metaval1" - } + policy_static = { + environment = "tvy38111" } } } - autogroupasd = { + group_two = { attached_policies = { - anotherautomated = { # Custom policy - policy_parameters = { # Options parameters for the policy binding - param1 = "value1" + policy_with_param = { + environment = "tvy38111" + policy_parameters = { + zone = "zone1" + } + policy_metadata = { + meta1 = "metaval1" } } } @@ -25,22 +24,15 @@ module "example" { } iam_policies = { - testpolicy = { # Created but unused - policy_permissions = [ - "settings:objects:read", - "settings:schemas:read" - ] - policy_condition = "settings:schemaId = \"string\"" # Can be a complex condition - refer to Dynatrace documentation - } - anotherautomated = { - policy_permissions = [ - "settings:objects:read", - "settings:schemas:read" - ] - } + policy_with_param = <
# Refer to :
# https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/iam_group#federated_attribute_values-1
# and
# https://docs.dynatrace.com/docs/manage/identity-access-management/user-and-group-management/access-group-management
# for more details
federated_attribute_values = optional(list(string))
# Refer to https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/iam_policy_bindings_v2 and
# https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/iam_policy
# for more details.
# Please note that 'environment' is deprecated from the 'iam_policy'
# resource and therefore not supported here - only 'account' is supported
# For documentation on parameters refer to:
# https://docs.dynatrace.com/docs/manage/identity-access-management/permission-management/manage-user-permissions-policies/advanced/iam-policy-templating
attached_policies = optional(map(object({
policy_parameters = optional(map(string), null)
policy_metadata = optional(map(string), null)
environment = string
})), {})
}))