-
Notifications
You must be signed in to change notification settings - Fork 6
/
datasources.tf
124 lines (96 loc) · 3.3 KB
/
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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
## Copyright © 2021, 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
data "oci_core_instance" "storage_server" {
count = var.storage_server_node_count
instance_id = element(concat(oci_core_instance.storage_server.*.id, [""]), count.index)
}
data "oci_core_instance" "metadata_server" {
count = local.derived_metadata_server_node_count
instance_id = element(concat(oci_core_instance.metadata_server.*.id, [""]), count.index)
}
data "oci_core_instance" "management_server" {
count = local.derived_management_server_node_count
instance_id = element(concat(oci_core_instance.management_server.*.id, [""]), count.index)
}
data "oci_core_instance" "client_node" {
count = var.client_node_count
instance_id = element(concat(oci_core_instance.client_node.*.id, [""]), count.index)
}
data "oci_core_subnet" "private_storage_subnet" {
subnet_id = local.storage_subnet_id
}
data "oci_core_subnet" "private_fs_subnet" {
subnet_id = local.fs_subnet_id
}
data "oci_core_subnet" "public_subnet" {
subnet_id = local.bastion_subnet_id
}
data "oci_core_vcn" "hfs" {
vcn_id = var.use_existing_vcn ? var.vcn_id : oci_core_virtual_network.hfs[0].id
}
data "oci_identity_availability_domains" "availability_domains" {
compartment_id = var.compartment_ocid
}
data "oci_identity_region_subscriptions" "home_region_subscriptions" {
tenancy_id = var.tenancy_ocid
filter {
name = "is_home_region"
values = [true]
}
}
# Get the latest Oracle Linux image
data "oci_core_images" "ManagementServerImageOCID" {
compartment_id = var.compartment_ocid
operating_system = var.instance_os
operating_system_version = var.linux_os_version
shape = var.management_server_shape
filter {
name = "display_name"
values = ["^.*CentOS[^G]*$"]
regex = true
}
}
data "oci_core_images" "PersistentMetadataServerImageOCID" {
compartment_id = var.compartment_ocid
operating_system = var.instance_os
operating_system_version = var.linux_os_version
shape = local.derived_metadata_server_shape
filter {
name = "display_name"
values = ["^.*CentOS[^G]*$"]
regex = true
}
}
data "oci_core_images" "PersistentStorageServerImageOCID" {
compartment_id = var.compartment_ocid
operating_system = var.instance_os
operating_system_version = var.linux_os_version
shape = local.derived_storage_server_shape
filter {
name = "display_name"
values = ["^.*CentOS[^G]*$"]
regex = true
}
}
data "oci_core_images" "ClientImageOCID" {
compartment_id = var.compartment_ocid
operating_system = var.instance_os
operating_system_version = var.linux_os_version
shape = var.client_node_shape
filter {
name = "display_name"
values = ["^.*CentOS[^G]*$"]
regex = true
}
}
data "oci_core_images" "BastionImageOCID" {
compartment_id = var.compartment_ocid
operating_system = var.instance_os
operating_system_version = var.linux_os_version
shape = var.bastion_shape
filter {
name = "display_name"
values = ["^.*CentOS[^G]*$"]
regex = true
}
}