generated from oracle-quickstart/oci-quickstart-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam.tf
21 lines (19 loc) · 1.07 KB
/
iam.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
resource "oci_identity_dynamic_group" "bucket_uploader_vm_dg" {
#Required
compartment_id = var.tenancy_ocid
provider = oci.home
description = "DG for VM which upload captured packet to user specified bucket"
matching_rule = " ALL {instance.compartment.id = '${var.compartment_ocid}'}"
name = "bkt_uploader_vm_dg"
}
resource "oci_identity_policy" "bucket_put_policy" {
depends_on = [oci_identity_dynamic_group.bucket_uploader_vm_dg]
compartment_id = var.compartment_ocid
provider = oci.home
description = "Identity policy for DG for VM to allow upload captured packet to user specified bucket"
name = "bkt_put_policy"
statements = [
"Allow dynamic-group bkt_uploader_vm_dg to read buckets in compartment '${data.oci_identity_compartment.compartment.name}' ",
"Allow dynamic-group bkt_uploader_vm_dg to manage objects in compartment '${data.oci_identity_compartment.compartment.name}' where any {request.permission='OBJECT_CREATE', request.permission='OBJECT_INSPECT', request.region = '${local.region_key}'}"
]
}