-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiam.tf
62 lines (55 loc) · 1.95 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
resource "oci_identity_group" "bds_admin_grp" {
provider = oci.home
name = "bds_admin_grp"
description = "group for bds admins"
compartment_id = var.tenancy_ocid
// compartment_id = local.compartment_ocid
freeform_tags = {
"environment" = "bds-demo"
}
}
resource "oci_identity_user" "bds_admin_usr" {
provider = oci.home
name = "bds_admin_usr"
description = "user for managing BDS"
compartment_id = var.tenancy_ocid
// compartment_id = local.compartment_ocid
freeform_tags = {
"environment" = "bds-demo"
}
}
resource "oci_identity_user_group_membership" "user-group-membership" {
provider = oci.home
compartment_id = var.tenancy_ocid
// compartment_id = local.compartment_ocid
user_id = oci_identity_user.bds_admin_usr.id
group_id = oci_identity_group.bds_admin_grp.id
}
resource "oci_identity_compartment" "bds-demo-compartment" {
#Required
provider = oci.home
compartment_id = var.tenancy_ocid
description = "Compartment automatically created by https://github.com/filanovskiy/terraform-oci-bds to incapsulate all resources needed to show BDS stack"
name = var.compartment_name
//enable_delete = "true"
#Optional
freeform_tags = {
"environment" = "bds-demo"
}
}
resource "oci_identity_dynamic_group" "bds-demo-dg" {
#Required
provider = oci.home
compartment_id = var.tenancy_ocid
description = "$dynamic group for BDS Demo"
//matching_rule = "ALL { request.principal.type= 'ApiGateway' , request.resource.compartment.id = [${local.compartment_ocid}]}"
matching_rule = "any {instance.compartment.id = '${local.compartment_ocid}', request.resource.compartment.id = '${local.compartment_ocid}'}"
name = "bds-demo-dg"
#Optional
freeform_tags = { "environment" = "bds-demo" }
}
resource "oci_identity_ui_password" "user_ui_password" {
provider = oci.home
#Required
user_id = oci_identity_user.bds_admin_usr.id
}