-
Notifications
You must be signed in to change notification settings - Fork 0
/
policies.tf
69 lines (57 loc) · 2.72 KB
/
policies.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
63
64
65
66
67
68
69
## Copyright (c) 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
# Functions Policies
#resource "oci_identity_policy" "FunctionsServiceReposAccessPolicy" {
# provider = oci.homeregion
# name = "FunctionsServiceReposAccessPolicy-${random_id.tag.hex}"
# description = "FunctionsServiceReposAccessPolicy-${random_id.tag.hex}"
# compartment_id = var.tenancy_ocid
# statements = ["Allow service FaaS to read repos in tenancy"]
# provisioner "local-exec" {
# command = "sleep 5"
# }
#}
#resource "oci_identity_policy" "FunctionsServiceNetworkAccessPolicy" {
# provider = oci.homeregion
# depends_on = [oci_identity_policy.FunctionsDevelopersManageNetworkAccessPolicy]
# name = "FunctionsServiceNetworkAccessPolicy-${random_id.tag.hex}"
# description = "FunctionsServiceNetworkAccessPolicy-${random_id.tag.hex}"
# compartment_id = var.tenancy_ocid
# statements = ["Allow service FaaS to use virtual-network-family in compartment id ${var.compartment_ocid}"]
#
# provisioner "local-exec" {
# command = "sleep 5"
# }
#}
resource "oci_identity_policy" "FunctionsServiceObjectStorageManageAccessPolicy" {
provider = oci.homeregion
name = "FunctionsServiceObjectStorageManageAccessPolicy-${random_id.tag.hex}"
description = "FunctionsServiceObjectStorageManageAccessPolicy-${random_id.tag.hex}"
compartment_id = var.tenancy_ocid
statements = ["Allow service objectstorage-${var.region} to manage object-family in tenancy"]
provisioner "local-exec" {
command = "sleep 5"
}
}
resource "oci_identity_dynamic_group" "FunctionsServiceDynamicGroup" {
provider = oci.homeregion
# depends_on = [oci_identity_policy.FunctionsServiceNetworkAccessPolicy]
name = "FunctionsServiceDynamicGroup-${random_id.tag.hex}"
description = "FunctionsServiceDynamicGroup-${random_id.tag.hex}"
compartment_id = var.tenancy_ocid
matching_rule = "ALL {resource.type = 'fnfunc', resource.compartment.id = '${var.compartment_ocid}'}"
provisioner "local-exec" {
command = "sleep 5"
}
}
resource "oci_identity_policy" "FunctionsServiceDynamicGroupPolicy" {
provider = oci.homeregion
depends_on = [oci_identity_dynamic_group.FunctionsServiceDynamicGroup]
name = "FunctionsServiceDynamicGroupPolicy-${random_id.tag.hex}"
description = "FunctionsServiceDynamicGroupPolicy-${random_id.tag.hex}"
compartment_id = var.compartment_ocid
statements = ["allow dynamic-group ${oci_identity_dynamic_group.FunctionsServiceDynamicGroup.name} to manage all-resources in compartment id ${var.compartment_ocid}"]
provisioner "local-exec" {
command = "sleep 5"
}
}