SlideShare une entreprise Scribd logo
1  sur  24
Copyright, 2020 RheoData and affiliates
Terraform & Oracle Cloud Infrastructure
in 30 minutes
Bobby Curtis, MBA
RheoData
2020
@rheodatallc / @dbasolved
#OracleCode
Copyright, 2020 RheoData and affiliates
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
Copyright, 2020 RheoData and affiliates
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
Copyright, 2020 RheoData and affiliates
Speaker
@dbasolved | @rheodatallc
Bobby.Curtis@rheodata.com
Copyright, 2020 RheoData and affiliates
Copyright, 2020 RheoData and affiliates
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
Copyright, 2020 RheoData and affiliates
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
Copyright, 2020 RheoData and affiliates
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
Copyright, 2020 RheoData and affiliates
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
Copyright, 2020 RheoData and affiliates
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!
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
Copyright, 2020 RheoData and affiliates
OCI Modules
• Modules for most item in
OCI
• IAM -> Identity
• VCN – Virtual Network
• Compute – Compute Nodes
• Most OCI Modules written in
0.11
• Use latest version available
• Downloaded Modules
• .terraform/modules
Copyright, 2020 RheoData and affiliates
Upgrading Code/Modules
$ cd <directory>
$ terraform 0.12upgrade <module_path>
Copyright, 2020 RheoData and affiliates
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
Copyright, 2020 RheoData and affiliates
Layout
Oracle/OCI
|
/.terraform/modules
/compute-instance/terraform-oci-compute-instance-2.01
-- main.tf
-- variables.tf
-- output.tf
/vcn/terraform-oci-vcn-1.0.1
-- main.tf
-- variables.tf
-- locals.tf
-- nat.tf
-- servicegateway.tf
-- vcn.tf
|
-- main.tf
-- variables.tf
-- output.tf
Copyright, 2020 RheoData and affiliates
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: enables accessing a bucket or object in OCI without providing credentials/time-based.
Copyright, 2020 RheoData and affiliates
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
}
Copyright, 2020 RheoData and affiliates
#########################
# 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 = "1"
shape = "VM.Standard2.1"
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
Autonomous Database(s)
• No OCI certified modules available
• Deprecated Resources by version
• Write custom
oci_database_autonomous_database
Autonomous Database(s)
##############################
# OCI - Autonomous Database(s)
##############################
resource "oci_database_autonomous_database" "demo_adb" {
#Required
admin_password = "WElcome12345##"
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
}
Copyright, 2020 RheoData and affiliates
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"
}
Copyright, 2020 RheoData and affiliates
Stacks & Jobs
Code Zip Upload & Run
Copyright, 2020 RheoData and affiliates
Roadmap
Introduction
Terraform Basics
OCI Provider & Modules
Coding Examples
Q & A
Copyright, 2020 RheoData and affiliates
Questions
Copyright, 2020 RheoData and affiliates
Contact RheoData
solutions@rheodata.com
@rheodatallc
http://rheodata.com
#OracleCode

Contenu connexe

Tendances

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 

Tendances (20)

Exachk and oem12c - IOUG C15LV
Exachk and oem12c - IOUG C15LVExachk and oem12c - IOUG C15LV
Exachk and oem12c - IOUG C15LV
 
Extreme Replication - RMOUG Presentation
Extreme Replication - RMOUG PresentationExtreme Replication - RMOUG Presentation
Extreme Replication - RMOUG Presentation
 
Oracle GoldenGate on Docker
Oracle GoldenGate on DockerOracle GoldenGate on Docker
Oracle GoldenGate on Docker
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
ECO 2022 - OCI and HashiCorp Terraform
ECO 2022 - OCI and HashiCorp TerraformECO 2022 - OCI and HashiCorp Terraform
ECO 2022 - OCI and HashiCorp Terraform
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)
 
GoldenGate Monitoring - GOUSER - 4/2014
GoldenGate Monitoring - GOUSER - 4/2014GoldenGate Monitoring - GOUSER - 4/2014
GoldenGate Monitoring - GOUSER - 4/2014
 
Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15
 
How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14
 
Enable GoldenGate Monitoring with OEM 12c/JAgent
Enable GoldenGate Monitoring with OEM 12c/JAgentEnable GoldenGate Monitoring with OEM 12c/JAgent
Enable GoldenGate Monitoring with OEM 12c/JAgent
 
Improve PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGateImprove PostgreSQL replication with Oracle GoldenGate
Improve PostgreSQL replication with Oracle GoldenGate
 
5 Keys to Oracle GoldenGate Implemenations
5 Keys to Oracle GoldenGate Implemenations5 Keys to Oracle GoldenGate Implemenations
5 Keys to Oracle GoldenGate Implemenations
 
