SlideShare a Scribd company logo
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Oracle Cloud Infrastructure &
HashiCorp Terraform
in 45 minutes
ECO 2022
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Speaker
Bobby Curtis, MBA
Atlanta, GA
• Author
• Speaker
• Former Product Manager for GoldenGate
• Oracle ACE Director Alumni?
@dbasolved
https://dbasolved.com
https://www.rheodata.com/blog
bobby.curtis@rheodata.com
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
License Management for Oracle,
HashiCorp, and Cloud
Get the most out of your license
DBA
Services
Remote and
On-Site
Performance Services
Identify and increase database
performance
Migration Blueprint
Zero Downtime
RheoData Status
How are you running?
On-Call Support
Managed Services
Tactical Assistance Program (TAP)
Experts to help design and manage complex architecture
Take Cloud to next level
Automation of Cloud
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Multi-Cloud Opportunities
+
• Move interdependent enterprise
applications to the cloud
• Deploy custom and packaged application
• Develop cloud native, enterprise
applications
• Cross-Cloud Interconnect
• Unified IAM
• Jointly tested, validated deployment
architectures, best practices
• Collaborative support model
https://www.oracle.com/cloud/azure-interconnect.html
• Innovate across clouds
• Choice
• Maximize ROI
Advantages Possible Now New Capabilities
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Basics
init
validate
plan apply
terraform init
– used to initialize a
working directory with
Terraform files.
– Some validation done
as well
terraform validate
– validates the config
files in a directory
terraform plan
– creates execution plan
– performs a refresh,
unless explicitly disabled
– determines what
needs to be done
terraform apply
– scans the current
directory for the
configuration and
applies changes
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
OCI Provider
provider "oci" {
version = ">= 3.76.0"
region = var.region
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
}
• Use of variables file is highly
recommended!
• Use a provider file (provider.tf)
Regions
- locations/data centers
where the workload is
built
Tenancy OCID
- account name when
initially setting up a
cloud account
User OCID
- Identifier that
identifies the user login
into the cloud
Fingerprint
- alpha/numeric string
that will be specific to
public SSH key.
- needed for API access
Key Path
- Location of SSH
private key on localhost
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
OCI Modules
• Modules for most item in
OCI
• VCN – Virtual Network
• Operator – Compute Nodes
• Bastion – add bastion host
• Base – all the above
• Use the lastest version
• 4.46.0
• Downloaded Modules
• .terraform/modules
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Layout
Oracle/OCI/dev
|
/.terraform/modules
/compute-instance/terraform-oci-compute-instance-2.01
-- main.tf
-- variables.tf
-- output.tf
/vcn/terraform-oci-vcn-#.#.#
-- main.tf
-- variables.tf
-- locals.tf
-- nat.tf
-- servicegateway.tf
-- vcn.tf
|
-- main.tf
-- variables.tf
-- output.tf
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Backend
########################
# Backend
#####################
terraform {
backend "http" {
address = "https://objectstorage.us-ashburn-
1.oraclecloud.com/p/Zi1rw_y.........EA4HjMwEU2zaaBmx71sas_oU/n/idtlingilfcy/b/bucket-terraform/o/terraform.tfstate"
update_method = "PUT"
}
}
HTTP support: uses a cURL-based HTTP command to push/pull state from object store
S3-Compatible support: more complex to setup, requires AWS keys
Pre-Authenticated Requests (PAR): enables accessing a bucket or object in OCI without providing credentials/time-
based.
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Compartments
##########################
# Compartments - Custom
##########################
resource "oci_identity_compartment" "test_compartment" {
#Required
# ocid1.tenancy.oc1..aaaaaaaaojorxdfprzt2sx75lweivou6xeomto4gvjxuuyraxcdakff4dujq
compartment_id = var.root_compartment_ocid #Compartment to build in
# This is a testing compartment
description = var.compartment_description #Description for the compartment
# testing2
name = var.compartment_name #Name of the compartment
}
data "oci_identity_compartments" "test_compartments" {
compartment_id = var.tenancy_ocid
compartment_id_in_subtree = true
}
output "compartment_info" {
value = data.oci_identity_compartments.test_compartments.compartments
}
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
#########################
# Compute Instance - OCI Provided
#########################
module "compute-instance" {
source = "oracle-terraform-modules/compute-instance/oci"
version = "2.0.1"
#Required Info
compartment_ocid = "ocid1.compartment.oc1..aaaaaaaade5bxtniugmwuiynsonpq74fo2djk6hd64qu3lzw2xybym4svyhq"
source_ocid = "ocid1.image.oc1.iad.aaaaaaaawtb4qxiwri5z2qjeey4zpzqpv2rtxhddzpbvojw2e2c2jevmthva"
ssh_authorized_keys = "~/.ssh/id_rsa.pub"
subnet_ocids = ["ocid1.subnet.oc1.iad.aaaaaaaamlgotv3goqjfihx53abpatmajjh45h32vljzfq3nsvwoqhqmouda"]
#Optional Info
instance_count = ”4"
shape = "VM.Standard2.2"
instance_display_name = "Test-Linux_"
}
output "compute_info" {
value = [
"ID", module.compute-instance.instance_id,
"Private", module.compute-instance.private_ip,
"Public", module.compute-instance.public_ip
]
}
Compute Instances
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Autonomous Database(s)
• No OCI certified modules available
• Deprecated Resources by version
• Write custom
oci_database_autonomous_database
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Autonomous Database(s)
##############################
# OCI - Autonomous Database(s)
##############################
resource "oci_database_autonomous_database" "demo_adb" {
#Required
admin_password = ”<Password>"
compartment_id =
"ocid1.compartment.oc1..aaaaaaaade5bxtniugmwuiynsonpq74fo2djk6hd64qu3lzw2xybym4svyhq"
cpu_core_count = "1"
data_storage_size_in_tbs = "1"
db_name = "RDADB1"
#Optional
db_version = "19c"
db_workload = "OLTP"
display_name = "RDADB1"
is_free_tier = "false"
license_model = "BRING_YOUR_OWN_LICENSE"
source = "NONE"
}
output "demo_adb_ocid" {
value = oci_database_autonomous_database.demo_adb.id
}
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
GoldenGate Service (GGS)
• Oracle GoldenGate (Microservices) as a Service
• Builds one (1) deployment only
resource "oci_golden_gate_deployment" "ggdev" {
#Required
compartment_id = "ocid1.compartment.oc1..aaaaaaaaeg3ug2usjziq5smuc5a6oc5up6ngkgy5ilkw2pgnjxz2xe67plbq"
cpu_core_count = "2"
deployment_type = "OGG"
display_name = "ggdev"
is_auto_scaling_enabled = "false"
is_public = "true"
license_model = "LICENSE_INCLUDED"
subnet_id = var.devsubnet
#nsg_ids = ["ocid1.networksecuritygroup.oc1.iad.aaaaaaaal4efdb64mjtutdfw5ju3dthibfmruqavaakx6olkjdx2lyaxmb3q"]
ogg_data {
admin_password = ”<password>
admin_username = "oggadmin"
deployment_name = "ggdev"
}
} #end-resource
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Kubernetes (OKE)
• Oracle Container Engine (OKE) is Oracle’s managed Kubernetes service
• Lots of components within OCI – OCI module is best option
module "oke" {
source = "oracle-terraform-modules/oke/oci"
version = "2.2.2"
#Required
api_fingerprint = var.fingerprint
api_private_key_path = "~/.ssh/id_rsa"
compartment_id = "ocid1.compartment.oc1……gmwuiynsonpq74fo2djk6hd64qu3lzw2xybym4svyhq"
existing_key_id = "ocid1.key.oc1.iad.bbppj6k3aacuu.a……tsnq3ldofns5czn7vyzvxnvvnliq"
region = var.region
secret_id = "ocid1.vault.oc1.iad.bbppj6k3aacuu………w5e5mc6rhxcm7mzytdbsqt6g6ozaftjtj4uegbmwcuya"
service_account_cluster_role_binding = "clustertestbinding"
tenancy_id = var.tenancy_ocid
user_id = var.user_ocid
#Optional
ssh_public_key_path = "~/.ssh/id_rsa.pub"
}
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Graph
• Inherently exposes some of Terraform’s Core implementation details
• Handy for debugging how Terraform is executing
$ terraform graph
digraph {
compound = "true"
newrank = "true"
subgraph "root" {
"[root] data.oci_identity_compartments.test_compartments (orphan)" [label = "data.oci_identity_compartments.test_compartments",
shape = "box"]
"[root] module.compute-instance.data.oci_core_instance_credentials.this (expand)" [label = "module.compute-
instance.data.oci_core_instance_credentials.this", shape = "box"]
"[root] module.compute-instance.data.oci_core_subnet.this (expand)" [label = "module.compute-
instance.data.oci_core_subnet.this", shape = "box"]
"[root] module.compute-instance.oci_core_instance.this (expand)" [label = "module.compute-instance.oci_core_instance.this",
shape = "box"]
"[root] module.compute-instance.oci_core_volume.this (expand)" [label = "module.compute-instance.oci_core_volume.this", shape =
"box"]
"[root] module.compute-instance.oci_core_volume_attachment.this (expand)" [label = "module.compute-
instance.oci_core_volume_attachment.this", shape = "box"]
"[root] oci_identity_compartment.test_compartment (orphan)" [label = "oci_identity_compartment.test_compartment", shape = "box"]
"[root] output.compartment_info (destroy)" [label = "output.compartment_info (destroy)", shape = "note"]
"[root] output.compute_info" [label = "output.compute_info", shape = "note"]
"[root] provider["registry.terraform.io/hashicorp/oci"]" [label = "provider["registry.terraform.io/hashicorp/oci"]", shape =
"diamond"]
"[root] var.adw_ocid" [label = "var.adw_ocid", shape = "note"]
"[root] var.compartment_description" [label = "var.compartment_description", shape = "note"]
…
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Stacks & Jobs
Code Zip Upload & Run
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Questions
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
Contact RheoData
info@rheodata.com
@rheodatallc
http://rheodata.com
www.rheodata.com Copyright, 2021 RheoData and affiliates
@rheodatallc
RheoData Happy Hour
Tonight!
Immediately
After the Networking Event
6 pm – 7 pm EST

More Related Content

PPTX
Oracle GoldenGate 21c New Features and Best Practices
PPTX
Improve PostgreSQL replication with Oracle GoldenGate
PDF
OOW09 Ebs Tuning Final
PDF
Extreme Replication - RMOUG Presentation
PPTX
Oracle GoldenGate 18c - REST API Examples
PDF
Deep Dive into Automating Oracle GoldenGate Using the New Microservices
PPTX
OOW19 - HOL5221
PPTX
Extreme Replication - Performance Tuning Oracle GoldenGate
Oracle GoldenGate 21c New Features and Best Practices
Improve PostgreSQL replication with Oracle GoldenGate
OOW09 Ebs Tuning Final
Extreme Replication - RMOUG Presentation
Oracle GoldenGate 18c - REST API Examples
Deep Dive into Automating Oracle GoldenGate Using the New Microservices
OOW19 - HOL5221
Extreme Replication - Performance Tuning Oracle GoldenGate

What's hot (20)

PPTX
Database As A Service: OEM + ODA (OOW 15 Presentation)
PDF
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
PPTX
Extreme replication at IOUG Collaborate 15
PPTX
Oracle GoldenGate on Docker
PDF
IOUG Data Integration SIG w/ Oracle GoldenGate Solutions and Configuration
PPTX
GoldenGate Monitoring - GOUSER - 4/2014
PPTX
OEM12c, DB12c and You! - RMOUG TD2014 Edition
PPTX
Enable GoldenGate Monitoring with OEM 12c/JAgent
PPTX
Hit Refresh with Oracle GoldenGate Microservices
PPTX
Terraform & Oracle Cloud Infrastructure
PPTX
GoldenGate CDR from UKOUG 2017
PDF
Oracle virtualbox basic to rac attack
PDF
Oracle GoldenGate Architecture Performance
PDF
Exachk and oem12c
PPTX
Exachk and oem12c - IOUG C15LV
PDF
How many ways to monitor oracle golden gate - OOW14
PPTX
How many ways to monitor oracle golden gate-Collaborate 14
PPTX
Oem12c patching -OOW13
PDF
5 Keys to Oracle GoldenGate Implemenations
PPTX
Oracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
Database As A Service: OEM + ODA (OOW 15 Presentation)
Oracle GoldenGate Presentation from OTN Virtual Technology Summit - 7/9/14 (PDF)
Extreme replication at IOUG Collaborate 15
Oracle GoldenGate on Docker
IOUG Data Integration SIG w/ Oracle GoldenGate Solutions and Configuration
GoldenGate Monitoring - GOUSER - 4/2014
OEM12c, DB12c and You! - RMOUG TD2014 Edition
Enable GoldenGate Monitoring with OEM 12c/JAgent
Hit Refresh with Oracle GoldenGate Microservices
Terraform & Oracle Cloud Infrastructure
GoldenGate CDR from UKOUG 2017
Oracle virtualbox basic to rac attack
Oracle GoldenGate Architecture Performance
Exachk and oem12c
Exachk and oem12c - IOUG C15LV
How many ways to monitor oracle golden gate - OOW14
How many ways to monitor oracle golden gate-Collaborate 14
Oem12c patching -OOW13
5 Keys to Oracle GoldenGate Implemenations
Oracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
Ad

Similar to ECO 2022 - OCI and HashiCorp Terraform (20)

PPTX
2019 - GUOB Tech Day / Groundbreakers LAD Tour - Database Migration Methods t...
PDF
Automating Cloud Operations - Everything you wanted to know about cURL and RE...
PPTX
2019 - OOW - Database Migration Methods from On-Premise to Cloud
PDF
Oracle_Patching_Untold_Story_Final_Part2.pdf
PDF
DSDT Meetup Nov 2017
PDF
Dsdt meetup 2017 11-21
PDF
MySQL Shell - The Best MySQL DBA Tool
PPTX
20180605 sso with apex and adfs the weblogic way
PDF
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
PPTX
2020 - OCI Key Concepts for Oracle DBAs
PPTX
2020 - GUOB Tech Day / Groundbreakers LAD Tour - How to Create an AutoScale C...
PDF
An insight to microsoft platform
PPTX
Cloud Native Application Development - build fast, cheap, scalable and agile ...
PDF
Oracle Database Migration to Oracle Cloud Infrastructure
PPTX
Serverless patterns
PDF
OAC and ODI! A Match Made in…the cloud?
PDF
Exciting Features and Enhancements in Java 23 and 24
PPTX
SOLID Programming with Portable Class Libraries
PPTX
20150425 experimenting with openstack sahara on docker
PDF
Monitor Engineered Systems from a Single Pane of Glass: Oracle Enterprise Man...
2019 - GUOB Tech Day / Groundbreakers LAD Tour - Database Migration Methods t...
Automating Cloud Operations - Everything you wanted to know about cURL and RE...
2019 - OOW - Database Migration Methods from On-Premise to Cloud
Oracle_Patching_Untold_Story_Final_Part2.pdf
DSDT Meetup Nov 2017
Dsdt meetup 2017 11-21
MySQL Shell - The Best MySQL DBA Tool
20180605 sso with apex and adfs the weblogic way
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
2020 - OCI Key Concepts for Oracle DBAs
2020 - GUOB Tech Day / Groundbreakers LAD Tour - How to Create an AutoScale C...
An insight to microsoft platform
Cloud Native Application Development - build fast, cheap, scalable and agile ...
Oracle Database Migration to Oracle Cloud Infrastructure
Serverless patterns
OAC and ODI! A Match Made in…the cloud?
Exciting Features and Enhancements in Java 23 and 24
SOLID Programming with Portable Class Libraries
20150425 experimenting with openstack sahara on docker
Monitor Engineered Systems from a Single Pane of Glass: Oracle Enterprise Man...
Ad

More from Bobby Curtis (8)

PPTX
Leverage Restful APIs in Oracle GoldenGate
PPTX
RheoData_OGG-Classic2Microservices_2024-UKOUG24.pptx
PPTX
RheoData_23ai_Vector-Datatype-Webinar-2024.pptx
PPTX
MySQLHeatwave-TheBasics.pptx
PPTX
Oracle GoldenGate Performance Tuning
PDF
Oracle GoldenGate Studio Intro
PPTX
Examining Oracle GoldenGate Trail Files
PDF
Oracle GoldenGate 12c CDR Presentation for ECO
Leverage Restful APIs in Oracle GoldenGate
RheoData_OGG-Classic2Microservices_2024-UKOUG24.pptx
RheoData_23ai_Vector-Datatype-Webinar-2024.pptx
MySQLHeatwave-TheBasics.pptx
Oracle GoldenGate Performance Tuning
Oracle GoldenGate Studio Intro
Examining Oracle GoldenGate Trail Files
Oracle GoldenGate 12c CDR Presentation for ECO

Recently uploaded (20)

PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
August Patch Tuesday
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A comparative study of natural language inference in Swahili using monolingua...
SOPHOS-XG Firewall Administrator PPT.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
OMC Textile Division Presentation 2021.pptx
August Patch Tuesday
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Building Integrated photovoltaic BIPV_UPV.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Digital-Transformation-Roadmap-for-Companies.pptx
Spectral efficient network and resource selection model in 5G networks
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
Per capita expenditure prediction using model stacking based on satellite ima...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A comparative study of natural language inference in Swahili using monolingua...

ECO 2022 - OCI and HashiCorp Terraform

  • 1. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Oracle Cloud Infrastructure & HashiCorp Terraform in 45 minutes ECO 2022
  • 2. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 3. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 4. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Speaker Bobby Curtis, MBA Atlanta, GA • Author • Speaker • Former Product Manager for GoldenGate • Oracle ACE Director Alumni? @dbasolved https://dbasolved.com https://www.rheodata.com/blog [email protected]
  • 5. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc License Management for Oracle, HashiCorp, and Cloud Get the most out of your license DBA Services Remote and On-Site Performance Services Identify and increase database performance Migration Blueprint Zero Downtime RheoData Status How are you running? On-Call Support Managed Services Tactical Assistance Program (TAP) Experts to help design and manage complex architecture Take Cloud to next level Automation of Cloud
  • 6. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc
  • 7. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Multi-Cloud Opportunities + • Move interdependent enterprise applications to the cloud • Deploy custom and packaged application • Develop cloud native, enterprise applications • Cross-Cloud Interconnect • Unified IAM • Jointly tested, validated deployment architectures, best practices • Collaborative support model https://www.oracle.com/cloud/azure-interconnect.html • Innovate across clouds • Choice • Maximize ROI Advantages Possible Now New Capabilities
  • 8. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 9. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Basics init validate plan apply terraform init – used to initialize a working directory with Terraform files. – Some validation done as well terraform validate – validates the config files in a directory terraform plan – creates execution plan – performs a refresh, unless explicitly disabled – determines what needs to be done terraform apply – scans the current directory for the configuration and applies changes
  • 10. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 11. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc OCI Provider provider "oci" { version = ">= 3.76.0" region = var.region tenancy_ocid = var.tenancy_ocid user_ocid = var.user_ocid fingerprint = var.fingerprint private_key_path = var.private_key_path } • Use of variables file is highly recommended! • Use a provider file (provider.tf) Regions - locations/data centers where the workload is built Tenancy OCID - account name when initially setting up a cloud account User OCID - Identifier that identifies the user login into the cloud Fingerprint - alpha/numeric string that will be specific to public SSH key. - needed for API access Key Path - Location of SSH private key on localhost
  • 12. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc OCI Modules • Modules for most item in OCI • VCN – Virtual Network • Operator – Compute Nodes • Bastion – add bastion host • Base – all the above • Use the lastest version • 4.46.0 • Downloaded Modules • .terraform/modules
  • 13. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 14. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Layout Oracle/OCI/dev | /.terraform/modules /compute-instance/terraform-oci-compute-instance-2.01 -- main.tf -- variables.tf -- output.tf /vcn/terraform-oci-vcn-#.#.# -- main.tf -- variables.tf -- locals.tf -- nat.tf -- servicegateway.tf -- vcn.tf | -- main.tf -- variables.tf -- output.tf
  • 15. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Backend ######################## # Backend ##################### terraform { backend "http" { address = "https://objectstorage.us-ashburn- 1.oraclecloud.com/p/Zi1rw_y.........EA4HjMwEU2zaaBmx71sas_oU/n/idtlingilfcy/b/bucket-terraform/o/terraform.tfstate" update_method = "PUT" } } HTTP support: uses a cURL-based HTTP command to push/pull state from object store S3-Compatible support: more complex to setup, requires AWS keys Pre-Authenticated Requests (PAR): enables accessing a bucket or object in OCI without providing credentials/time- based.
  • 16. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Compartments ########################## # Compartments - Custom ########################## resource "oci_identity_compartment" "test_compartment" { #Required # ocid1.tenancy.oc1..aaaaaaaaojorxdfprzt2sx75lweivou6xeomto4gvjxuuyraxcdakff4dujq compartment_id = var.root_compartment_ocid #Compartment to build in # This is a testing compartment description = var.compartment_description #Description for the compartment # testing2 name = var.compartment_name #Name of the compartment } data "oci_identity_compartments" "test_compartments" { compartment_id = var.tenancy_ocid compartment_id_in_subtree = true } output "compartment_info" { value = data.oci_identity_compartments.test_compartments.compartments }
  • 17. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc ######################### # Compute Instance - OCI Provided ######################### module "compute-instance" { source = "oracle-terraform-modules/compute-instance/oci" version = "2.0.1" #Required Info compartment_ocid = "ocid1.compartment.oc1..aaaaaaaade5bxtniugmwuiynsonpq74fo2djk6hd64qu3lzw2xybym4svyhq" source_ocid = "ocid1.image.oc1.iad.aaaaaaaawtb4qxiwri5z2qjeey4zpzqpv2rtxhddzpbvojw2e2c2jevmthva" ssh_authorized_keys = "~/.ssh/id_rsa.pub" subnet_ocids = ["ocid1.subnet.oc1.iad.aaaaaaaamlgotv3goqjfihx53abpatmajjh45h32vljzfq3nsvwoqhqmouda"] #Optional Info instance_count = ”4" shape = "VM.Standard2.2" instance_display_name = "Test-Linux_" } output "compute_info" { value = [ "ID", module.compute-instance.instance_id, "Private", module.compute-instance.private_ip, "Public", module.compute-instance.public_ip ] } Compute Instances
  • 18. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Autonomous Database(s) • No OCI certified modules available • Deprecated Resources by version • Write custom oci_database_autonomous_database
  • 19. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Autonomous Database(s) ############################## # OCI - Autonomous Database(s) ############################## resource "oci_database_autonomous_database" "demo_adb" { #Required admin_password = ”<Password>" compartment_id = "ocid1.compartment.oc1..aaaaaaaade5bxtniugmwuiynsonpq74fo2djk6hd64qu3lzw2xybym4svyhq" cpu_core_count = "1" data_storage_size_in_tbs = "1" db_name = "RDADB1" #Optional db_version = "19c" db_workload = "OLTP" display_name = "RDADB1" is_free_tier = "false" license_model = "BRING_YOUR_OWN_LICENSE" source = "NONE" } output "demo_adb_ocid" { value = oci_database_autonomous_database.demo_adb.id }
  • 20. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc GoldenGate Service (GGS) • Oracle GoldenGate (Microservices) as a Service • Builds one (1) deployment only resource "oci_golden_gate_deployment" "ggdev" { #Required compartment_id = "ocid1.compartment.oc1..aaaaaaaaeg3ug2usjziq5smuc5a6oc5up6ngkgy5ilkw2pgnjxz2xe67plbq" cpu_core_count = "2" deployment_type = "OGG" display_name = "ggdev" is_auto_scaling_enabled = "false" is_public = "true" license_model = "LICENSE_INCLUDED" subnet_id = var.devsubnet #nsg_ids = ["ocid1.networksecuritygroup.oc1.iad.aaaaaaaal4efdb64mjtutdfw5ju3dthibfmruqavaakx6olkjdx2lyaxmb3q"] ogg_data { admin_password = ”<password> admin_username = "oggadmin" deployment_name = "ggdev" } } #end-resource
  • 21. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Kubernetes (OKE) • Oracle Container Engine (OKE) is Oracle’s managed Kubernetes service • Lots of components within OCI – OCI module is best option module "oke" { source = "oracle-terraform-modules/oke/oci" version = "2.2.2" #Required api_fingerprint = var.fingerprint api_private_key_path = "~/.ssh/id_rsa" compartment_id = "ocid1.compartment.oc1……gmwuiynsonpq74fo2djk6hd64qu3lzw2xybym4svyhq" existing_key_id = "ocid1.key.oc1.iad.bbppj6k3aacuu.a……tsnq3ldofns5czn7vyzvxnvvnliq" region = var.region secret_id = "ocid1.vault.oc1.iad.bbppj6k3aacuu………w5e5mc6rhxcm7mzytdbsqt6g6ozaftjtj4uegbmwcuya" service_account_cluster_role_binding = "clustertestbinding" tenancy_id = var.tenancy_ocid user_id = var.user_ocid #Optional ssh_public_key_path = "~/.ssh/id_rsa.pub" }
  • 22. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Graph • Inherently exposes some of Terraform’s Core implementation details • Handy for debugging how Terraform is executing $ terraform graph digraph { compound = "true" newrank = "true" subgraph "root" { "[root] data.oci_identity_compartments.test_compartments (orphan)" [label = "data.oci_identity_compartments.test_compartments", shape = "box"] "[root] module.compute-instance.data.oci_core_instance_credentials.this (expand)" [label = "module.compute- instance.data.oci_core_instance_credentials.this", shape = "box"] "[root] module.compute-instance.data.oci_core_subnet.this (expand)" [label = "module.compute- instance.data.oci_core_subnet.this", shape = "box"] "[root] module.compute-instance.oci_core_instance.this (expand)" [label = "module.compute-instance.oci_core_instance.this", shape = "box"] "[root] module.compute-instance.oci_core_volume.this (expand)" [label = "module.compute-instance.oci_core_volume.this", shape = "box"] "[root] module.compute-instance.oci_core_volume_attachment.this (expand)" [label = "module.compute- instance.oci_core_volume_attachment.this", shape = "box"] "[root] oci_identity_compartment.test_compartment (orphan)" [label = "oci_identity_compartment.test_compartment", shape = "box"] "[root] output.compartment_info (destroy)" [label = "output.compartment_info (destroy)", shape = "note"] "[root] output.compute_info" [label = "output.compute_info", shape = "note"] "[root] provider["registry.terraform.io/hashicorp/oci"]" [label = "provider["registry.terraform.io/hashicorp/oci"]", shape = "diamond"] "[root] var.adw_ocid" [label = "var.adw_ocid", shape = "note"] "[root] var.compartment_description" [label = "var.compartment_description", shape = "note"] …
  • 23. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Stacks & Jobs Code Zip Upload & Run
  • 24. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 25. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Questions
  • 26. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc Contact RheoData [email protected] @rheodatallc http://rheodata.com
  • 27. www.rheodata.com Copyright, 2021 RheoData and affiliates @rheodatallc RheoData Happy Hour Tonight! Immediately After the Networking Event 6 pm – 7 pm EST