-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiam.tf
27 lines (24 loc) · 821 Bytes
/
iam.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
Last update : October, 2021
Author: [email protected]
Description: provision iam context for iacbox instance
*/
resource "oci_identity_dynamic_group" "iacbox" {
#Required
compartment_id = var.tenancy_ocid
description = "dynamic group for iacbox compute instance"
matching_rule = "instance.id = '${module.instance_iacbox.instance_id[0]}'"
name = "iacbox_instance"
}
resource "oci_identity_policy" "dynamic_group_iacbox" {
#Required
compartment_id = var.tenancy_ocid
description = "dynamic-group iacbox manage all-resources in tenancy"
name = "iacbox_tenancy_admin"
statements = local.iacbox_policy_statements
}
locals {
iacbox_policy_statements = [
"Allow dynamic-group ${oci_identity_dynamic_group.iacbox.name} to manage all-resources in tenancy"
]
}