Oem12c db12c and You
Oem12c db12c and YouOem12c db12c and You
Oem12c db12c and You
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Extreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGateExtreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGate
 
Oracle GoldenGate DB2 to Oracle11gR2 Configuration
Oracle GoldenGate DB2 to Oracle11gR2 ConfigurationOracle GoldenGate DB2 to Oracle11gR2 Configuration
Oracle GoldenGate DB2 to Oracle11gR2 Configuration
 
Oracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
Oracle GoldenGate and Baseball - 5 Keys for Moving to the CloudOracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
Oracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
 
Hit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate MicroservicesHit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate Microservices
 
Oracle GoldenGate Studio Intro
Oracle GoldenGate Studio IntroOracle GoldenGate Studio Intro
Oracle GoldenGate Studio Intro
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 

Similaire à Terraform & Oracle Cloud Infrastructure

Architectural solutions for the cloud
Architectural solutions for the cloudArchitectural solutions for the cloud
Architectural solutions for the cloud
threesixty
 
Cloud Native Application Development-build fast, low TCO, scalable & agile so...
Cloud Native Application Development-build fast, low TCO, scalable & agile so...Cloud Native Application Development-build fast, low TCO, scalable & agile so...
Cloud Native Application Development-build fast, low TCO, scalable & agile so...
Lucas Jellema
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 
Make your Cloud Applications Function for real – A Complete Overview of Oracl...
Make your Cloud Applications Function for real – A Complete Overview of Oracl...Make your Cloud Applications Function for real – A Complete Overview of Oracl...
Make your Cloud Applications Function for real – A Complete Overview of Oracl...
Lucas Jellema
 

Similaire à Terraform & Oracle Cloud Infrastructure (20)

Automating Cloud Operations - Everything you wanted to know about cURL and RE...
Automating Cloud Operations - Everything you wanted to know about cURL and RE...Automating Cloud Operations - Everything you wanted to know about cURL and RE...
Automating Cloud Operations - Everything you wanted to know about cURL and RE...
 
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
 
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with TerraformOracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
 
Oracle Integration Cloud 概要(20200507版)
Oracle Integration Cloud 概要(20200507版)Oracle Integration Cloud 概要(20200507版)
Oracle Integration Cloud 概要(20200507版)
 
Salesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web ComponentSalesforce meetup | Lightning Web Component
Salesforce meetup | Lightning Web Component
 
IoT cloud system implemented based on Azure services
IoT cloud system implemented based on Azure servicesIoT cloud system implemented based on Azure services
IoT cloud system implemented based on Azure services
 
Oracle Cloud Infrastructure:2020年6月度サービス・アップデート
Oracle Cloud Infrastructure:2020年6月度サービス・アップデートOracle Cloud Infrastructure:2020年6月度サービス・アップデート
Oracle Cloud Infrastructure:2020年6月度サービス・アップデート
 
Cloud Native Application Development - build fast, cheap, scalable and agile ...
Cloud Native Application Development - build fast, cheap, scalable and agile ...Cloud Native Application Development - build fast, cheap, scalable and agile ...
Cloud Native Application Development - build fast, cheap, scalable and agile ...
 
Architectural solutions for the cloud
Architectural solutions for the cloudArchitectural solutions for the cloud
Architectural solutions for the cloud
 
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
#dbhouseparty - Spatial Technologies - @Home and Everywhere Else on the Map
 
Cloud Native Application Development-build fast, low TCO, scalable & agile so...
Cloud Native Application Development-build fast, low TCO, scalable & agile so...Cloud Native Application Development-build fast, low TCO, scalable & agile so...
Cloud Native Application Development-build fast, low TCO, scalable & agile so...
 
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, SmileOCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
OCCIware presentation at EclipseDay in Lyon, November 2017, by Marc Dutoo, Smile
 
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
Model and pilot all cloud layers with OCCIware - Eclipse Day Lyon 2017
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
【旧版】Oracle Cloud Infrastructure:サービス概要のご紹介 [2020年6月版]
【旧版】Oracle Cloud Infrastructure:サービス概要のご紹介 [2020年6月版]【旧版】Oracle Cloud Infrastructure:サービス概要のご紹介 [2020年6月版]
【旧版】Oracle Cloud Infrastructure:サービス概要のご紹介 [2020年6月版]
 
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
はじめてのOracle Cloud Infrastructure(Oracle Cloudウェビナーシリーズ: 2020年6月24日)
 
Oracle Cloud Infrastructure:2020年8月度サービス・アップデート
Oracle Cloud Infrastructure:2020年8月度サービス・アップデートOracle Cloud Infrastructure:2020年8月度サービス・アップデート
Oracle Cloud Infrastructure:2020年8月度サービス・アップデート
 
