Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit f9fb24a

Browse files
committed
Moved Image OCID to top level.
1 parent 38e00b2 commit f9fb24a

File tree

9 files changed

+12
-49
lines changed

9 files changed

+12
-49
lines changed

terraform/compute.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module "bastion" {
55
compartment_ocid = "${var.compartment_ocid}"
66
subnet_id = "${module.network.bastion-id}"
77
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
8+
image_ocid = "${var.ImageInstanceOCID[var.region]}"
89
ssh_keypath = "${var.ssh_keypath}"
910
ssh_private_key = "${var.ssh_private_key}"
1011
ssh_public_key = "${var.ssh_public_key}"
@@ -22,6 +23,7 @@ module "utility" {
2223
compartment_ocid = "${var.compartment_ocid}"
2324
subnet_id = "${module.network.public-id}"
2425
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
26+
image_ocid = "${var.ImageInstanceOCID[var.region]}"
2527
ssh_keypath = "${var.ssh_keypath}"
2628
ssh_private_key = "${var.ssh_private_key}"
2729
ssh_public_key = "${var.ssh_public_key}"
@@ -39,6 +41,7 @@ module "master" {
3941
compartment_ocid = "${var.compartment_ocid}"
4042
subnet_id = "${module.network.private-id}"
4143
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
44+
image_ocid = "${var.ImageInstanceOCID[var.region]}"
4245
ssh_keypath = "${var.ssh_keypath}"
4346
ssh_private_key = "${var.ssh_private_key}"
4447
ssh_public_key = "${var.ssh_public_key}"
@@ -56,6 +59,7 @@ module "worker" {
5659
compartment_ocid = "${var.compartment_ocid}"
5760
subnet_id = "${module.network.private-id}"
5861
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
62+
image_ocid = "${var.ImageInstanceOCID[var.region]}"
5963
ssh_keypath = "${var.ssh_keypath}"
6064
ssh_private_key = "${var.ssh_private_key}"
6165
ssh_public_key = "${var.ssh_public_key}"

terraform/modules/bastion/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "oci_core_instance" "Bastion" {
88

99
source_details {
1010
source_type = "image"
11-
source_id = "${var.InstanceImageOCID[var.region]}"
11+
source_id = "${var.image_ocid}"
1212
}
1313

1414
metadata {

terraform/modules/bastion/variables.tf

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ variable "ssh_private_key" {}
1212
variable "instances" {}
1313
variable "subnet_id" {}
1414
variable "user_data" {}
15+
variable "image_ocid" {}
1516

1617
# ---------------------------------------------------------------------------------------------------------------------
1718
# Optional variables
@@ -53,17 +54,3 @@ variable "ssh_keypath" {
5354
# You probably don't need to change these.
5455
# ---------------------------------------------------------------------------------------------------------------------
5556

56-
// See https://docs.us-phoenix-1.oraclecloud.com/images/
57-
// Oracle-provided image "Oracle-Linux-7.6-2019.03.22-1"
58-
// Kernel Version: 4.14.35-1844.3.2.el7uek.x86_64
59-
variable "InstanceImageOCID" {
60-
type = "map"
61-
default = {
62-
ca-toronto-1 = "ocid1.image.oc1.ca-toronto-1.aaaaaaaaqopv4wgbh54jrqoa4bjpkng2y2npzoe2jaj5pdne37ljdxbbbdka"
63-
eu-frankfurt-1 = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaa2n5z4nmkqjf27btkbdibflwvximz5i3rsz57c3gowckozrdshnua"
64-
uk-london-1 = "ocid1.image.oc1.uk-london-1.aaaaaaaaaxnnrqke453ur5katouvfn2i6oweuwpixx6mm5e4nqtci7oztx5a"
65-
us-ashburn-1 = "ocid1.image.oc1.iad.aaaaaaaavxqdkuyamlnrdo3q7qa7q3tsd6vnyrxjy3nmdbpv7fs7um53zh5q"
66-
us-phoenix-1 = "ocid1.image.oc1.phx.aaaaaaaapxvrtwbpgy3lchk2usn462ekarljwg4zou2acmundxlkzdty4bjq"
67-
}
68-
}
69-

terraform/modules/master/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource "oci_core_instance" "Master" {
1010

1111
source_details {
1212
source_type = "image"
13-
source_id = "${var.InstanceImageOCID[var.region]}"
13+
source_id = "${var.image_ocid"
1414
}
1515
1616
metadata {

terraform/modules/master/variables.tf

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ variable "ssh_private_key" {}
1212
variable "instances" {}
1313
variable "subnet_id" {}
1414
variable "user_data" {}
15+
variable "image_ocid" {}
1516

1617
# ---------------------------------------------------------------------------------------------------------------------
1718
# Optional variables
@@ -65,18 +66,3 @@ variable "ssh_keypath" {
6566
# Constants
6667
# You probably don't need to change these.
6768
# ---------------------------------------------------------------------------------------------------------------------
68-
69-
// See https://docs.us-phoenix-1.oraclecloud.com/images/
70-
// Oracle-provided image "Oracle-Linux-7.6-2019.03.22-1"
71-
// Kernel Version: 4.14.35-1844.3.2.el7uek.x86_64
72-
variable "InstanceImageOCID" {
73-
type = "map"
74-
default = {
75-
ca-toronto-1 = "ocid1.image.oc1.ca-toronto-1.aaaaaaaaqopv4wgbh54jrqoa4bjpkng2y2npzoe2jaj5pdne37ljdxbbbdka"
76-
eu-frankfurt-1 = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaa2n5z4nmkqjf27btkbdibflwvximz5i3rsz57c3gowckozrdshnua"
77-
uk-london-1 = "ocid1.image.oc1.uk-london-1.aaaaaaaaaxnnrqke453ur5katouvfn2i6oweuwpixx6mm5e4nqtci7oztx5a"
78-
us-ashburn-1 = "ocid1.image.oc1.iad.aaaaaaaavxqdkuyamlnrdo3q7qa7q3tsd6vnyrxjy3nmdbpv7fs7um53zh5q"
79-
us-phoenix-1 = "ocid1.image.oc1.phx.aaaaaaaapxvrtwbpgy3lchk2usn462ekarljwg4zou2acmundxlkzdty4bjq"
80-
}
81-
}
82-

terraform/modules/utility/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resource "oci_core_instance" "Utility" {
99

1010
source_details {
1111
source_type = "image"
12-
source_id = "${var.InstanceImageOCID[var.region]}"
12+
source_id = "${var.image_ocid}"
1313
}
1414

1515
metadata {

terraform/modules/utility/variables.tf

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ variable "ssh_private_key" {}
1212
variable "instances" {}
1313
variable "subnet_id" {}
1414
variable "user_data" {}
15+
variable "image_ocid" {}
1516

1617
# ---------------------------------------------------------------------------------------------------------------------
1718
# Optional variables
@@ -56,18 +57,3 @@ variable "ssh_keypath" {
5657
# Constants
5758
# You probably don't need to change these.
5859
# ---------------------------------------------------------------------------------------------------------------------
59-
60-
// See https://docs.us-phoenix-1.oraclecloud.com/images/
61-
// Oracle-provided image "Oracle-Linux-7.6-2019.03.22-1"
62-
// Kernel Version: 4.14.35-1844.3.2.el7uek.x86_64
63-
variable "InstanceImageOCID" {
64-
type = "map"
65-
default = {
66-
ca-toronto-1 = "ocid1.image.oc1.ca-toronto-1.aaaaaaaaqopv4wgbh54jrqoa4bjpkng2y2npzoe2jaj5pdne37ljdxbbbdka"
67-
eu-frankfurt-1 = "ocid1.image.oc1.eu-frankfurt-1.aaaaaaaa2n5z4nmkqjf27btkbdibflwvximz5i3rsz57c3gowckozrdshnua"
68-
uk-london-1 = "ocid1.image.oc1.uk-london-1.aaaaaaaaaxnnrqke453ur5katouvfn2i6oweuwpixx6mm5e4nqtci7oztx5a"
69-
us-ashburn-1 = "ocid1.image.oc1.iad.aaaaaaaavxqdkuyamlnrdo3q7qa7q3tsd6vnyrxjy3nmdbpv7fs7um53zh5q"
70-
us-phoenix-1 = "ocid1.image.oc1.phx.aaaaaaaapxvrtwbpgy3lchk2usn462ekarljwg4zou2acmundxlkzdty4bjq"
71-
}
72-
}
73-

terraform/modules/worker/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource "oci_core_instance" "Worker" {
1010

1111
source_details {
1212
source_type = "image"
13-
source_id = "${var.InstanceImageOCID[var.region]}"
13+
source_id = "${var.image_ocid}"
1414
}
1515

1616
metadata {

terraform/modules/worker/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ variable "ssh_private_key" {}
1212
variable "instances" {}
1313
variable "subnet_id" {}
1414
variable "user_data" {}
15+
variable "image_ocid" {}
1516

1617
# ---------------------------------------------------------------------------------------------------------------------
1718
# Optional variables
@@ -90,7 +91,6 @@ variable "ssh_keypath" {
9091
# You probably don't need to change these.
9192
# ---------------------------------------------------------------------------------------------------------------------
9293

93-
9494
// Volume Mapping - used to map Worker Block Volumes consistently to the OS
9595
variable "data_volume_attachment_device" {
9696
type = "map"

0 commit comments

Comments
 (0)