forked from oracle-quickstart/oci-arch-tomcat-mds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatasources.tf
50 lines (41 loc) · 1.5 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
## 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
# Get list of availability domains
data "oci_identity_availability_domains" "ADs" {
compartment_id = var.tenancy_ocid
}
# Get the latest Oracle Linux image
data "oci_core_images" "InstanceImageOCID" {
compartment_id = var.compartment_ocid
operating_system = var.instance_os
operating_system_version = var.linux_os_version
shape = var.InstanceShape
filter {
name = "display_name"
values = ["^.*Oracle[^G]*$"]
regex = true
}
}
#Get list of MySQL configuration
data "oci_mysql_mysql_configurations" "mds_mysql_configurations" {
compartment_id = var.compartment_ocid
type = ["DEFAULT"]
shape_name = var.mysql_shape_name
}
data "oci_core_vnic_attachments" "tomcat-server_primaryvnic_attach" {
count = var.numberOfNodes
availability_domain = var.availablity_domain_name
compartment_id = var.compartment_ocid
instance_id = oci_core_instance.tomcat-server[count.index].id
}
data "oci_core_vnic" "tomcat-server_primaryvnic" {
count = var.numberOfNodes
vnic_id = data.oci_core_vnic_attachments.tomcat-server_primaryvnic_attach[count.index].vnic_attachments.0.vnic_id
}
data "oci_identity_region_subscriptions" "home_region_subscriptions" {
tenancy_id = var.tenancy_ocid
filter {
name = "is_home_region"
values = [true]
}
}