Make your Cloud Applications Function for real – A Complete Overview of Oracl...
Make your Cloud Applications Function for real – A Complete Overview of Oracl...Make your Cloud Applications Function for real – A Complete Overview of Oracl...
Make your Cloud Applications Function for real – A Complete Overview of Oracl...
 
20180605 sso with apex and adfs the weblogic way
20180605 sso with apex and adfs the weblogic way20180605 sso with apex and adfs the weblogic way
20180605 sso with apex and adfs the weblogic way
 
Final terraform
Final terraformFinal terraform
Final terraform
 

Plus de Bobby Curtis (6)

MySQLHeatwave-TheBasics.pptx
MySQLHeatwave-TheBasics.pptxMySQLHeatwave-TheBasics.pptx
MySQLHeatwave-TheBasics.pptx
 
OOW19 - HOL5221
OOW19 - HOL5221OOW19 - HOL5221
OOW19 - HOL5221
 
Oracle GoldenGate Performance Tuning
Oracle GoldenGate Performance TuningOracle GoldenGate Performance Tuning
Oracle GoldenGate Performance Tuning
 
GoldenGate CDR from UKOUG 2017
GoldenGate CDR from UKOUG 2017GoldenGate CDR from UKOUG 2017
GoldenGate CDR from UKOUG 2017
 
Oracle virtualbox basic to rac attack
Oracle virtualbox basic to rac attackOracle virtualbox basic to rac attack
Oracle virtualbox basic to rac attack
 
Oracle GoldenGate 12c CDR Presentation for ECO
Oracle GoldenGate 12c CDR Presentation for ECOOracle GoldenGate 12c CDR Presentation for ECO
Oracle GoldenGate 12c CDR Presentation for ECO
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Terraform & Oracle Cloud Infrastructure

  • 1. Copyright, 2020 RheoData and affiliates Terraform & Oracle Cloud Infrastructure in 30 minutes Bobby Curtis, MBA RheoData 2020 @rheodatallc / @dbasolved #OracleCode
  • 2. Copyright, 2020 RheoData and affiliates Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 3. Copyright, 2020 RheoData and affiliates Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 4. Copyright, 2020 RheoData and affiliates Speaker @dbasolved | @rheodatallc Bobby.Curtis@rheodata.com
  • 5. Copyright, 2020 RheoData and affiliates
  • 6. Copyright, 2020 RheoData and affiliates 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
  • 7. Copyright, 2020 RheoData and affiliates Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 8. Copyright, 2020 RheoData and affiliates 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
  • 9. Copyright, 2020 RheoData and affiliates Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 10. Copyright, 2020 RheoData and affiliates 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! 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
  • 11. Copyright, 2020 RheoData and affiliates OCI Modules • Modules for most item in OCI • IAM -> Identity • VCN – Virtual Network • Compute – Compute Nodes • Most OCI Modules written in 0.11 • Use latest version available • Downloaded Modules • .terraform/modules
  • 12. Copyright, 2020 RheoData and affiliates Upgrading Code/Modules $ cd <directory> $ terraform 0.12upgrade <module_path>
  • 13. Copyright, 2020 RheoData and affiliates Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 14. Copyright, 2020 RheoData and affiliates Layout Oracle/OCI | /.terraform/modules /compute-instance/terraform-oci-compute-instance-2.01 -- main.tf -- variables.tf -- output.tf /vcn/terraform-oci-vcn-1.0.1 -- main.tf -- variables.tf -- locals.tf -- nat.tf -- servicegateway.tf -- vcn.tf | -- main.tf -- variables.tf -- output.tf
  • 15. Copyright, 2020 RheoData and affiliates 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: enables accessing a bucket or object in OCI without providing credentials/time-based.
  • 16. Copyright, 2020 RheoData and affiliates 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. Copyright, 2020 RheoData and affiliates ######################### # 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 = "1" shape = "VM.Standard2.1" 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. Autonomous Database(s) • No OCI certified modules available • Deprecated Resources by version • Write custom oci_database_autonomous_database
  • 19. Autonomous Database(s) ############################## # OCI - Autonomous Database(s) ############################## resource "oci_database_autonomous_database" "demo_adb" { #Required admin_password = "WElcome12345##" 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. Copyright, 2020 RheoData and affiliates 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" }
  • 21. Copyright, 2020 RheoData and affiliates Stacks & Jobs Code Zip Upload & Run
  • 22. Copyright, 2020 RheoData and affiliates Roadmap Introduction Terraform Basics OCI Provider & Modules Coding Examples Q & A
  • 23. Copyright, 2020 RheoData and affiliates Questions
  • 24. Copyright, 2020 RheoData and affiliates Contact RheoData solutions@rheodata.com @rheodatallc http://rheodata.com #OracleCode