-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8221c8e
commit a29a72b
Showing
8 changed files
with
305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# return the latest CentOS 7 oci images for Oracle cloud based on https://docs.cloud.oracle.com/iaas/images | centos-7-oci-images.tf | ||
|
||
# get latest CentOS 7 image | ||
data "oci_core_images" "centos-7" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "CentOS" | ||
operating_system_version = "7" | ||
sort_by = "TIMECREATED" | ||
sort_order = "DESC" | ||
} | ||
|
||
output "centos-7-latest-name" { | ||
value = data.oci_core_images.centos-7.images.0.display_name | ||
} | ||
|
||
output "centos-7-latest-id" { | ||
value = data.oci_core_images.centos-7.images.0.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# return the latest Oracle Linux oci images for Oracle cloud based on https://docs.cloud.oracle.com/iaas/images | oracle-linux-oci-images.tf | ||
|
||
# ----- Oracle Linux 7.7 ----- | ||
|
||
# get latest Oracle Linux 7.7 image | ||
data "oci_core_images" "oraclelinux-7-7" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Oracle Linux" | ||
operating_system_version = "7.7" | ||
filter { | ||
name = "display_name" | ||
values = ["^([a-zA-z]+)-([a-zA-z]+)-([\\.0-9]+)-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
output "oracle-linux-7-7-latest-name" { | ||
value = data.oci_core_images.oraclelinux-7-7.images.0.display_name | ||
} | ||
|
||
output "oracle-linux-7-7-latest-id" { | ||
value = data.oci_core_images.oraclelinux-7-7.images.0.id | ||
} | ||
|
||
# get latest Oracle Linux 7.7 with GPU image | ||
data "oci_core_images" "oraclelinux-7-7-gpu" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Oracle Linux" | ||
operating_system_version = "7.7" | ||
filter { | ||
name = "display_name" | ||
values = ["^.*-GPU-.*$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "oracle-linux-7-7-gpu-latest-name" { | ||
value = data.oci_core_images.oraclelinux-7-7-gpu.images.0.display_name | ||
} | ||
|
||
output "oracle-linux-7-7-gpu-latest-id" { | ||
value = data.oci_core_images.oraclelinux-7-7-gpu.images.0.id | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Oracle Cloud Provider | provider.tf | ||
|
||
# Configure the Oracle Cloud Infrastructure provider with an API Key | ||
provider "oci" { | ||
tenancy_ocid = "${var.oci_tenancy}" | ||
user_ocid = "${var.oci_user}" | ||
fingerprint = "${var.oci_fingerprint}" | ||
private_key_path = "${var.oci_key}" | ||
region = "${var.oci_region}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# return the latest Ubuntu Linux 16.04 oci images for Oracle cloud based on https://docs.cloud.oracle.com/iaas/images | ubuntu-1604-oci-images.tf | ||
|
||
# get latest Ubuntu Linux 16.04 image | ||
data "oci_core_images" "ubuntu-16-04" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Canonical Ubuntu" | ||
filter { | ||
name = "display_name" | ||
values = ["^Canonical-Ubuntu-16.04-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "ubuntu-16-04-latest-name" { | ||
value = data.oci_core_images.ubuntu-16-04.images.0.display_name | ||
} | ||
output "ubuntu-16-04-latest-id" { | ||
value = data.oci_core_images.ubuntu-16-04.images.0.id | ||
} | ||
|
||
# get latest Ubuntu Linux 16.04 Minimal image | ||
data "oci_core_images" "ubuntu-16-04-minimal" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Canonical Ubuntu" | ||
filter { | ||
name = "display_name" | ||
values = ["^Canonical-Ubuntu-16.04-Minimal-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "ubuntu-16-04-minimal-latest-name" { | ||
value = data.oci_core_images.ubuntu-16-04-minimal.images.0.display_name | ||
} | ||
output "ubuntu-16-04-minimal-latest-id" { | ||
value = data.oci_core_images.ubuntu-16-04-minimal.images.0.id | ||
} | ||
|
||
# get latest Ubuntu Linux 16.04 GPU image | ||
data "oci_core_images" "ubuntu-16-04-gpu" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Canonical Ubuntu" | ||
operating_system_version = "16.04" | ||
filter { | ||
name = "display_name" | ||
values = ["^.*-GPU-.*$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "ubuntu-16_04-gpu-latest-name" { | ||
value = data.oci_core_images.ubuntu-16-04-gpu.images.0.display_name | ||
} | ||
output "ubuntu-16_04-gpu-latest-id" { | ||
value = data.oci_core_images.ubuntu-16-04-gpu.images.0.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# return the latest Ubuntu Linux 18.04 oci images for Oracle cloud based on https://docs.cloud.oracle.com/iaas/images | ubuntu-1804-oci-images.tf | ||
|
||
# get latest Ubuntu Linux 18.04 image | ||
data "oci_core_images" "ubuntu-18-04" { | ||
compartment_id = "${var.oci_compartment}" | ||
operating_system = "Canonical Ubuntu" | ||
filter { | ||
name = "display_name" | ||
values = ["^Canonical-Ubuntu-18.04-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "ubuntu-18-04-latest-name" { | ||
value = data.oci_core_images.ubuntu-18-04.images.0.display_name | ||
} | ||
output "ubuntu-18-04-latest-id" { | ||
value = data.oci_core_images.ubuntu-18-04.images.0.id | ||
} | ||
|
||
# get latest Ubuntu Linux 18.04 Minimal image | ||
data "oci_core_images" "ubuntu-18-04-minimal" { | ||
compartment_id = "${var.oci_compartment}" | ||
operating_system = "Canonical Ubuntu" | ||
filter { | ||
name = "display_name" | ||
values = ["^Canonical-Ubuntu-18.04-Minimal-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "ubuntu-18-04-minimal-latest-name" { | ||
value = data.oci_core_images.ubuntu-18-04-minimal.images.0.display_name | ||
} | ||
output "ubuntu-18-04-minimal-latest-id" { | ||
value = data.oci_core_images.ubuntu-18-04-minimal.images.0.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Oracle Cloud connection & authentication and Application configuration | variables-auth.tf | ||
|
||
variable "oci_tenancy" { | ||
type = string | ||
description = "Oracle Cloud Identifier tenancy" | ||
} | ||
|
||
variable "oci_user" { | ||
type = string | ||
description = "Oracle Cloud Identifier user" | ||
} | ||
|
||
variable "oci_fingerprint" { | ||
type = string | ||
description = "Oracle Cloud Fingerprint for the key pair" | ||
} | ||
|
||
variable "oci_key" { | ||
type = string | ||
description = "Oracle Cloud key" | ||
} | ||
|
||
variable "oci_region" { | ||
type = string | ||
description = "Oracle Cloud region" | ||
} | ||
|
||
variable "oci_compartment" { | ||
type = string | ||
description = "Oracle Cloud Compartment" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# return the latest Windows 2012 oci images for Oracle cloud based on https://docs.cloud.oracle.com/iaas/images | windows-1604-oci-images.tf | ||
|
||
# get latest Windows Server 2012 R2 Virtual Machine image | ||
data "oci_core_images" "windows-2012-vm" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Windows" | ||
filter { | ||
name = "display_name" | ||
values = ["^Windows-Server-2012-R2-Standard-Edition-VM-Gen2-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "windows-2012-latest-vm-name" { | ||
value = data.oci_core_images.windows-2012-vm.images.0.display_name | ||
} | ||
output "windows-2012-latest-vm-id" { | ||
value = data.oci_core_images.windows-2012-vm.images.0.id | ||
} | ||
|
||
# get latest Windows 2012 Bare Metal image | ||
data "oci_core_images" "windows-2012-bm" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Windows" | ||
filter { | ||
name = "display_name" | ||
values = ["^Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "windows-2012-latest-bm-name" { | ||
value = data.oci_core_images.windows-2012-bm.images.0.display_name | ||
} | ||
output "windows-2012-latest-bm-id" { | ||
value = data.oci_core_images.windows-2012-bm.images.0.id | ||
} | ||
|
||
# get latest Windows 2012 Bare Metal Dense I/O image | ||
data "oci_core_images" "windows-2012-bm-denseio" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Windows" | ||
filter { | ||
name = "display_name" | ||
values = ["^Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-DenseIO-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "windows-2012-latest-bm-denseio-name" { | ||
value = data.oci_core_images.windows-2012-bm-denseio.images.0.display_name | ||
} | ||
output "windows-2012-latest-bm-denseio-id" { | ||
value = data.oci_core_images.windows-2012-bm-denseio.images.0.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# return the latest Windows 2016 oci images for Oracle cloud based on https://docs.cloud.oracle.com/iaas/images | windows-1604-oci-images.tf | ||
|
||
# get latest Windows 2016 Virtual Machine image | ||
data "oci_core_images" "windows-2016-vm" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Windows" | ||
filter { | ||
name = "display_name" | ||
values = ["^Windows-Server-2016-Standard-Edition-VM-Gen2-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "windows-2016-latest-vm-name" { | ||
value = data.oci_core_images.windows-2016-vm.images.0.display_name | ||
} | ||
output "windows-2016-latest-vm-id" { | ||
value = data.oci_core_images.windows-2016-vm.images.0.id | ||
} | ||
|
||
# get latest Windows 2016 Bare Metal image | ||
data "oci_core_images" "windows-2016-bm" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Windows" | ||
filter { | ||
name = "display_name" | ||
values = ["^Windows-Server-2016-Datacenter-Edition-BM-Gen2-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "windows-2016-latest-bm-name" { | ||
value = data.oci_core_images.windows-2016-bm.images.0.display_name | ||
} | ||
output "windows-2016-latest-bm-id" { | ||
value = data.oci_core_images.windows-2016-bm.images.0.id | ||
} | ||
|
||
# get latest Windows 2016 Bare Metal Dense I/O image | ||
data "oci_core_images" "windows-2016-bm-denseio" { | ||
compartment_id = var.oci_compartment | ||
operating_system = "Windows" | ||
filter { | ||
name = "display_name" | ||
values = ["^Windows-Server-2016-Datacenter-Edition-BM-Gen2-DenseIO-([\\.0-9-]+)$"] | ||
regex = true | ||
} | ||
} | ||
|
||
output "windows-2016-latest-bm-denseio-name" { | ||
value = data.oci_core_images.windows-2016-bm-denseio.images.0.display_name | ||
} | ||
output "windows-2016-latest-bm-denseio-id" { | ||
value = data.oci_core_images.windows-2016-bm-denseio.images.0.id | ||
} |