-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatasources.tf
37 lines (29 loc) · 928 Bytes
/
datasources.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
# Copyright (c) 2020 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
data "oci_identity_compartments" "compartment" {
count = var.tenancy_ocid == null ? 0 : 1
#Required
compartment_id = var.tenancy_ocid
access_level = "ANY"
compartment_id_in_subtree = true
#Optional
filter {
name = "state"
values = ["ACTIVE"]
}
filter {
name = "name"
values = [var.compartment]
}
}
data "oci_core_vcns" "vcns" {
count = var.vcn_name == null ? 0 : 1
compartment_id = local.compartment_id
display_name = var.vcn_name
depends_on = [data.oci_identity_compartments.compartment]
}
data "oci_core_network_security_groups" "this" {
compartment_id = local.compartment_id
vcn_id = local.vcn_id
depends_on = [data.oci_core_vcns.vcns]
}