SlideShare a Scribd company logo
© 2017 Capgemini. All rights reserved.1© 2017 Capgemini. All rights reserved.
An Introduction to Terraform
Chris Hollies
Capgemini UK Oracle IaaS lead
© 2017 Capgemini. All rights reserved.2 2© 2017 Capgemini. All rights reserved.2
I have worked with Oracle products since 1999,
focused around ERP.
Roles have included –
• Oracle PL/SQL & Pro*C Developer
• Oracle DBA
• Oracle E-Business Suite DBA
• Oracle Infrastructure Architect
• Oracle IaaS & PaaS Architect
• Technical Delivery Lead
• Oracle Pre-Sales Lead
Returned to Capgemini in 2016.
Capgemini UK Oracle IaaS Lead
Chris Hollies
© 2017 Capgemini. All rights reserved.3 3© 2017 Capgemini. All rights reserved.
© 2017 Capgemini. All rights reserved.3
Agenda
Overview of Terraform.
Why choose Terraform?
Terraform installation, structure, syntax,
characteristics and deployment
Sample use-cases and code examples
1
2
3
4 Best practices
5
Complementary tooling to incorporate
Terraform into a DevOps approach
© 2017 Capgemini. All rights reserved.4 4© 2017 Capgemini. All rights reserved.
© 2017 Capgemini. All rights reserved.4
Agenda
Overview of Terraform.
Why choose Terraform?
Terraform installation, structure, syntax,
characteristics and deployment
Sample use-cases and code examples
1
2
3
4 Best practices
5
Complementary tooling to incorporate
Terraform into a DevOps approach
© 2017 Capgemini. All rights reserved.5 5
Portable
• Binaries available for
various Linux distros, Mac
OS, Windows, Solaris
Declarative
• Specify the end-state and
Terraform derives the
execution plan
Multi-cloud
• Plug and play support for
over 100 different clouds
using lightweight provider
architecture
Simple & Fast
• Simple human readable
Hashicorp Configuration
Language
• Plain text
Why we chose Terraform
© 2017 Capgemini. All rights reserved.6 6
Why Terraform specifically, and which one?
Terraform is open source and licensed under the Mozilla Public Licence v2.0.
Terraform has a rich community and many Git repositories with sample code.
Since it supports over 100 different Infrastructure technologies and is open source,
Terraform does not lead to vendor lock-in unlike AWS CloudFormation, and is truly
multi-cloud unlike CloudFormation or Openstack Heat.
Like any good open source product, there are commercial versions available.
Terraform Pro adds collaboration and operations features whereas Terraform
Premium goes further with governance and policy management features.
© 2017 Capgemini. All rights reserved.7 7© 2017 Capgemini. All rights reserved.
© 2017 Capgemini. All rights reserved.7
Agenda
Overview of Terraform.
Why choose Terraform?
Terraform installation, structure, syntax,
characteristics and deployment
Sample use-cases and code examples
1
2
3
4 Best practices
5
Complementary tooling to incorporate
Terraform into a DevOps approach
© 2017 Capgemini. All rights reserved.8
Terraform Installation
© 2017 Capgemini. All rights reserved.9 9
• Created compartment (CJPH5)
• Created a Virtual Cloud Network in CJPH5 – 10.0.0.0/16 with
associated resources
• Created a VM called terra in the VCN
• Created a user called provtool
• Created an API signing key for the provtool user
Terraform Client Provisioning
© 2017 Capgemini. All rights reserved.13 13
Connect to terra1 and do this -
To install on OL7 do this –
sudo yum-config-manager --enable ol7_developer
sudo yum -y install terraform-0.11.7-1.el7 terraform-provider-oci-2.1.5-1.el7
Useradd terraform
Run terraform help
Tell them –
Sudo su – terra
mkdir –p terraform/base; cd terraform/base
Tell them we’re going to adopt dev practices, so we’re going to
install and use git; do so as a live demo
(https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
git init
This initialises the directory as a repo taking it under source code
control
© 2017 Capgemini. All rights reserved.14 14
• Terraform reads all ‘*.tf’ config files from current directory
• It reads them alphabetically
• It does not recurse
• Variables can be specified on command line, in standalone variables file or
for string variables, sourced as TF_VARS_ environment variables
Terraform – Infrastructure build process
• Terraform then builds a DAG – Directed Acyclic Graph with nodes
(resources) and edges (relationships)
• We can view these using graphviz
© 2017 Capgemini. All rights reserved.15 15
Terraform variables – Strings, Maps & Lists
Defined using a variable block.
• Name - Mandatory
• Type - Optional (default:string)
• Default - Optional
• Description - Optional
© 2017 Capgemini. All rights reserved.16 16
terraform.tfvars and *.auto.tfvars
Some variables are used so frequently that it makes sense to
abstract them into their own configuration file.
Special files will be automatically read by Terraform to set
variables –
• terraform.tfvars
• *.auto.tfvars
These files are a good place to store credentials and
connectivity configuration, but not the only place …
© 2017 Capgemini. All rights reserved.17 17
terraform.tfvars (and *.auto.tfvars)
# -- Tenant Information
tenancy_ocid =
"ocid1.tenancy.oc1..aaaaaaaahg2j4y6afjf6wzatofa4ojfkja…k64ba4a"
user_ocid = "ocid1.user.oc1..aaaaaaaaim55fbyubf673fcw…52k3lq"
compartment_ocid =
"ocid1.compartment.oc1..aaaaaaaa2ooed…durdy6rza5e3xhgjkncsk5ra
"
fingerprint = "b6:3b:16:3e:77:10:96:…:bb:92:80:6c"
private_key_path = "/home/oracle/.oci/oci_api_key.pem"
region = "eu-frankfurt-1"
# ---- availability domain (1, 2 or 3)
AD = "1"
The compartment we just created (CJPH1)
© 2017 Capgemini. All rights reserved.18 18© 2017 Capgemini. All rights reserved.
© 2017 Capgemini. All rights reserved.18
Agenda
Overview of Terraform.
Why choose Terraform?
Terraform installation, structure, syntax,
characteristics and deployment
Sample use-cases and code examples
1
2
3
4 Best practices
5
Complementary tooling to incorporate
Terraform into a DevOps approach
© 2017 Capgemini. All rights reserved.19
Building our first
infrastructure
© 2017 Capgemini. All rights reserved.20 20
a_provider.tf
variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "private_key_path" {}
variable "region" {}
# Declare that we will use the OCI provider
provider "oci" {
region = "${var.region}"
tenancy_ocid = "${var.tenancy_ocid}"
user_ocid = "${var.user_ocid}"
fingerprint = "${var.fingerprint}"
private_key_path = "${var.private_key_path}"
}
© 2017 Capgemini. All rights reserved.21 21
Do the following –
git add terraform.tfvars
git add a_provider.tf
terraform init
This will show terraform downloading the provider
Can also vi a .gitignore containing –
.gitignore
.terraform
Now commit our files by doing this –
git commit -m "Configure the provider"
© 2017 Capgemini. All rights reserved.22 22
b_vcn.tf
# Need to pull in compartment ocid
variable compartment_ocid {}
# ------ Create VCN
resource "oci_core_virtual_network" “cjph-tst-vcn" {
cidr_block = “10.0.0.0/24"
compartment_id = "${var.compartment_ocid}"
display_name = “cjph-tst-vcn"
dns_label = “cjphtstvcn"
}
resource “resource_type” “resource_name” {}
© 2017 Capgemini. All rights reserved.23 23
b_vcn.tf
© 2017 Capgemini. All rights reserved.24 24
c_igw.tf
# ------ Create Internet Gateway
resource "oci_core_internet_gateway" “cjph-tst-igw" {
compartment_id = "${var.compartment_ocid}"
display_name = “cjph-tst-igw"
vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}"
}
© 2017 Capgemini. All rights reserved.25 25
c_igw.tf
© 2017 Capgemini. All rights reserved.26 26
Terraform – Infrastructure build process
Use terraform plan to show the build process.
Pass the output to graphviz
Use graphviz dot to view the DAG.
© 2017 Capgemini. All rights reserved.27 27
Terraform data sources
Allow us to fetch or compute read-only data from outside
Terraform or from a Terraform configuration, such as –
• Image lists
• Availability domains
• Governance configurations
• Configuration Metadata
• Infrastructure resources
Every data source in Terraform is mapped to a provider based
on longest-prefix matching, such as aws_ for Amazon Web
Services or oci_ for Oracle Cloud Infrastructure.
© 2017 Capgemini. All rights reserved.28 28
datasources.tf
# -------- get the list of available ADs
data "oci_identity_availability_domains" "ADs" {
compartment_id = "${var.tenancy_ocid}"
}
data “datasource_type” “datasource_name” {}
© 2017 Capgemini. All rights reserved.29 29
d_subnets.tf
# ------ Create public subnets
resource "oci_core_subnet" "cjph-tst-ad1-admpub-subnet" {
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}"
cidr_block = "10.0.0.0/26"
display_name = "cjph-tst-ad1-admpub-subnet"
dns_label = "cjphtstadmpubsub"
compartment_id = "${var.compartment_ocid}"
vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}"
}
resource "oci_core_subnet" "cjph-tst-ad1-apppub-subnet" {
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}"
cidr_block = "10.0.0.64/26"
display_name = "cjph-tst-ad1-apppub-subnet"
dns_label = "cjphtstapppubsub"
compartment_id = "${var.compartment_ocid}"
vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}"
}
resource "oci_core_subnet" "cjph-tst-ad1-dbpub-subnet" {
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}"
cidr_block = "10.0.0.128/26"
display_name = "cjph-tst-ad1-dbpub-subnet"
dns_label = "cjphtstdbpubsub"
compartment_id = "${var.compartment_ocid}"
vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}"
}
© 2017 Capgemini. All rights reserved.31
Tainting & destroying
infrastructure
© 2017 Capgemini. All rights reserved.32 32
Tainting a resource
Tainting a resource can be done manually
Tainting can be done by terraform during a failed apply operation
Tainted resources will be destroyed and recreated on next apply command
(terraform apply – does nothing
Terraform taint oci_core_internet_gateway.cjph-tst-igw
Terraform plan
Terraform apply
© 2017 Capgemini. All rights reserved.33 33
Destroying a resource
Resources can be selectively destroyed using –target=
Without options, terraform will destroy all resources
© 2017 Capgemini. All rights reserved.34 34© 2017 Capgemini. All rights reserved.
© 2017 Capgemini. All rights reserved.34
Agenda
Overview of Terraform.
Why choose Terraform?
Terraform installation, structure, syntax,
characteristics and deployment
Sample use-cases and code examples
1
2
3
4 Best practices
5
Complementary tooling to incorporate
Terraform into a DevOps approach
© 2017 Capgemini. All rights reserved.35 35
Suggested best practices
• Collaborate - Agree on a common approach and evolve it as a team
• Keep your configurations DRY
• Structure your configurations by environment/department/both
• Control your source code
• Keep groups of resources within configurations small –
blast radius
© 2017 Capgemini. All rights reserved.36 36© 2017 Capgemini. All rights reserved.
© 2017 Capgemini. All rights reserved.36
Agenda
Overview of Terraform.
Why choose Terraform?
Terraform installation, structure, syntax,
characteristics and deployment
Sample use-cases and code examples
1
2
3
4 Best practices
5
Complementary tooling to incorporate
Terraform into a DevOps approach
© 2017 Capgemini. All rights reserved.37 37Oracle Cloud | Johan Louwers | 2018 © 2017 Capgemini. All rights reserved.
Oracle Cloud – IaaS Integration
CODE BUILD TEST RELEASE OPERATE
Developer
Community
Automatic
code review
Version
control
Build
automation
Deployment
automation
(unit) test
automation
Build
automation
Deployment
automation
Integration
test
automation
Deployment
automation
Run
operations
Oracle Cloud
Developer Services
© 2017 Capgemini. All rights reserved.38
With more than 190,000 people, Capgemini is present in over 40 countries and
celebrates its 50th Anniversary year in 2017. A global leader in consulting, technology
and outsourcing services, the Group reported 2016 global revenues of EUR 12.5 billion.
Together with its clients, Capgemini creates and delivers business, technology and
digital solutions that fit their needs, enabling them to achieve innovation and
competitiveness. A deeply multicultural organization, Capgemini has developed its own
way of working, the Collaborative Business Experience™, and draws on Rightshore®, its
worldwide delivery model.
About Capgemini
Learn more about us at
www.capgemini.com
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group.
Copyright © 2017 Capgemini. All rights reserved.
Rightshore® is a trademark belonging to Capgemini.
This message is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please
notify the sender immediately and delete all copies of this message.

More Related Content

What's hot

Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introductionsoniasnowfrog
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
Best Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformBest Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformDevOps.com
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowAnton Babenko
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructuredAmi Mahloof
 
An introduction to terraform
An introduction to terraformAn introduction to terraform
An introduction to terraformJulien Pivotto
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To TerraformSasitha Iresh
 
Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Anton Babenko
 

What's hot (20)

Introduction to IAC and Terraform
Introduction to IAC and Terraform Introduction to IAC and Terraform
Introduction to IAC and Terraform
 
Terraform
TerraformTerraform
Terraform
 
Terraform
TerraformTerraform
Terraform
 
Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introduction
 
Terraform
TerraformTerraform
Terraform
 
Terraform Basics
Terraform BasicsTerraform Basics
Terraform Basics
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
Effective terraform
Effective terraformEffective terraform
Effective terraform
 
Best Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformBest Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with Terraform
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
 
Terraform 101
Terraform 101Terraform 101
Terraform 101
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Terraform on Azure
Terraform on AzureTerraform on Azure
Terraform on Azure
 
Final terraform
Final terraformFinal terraform
Final terraform
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Terraform
TerraformTerraform
Terraform
 
An introduction to terraform
An introduction to terraformAn introduction to terraform
An introduction to terraform
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To Terraform
 
Terraform on Azure
Terraform on AzureTerraform on Azure
Terraform on Azure
 
Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018
 

Similar to Terraform

Platform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudPlatform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudSimon Haslam
 
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsGraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsOracle Developers
 
Terraform with OCI
Terraform with OCITerraform with OCI
Terraform with OCIJeSam Kim
 
TEC118 – How Do You Manage the Configuration of Your Environments from Metal ...
TEC118 –How Do You Manage the Configuration of Your Environments from Metal ...TEC118 –How Do You Manage the Configuration of Your Environments from Metal ...
TEC118 – How Do You Manage the Configuration of Your Environments from Metal ...Chris Kernaghan
 
Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)
Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)
Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)Akamai Developers & Admins
 
Using Databases and Containers From Development to Deployment
Using Databases and Containers  From Development to DeploymentUsing Databases and Containers  From Development to Deployment
Using Databases and Containers From Development to DeploymentAerospike, Inc.
 
EPM, ERP, Cloud, and On-Premise: All Integration Options Explained
EPM, ERP, Cloud, and On-Premise:  All Integration Options ExplainedEPM, ERP, Cloud, and On-Premise:  All Integration Options Explained
EPM, ERP, Cloud, and On-Premise: All Integration Options ExplainedJoseph Alaimo Jr
 
Oracle Cloud - Infrastruktura jako kód
Oracle Cloud - Infrastruktura jako kódOracle Cloud - Infrastruktura jako kód
Oracle Cloud - Infrastruktura jako kódMarketingArrowECS_CZ
 
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston MeetupOpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston Meetupragss
 
Spark Summit EU talk by Debasish Das and Pramod Narasimha
Spark Summit EU talk by Debasish Das and Pramod NarasimhaSpark Summit EU talk by Debasish Das and Pramod Narasimha
Spark Summit EU talk by Debasish Das and Pramod NarasimhaSpark Summit
 
Virtual training Intro to InfluxDB & Telegraf
Virtual training  Intro to InfluxDB & TelegrafVirtual training  Intro to InfluxDB & Telegraf
Virtual training Intro to InfluxDB & TelegrafInfluxData
 
Cloud Adoption: From Start to PaaS
Cloud Adoption: From Start to PaaSCloud Adoption: From Start to PaaS
Cloud Adoption: From Start to PaaSAndrew Khoury
 
Why Open Source Works for DevOps Monitoring
Why Open Source Works for DevOps MonitoringWhy Open Source Works for DevOps Monitoring
Why Open Source Works for DevOps MonitoringDevOps.com
 
Integrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinIntegrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinDatabricks
 
Terrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning AutomationTerrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning AutomationSimon Haslam
 
RIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptxRIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptxMrJustbis
 
Realtime Analytical Query Processing and Predictive Model Building on High Di...
Realtime Analytical Query Processing and Predictive Model Building on High Di...Realtime Analytical Query Processing and Predictive Model Building on High Di...
Realtime Analytical Query Processing and Predictive Model Building on High Di...Spark Summit
 

Similar to Terraform (20)

Platform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle CloudPlatform Provisioning Automation for Oracle Cloud
Platform Provisioning Automation for Oracle Cloud
 
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsGraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
 
Terraform with OCI
Terraform with OCITerraform with OCI
Terraform with OCI
 
TEC118 – How Do You Manage the Configuration of Your Environments from Metal ...
TEC118 –How Do You Manage the Configuration of Your Environments from Metal ...TEC118 –How Do You Manage the Configuration of Your Environments from Metal ...
TEC118 – How Do You Manage the Configuration of Your Environments from Metal ...
 
Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)
Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)
Configs, Configs, Everywhere! (Actually, Let's Simplify All Those Configs)
 
SD Times - Docker v2
SD Times - Docker v2SD Times - Docker v2
SD Times - Docker v2
 
Using Databases and Containers From Development to Deployment
Using Databases and Containers  From Development to DeploymentUsing Databases and Containers  From Development to Deployment
Using Databases and Containers From Development to Deployment
 
EPM, ERP, Cloud, and On-Premise: All Integration Options Explained
EPM, ERP, Cloud, and On-Premise:  All Integration Options ExplainedEPM, ERP, Cloud, and On-Premise:  All Integration Options Explained
EPM, ERP, Cloud, and On-Premise: All Integration Options Explained
 
Oracle Cloud - Infrastruktura jako kód
Oracle Cloud - Infrastruktura jako kódOracle Cloud - Infrastruktura jako kód
Oracle Cloud - Infrastruktura jako kód
 
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston MeetupOpenStack + Cloud Foundry for the OpenStack Boston Meetup
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
 
Getting Started with Terraform
Getting Started with TerraformGetting Started with Terraform
Getting Started with Terraform
 
Spark Summit EU talk by Debasish Das and Pramod Narasimha
Spark Summit EU talk by Debasish Das and Pramod NarasimhaSpark Summit EU talk by Debasish Das and Pramod Narasimha
Spark Summit EU talk by Debasish Das and Pramod Narasimha
 
Virtual training Intro to InfluxDB & Telegraf
Virtual training  Intro to InfluxDB & TelegrafVirtual training  Intro to InfluxDB & Telegraf
Virtual training Intro to InfluxDB & Telegraf
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
 
Cloud Adoption: From Start to PaaS
Cloud Adoption: From Start to PaaSCloud Adoption: From Start to PaaS
Cloud Adoption: From Start to PaaS
 
Why Open Source Works for DevOps Monitoring
Why Open Source Works for DevOps MonitoringWhy Open Source Works for DevOps Monitoring
Why Open Source Works for DevOps Monitoring
 
Integrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinIntegrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther Kundin
 
Terrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning AutomationTerrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning Automation
 
RIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptxRIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptx
 
Realtime Analytical Query Processing and Predictive Model Building on High Di...
Realtime Analytical Query Processing and Predictive Model Building on High Di...Realtime Analytical Query Processing and Predictive Model Building on High Di...
Realtime Analytical Query Processing and Predictive Model Building on High Di...
 

More from Phil Wilkins

API Design – More than just a Payload Definition
API Design – More than just a Payload DefinitionAPI Design – More than just a Payload Definition
API Design – More than just a Payload DefinitionPhil Wilkins
 
Is 12 Factor App Right About Logging
Is 12 Factor App Right About LoggingIs 12 Factor App Right About Logging
Is 12 Factor App Right About LoggingPhil Wilkins
 
APIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingAPIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingPhil Wilkins
 
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...Phil Wilkins
 
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)Phil Wilkins
 
Oracle OCI APIs and SDK
Oracle OCI APIs and SDKOracle OCI APIs and SDK
Oracle OCI APIs and SDKPhil Wilkins
 
Api more than payload (2021 Update)
Api more than payload (2021 Update)Api more than payload (2021 Update)
Api more than payload (2021 Update)Phil Wilkins
 
API more than payload
API more than payloadAPI more than payload
API more than payloadPhil Wilkins
 
How fluentd fits into the modern software landscape
How fluentd fits into the modern software landscapeHow fluentd fits into the modern software landscape
How fluentd fits into the modern software landscapePhil Wilkins
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20Phil Wilkins
 
FluentD for end to end monitoring
FluentD for end to end monitoringFluentD for end to end monitoring
FluentD for end to end monitoringPhil Wilkins
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace WayPhil Wilkins
 
Apiary - A Developers Perspective
Apiary - A Developers PerspectiveApiary - A Developers Perspective
Apiary - A Developers PerspectivePhil Wilkins
 
Secrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API PlatformSecrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API PlatformPhil Wilkins
 
Oracle London Developer Meetup November 2018
Oracle London Developer Meetup November 2018Oracle London Developer Meetup November 2018
Oracle London Developer Meetup November 2018Phil Wilkins
 
London Oracle Developer Meetup - June 18 - Drones with APIs
London Oracle Developer Meetup - June 18 - Drones with APIsLondon Oracle Developer Meetup - June 18 - Drones with APIs
London Oracle Developer Meetup - June 18 - Drones with APIsPhil Wilkins
 
London Oracle Developer Meetup April 18
London Oracle Developer Meetup April 18London Oracle Developer Meetup April 18
London Oracle Developer Meetup April 18Phil Wilkins
 
Oracle Developer Meetup March 2018
Oracle Developer Meetup March 2018Oracle Developer Meetup March 2018
Oracle Developer Meetup March 2018Phil Wilkins
 
OracleDeveloperMeetup - London 19-12-17
OracleDeveloperMeetup - London 19-12-17OracleDeveloperMeetup - London 19-12-17
OracleDeveloperMeetup - London 19-12-17Phil Wilkins
 
Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...
Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...
Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...Phil Wilkins
 

More from Phil Wilkins (20)

API Design – More than just a Payload Definition
API Design – More than just a Payload DefinitionAPI Design – More than just a Payload Definition
API Design – More than just a Payload Definition
 
Is 12 Factor App Right About Logging
Is 12 Factor App Right About LoggingIs 12 Factor App Right About Logging
Is 12 Factor App Right About Logging
 
APIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go StreamingAPIs, STOP Polling, lets go Streaming
APIs, STOP Polling, lets go Streaming
 
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
Fluentd – Making Logging Easy & Effective in a Multi-cloud & Hybrid Environme...
 
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
GitHub Actions - using Free Oracle Cloud Infrastructure (OCI)
 
Oracle OCI APIs and SDK
Oracle OCI APIs and SDKOracle OCI APIs and SDK
Oracle OCI APIs and SDK
 
Api more than payload (2021 Update)
Api more than payload (2021 Update)Api more than payload (2021 Update)
Api more than payload (2021 Update)
 
API more than payload
API more than payloadAPI more than payload
API more than payload
 
How fluentd fits into the modern software landscape
How fluentd fits into the modern software landscapeHow fluentd fits into the modern software landscape
How fluentd fits into the modern software landscape
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
FluentD for end to end monitoring
FluentD for end to end monitoringFluentD for end to end monitoring
FluentD for end to end monitoring
 
Meetups - The Oracle Ace Way
Meetups - The Oracle Ace WayMeetups - The Oracle Ace Way
Meetups - The Oracle Ace Way
 
Apiary - A Developers Perspective
Apiary - A Developers PerspectiveApiary - A Developers Perspective
Apiary - A Developers Perspective
 
Secrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API PlatformSecrets of Custom API Policies on the Oracle API Platform
Secrets of Custom API Policies on the Oracle API Platform
 
Oracle London Developer Meetup November 2018
Oracle London Developer Meetup November 2018Oracle London Developer Meetup November 2018
Oracle London Developer Meetup November 2018
 
London Oracle Developer Meetup - June 18 - Drones with APIs
London Oracle Developer Meetup - June 18 - Drones with APIsLondon Oracle Developer Meetup - June 18 - Drones with APIs
London Oracle Developer Meetup - June 18 - Drones with APIs
 
London Oracle Developer Meetup April 18
London Oracle Developer Meetup April 18London Oracle Developer Meetup April 18
London Oracle Developer Meetup April 18
 
Oracle Developer Meetup March 2018
Oracle Developer Meetup March 2018Oracle Developer Meetup March 2018
Oracle Developer Meetup March 2018
 
OracleDeveloperMeetup - London 19-12-17
OracleDeveloperMeetup - London 19-12-17OracleDeveloperMeetup - London 19-12-17
OracleDeveloperMeetup - London 19-12-17
 
Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...
Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...
Look at Oracle Integration Cloud – its relationship to ICS. Customer use Case...
 

Recently uploaded

AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 

Recently uploaded (20)

AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 

Terraform

  • 1. © 2017 Capgemini. All rights reserved.1© 2017 Capgemini. All rights reserved. An Introduction to Terraform Chris Hollies Capgemini UK Oracle IaaS lead
  • 2. © 2017 Capgemini. All rights reserved.2 2© 2017 Capgemini. All rights reserved.2 I have worked with Oracle products since 1999, focused around ERP. Roles have included – • Oracle PL/SQL & Pro*C Developer • Oracle DBA • Oracle E-Business Suite DBA • Oracle Infrastructure Architect • Oracle IaaS & PaaS Architect • Technical Delivery Lead • Oracle Pre-Sales Lead Returned to Capgemini in 2016. Capgemini UK Oracle IaaS Lead Chris Hollies
  • 3. © 2017 Capgemini. All rights reserved.3 3© 2017 Capgemini. All rights reserved. © 2017 Capgemini. All rights reserved.3 Agenda Overview of Terraform. Why choose Terraform? Terraform installation, structure, syntax, characteristics and deployment Sample use-cases and code examples 1 2 3 4 Best practices 5 Complementary tooling to incorporate Terraform into a DevOps approach
  • 4. © 2017 Capgemini. All rights reserved.4 4© 2017 Capgemini. All rights reserved. © 2017 Capgemini. All rights reserved.4 Agenda Overview of Terraform. Why choose Terraform? Terraform installation, structure, syntax, characteristics and deployment Sample use-cases and code examples 1 2 3 4 Best practices 5 Complementary tooling to incorporate Terraform into a DevOps approach
  • 5. © 2017 Capgemini. All rights reserved.5 5 Portable • Binaries available for various Linux distros, Mac OS, Windows, Solaris Declarative • Specify the end-state and Terraform derives the execution plan Multi-cloud • Plug and play support for over 100 different clouds using lightweight provider architecture Simple & Fast • Simple human readable Hashicorp Configuration Language • Plain text Why we chose Terraform
  • 6. © 2017 Capgemini. All rights reserved.6 6 Why Terraform specifically, and which one? Terraform is open source and licensed under the Mozilla Public Licence v2.0. Terraform has a rich community and many Git repositories with sample code. Since it supports over 100 different Infrastructure technologies and is open source, Terraform does not lead to vendor lock-in unlike AWS CloudFormation, and is truly multi-cloud unlike CloudFormation or Openstack Heat. Like any good open source product, there are commercial versions available. Terraform Pro adds collaboration and operations features whereas Terraform Premium goes further with governance and policy management features.
  • 7. © 2017 Capgemini. All rights reserved.7 7© 2017 Capgemini. All rights reserved. © 2017 Capgemini. All rights reserved.7 Agenda Overview of Terraform. Why choose Terraform? Terraform installation, structure, syntax, characteristics and deployment Sample use-cases and code examples 1 2 3 4 Best practices 5 Complementary tooling to incorporate Terraform into a DevOps approach
  • 8. © 2017 Capgemini. All rights reserved.8 Terraform Installation
  • 9. © 2017 Capgemini. All rights reserved.9 9 • Created compartment (CJPH5) • Created a Virtual Cloud Network in CJPH5 – 10.0.0.0/16 with associated resources • Created a VM called terra in the VCN • Created a user called provtool • Created an API signing key for the provtool user Terraform Client Provisioning
  • 10. © 2017 Capgemini. All rights reserved.13 13 Connect to terra1 and do this - To install on OL7 do this – sudo yum-config-manager --enable ol7_developer sudo yum -y install terraform-0.11.7-1.el7 terraform-provider-oci-2.1.5-1.el7 Useradd terraform Run terraform help Tell them – Sudo su – terra mkdir –p terraform/base; cd terraform/base Tell them we’re going to adopt dev practices, so we’re going to install and use git; do so as a live demo (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) git init This initialises the directory as a repo taking it under source code control
  • 11. © 2017 Capgemini. All rights reserved.14 14 • Terraform reads all ‘*.tf’ config files from current directory • It reads them alphabetically • It does not recurse • Variables can be specified on command line, in standalone variables file or for string variables, sourced as TF_VARS_ environment variables Terraform – Infrastructure build process • Terraform then builds a DAG – Directed Acyclic Graph with nodes (resources) and edges (relationships) • We can view these using graphviz
  • 12. © 2017 Capgemini. All rights reserved.15 15 Terraform variables – Strings, Maps & Lists Defined using a variable block. • Name - Mandatory • Type - Optional (default:string) • Default - Optional • Description - Optional
  • 13. © 2017 Capgemini. All rights reserved.16 16 terraform.tfvars and *.auto.tfvars Some variables are used so frequently that it makes sense to abstract them into their own configuration file. Special files will be automatically read by Terraform to set variables – • terraform.tfvars • *.auto.tfvars These files are a good place to store credentials and connectivity configuration, but not the only place …
  • 14. © 2017 Capgemini. All rights reserved.17 17 terraform.tfvars (and *.auto.tfvars) # -- Tenant Information tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaahg2j4y6afjf6wzatofa4ojfkja…k64ba4a" user_ocid = "ocid1.user.oc1..aaaaaaaaim55fbyubf673fcw…52k3lq" compartment_ocid = "ocid1.compartment.oc1..aaaaaaaa2ooed…durdy6rza5e3xhgjkncsk5ra " fingerprint = "b6:3b:16:3e:77:10:96:…:bb:92:80:6c" private_key_path = "/home/oracle/.oci/oci_api_key.pem" region = "eu-frankfurt-1" # ---- availability domain (1, 2 or 3) AD = "1" The compartment we just created (CJPH1)
  • 15. © 2017 Capgemini. All rights reserved.18 18© 2017 Capgemini. All rights reserved. © 2017 Capgemini. All rights reserved.18 Agenda Overview of Terraform. Why choose Terraform? Terraform installation, structure, syntax, characteristics and deployment Sample use-cases and code examples 1 2 3 4 Best practices 5 Complementary tooling to incorporate Terraform into a DevOps approach
  • 16. © 2017 Capgemini. All rights reserved.19 Building our first infrastructure
  • 17. © 2017 Capgemini. All rights reserved.20 20 a_provider.tf variable "tenancy_ocid" {} variable "user_ocid" {} variable "fingerprint" {} variable "private_key_path" {} variable "region" {} # Declare that we will use the OCI provider provider "oci" { region = "${var.region}" tenancy_ocid = "${var.tenancy_ocid}" user_ocid = "${var.user_ocid}" fingerprint = "${var.fingerprint}" private_key_path = "${var.private_key_path}" }
  • 18. © 2017 Capgemini. All rights reserved.21 21 Do the following – git add terraform.tfvars git add a_provider.tf terraform init This will show terraform downloading the provider Can also vi a .gitignore containing – .gitignore .terraform Now commit our files by doing this – git commit -m "Configure the provider"
  • 19. © 2017 Capgemini. All rights reserved.22 22 b_vcn.tf # Need to pull in compartment ocid variable compartment_ocid {} # ------ Create VCN resource "oci_core_virtual_network" “cjph-tst-vcn" { cidr_block = “10.0.0.0/24" compartment_id = "${var.compartment_ocid}" display_name = “cjph-tst-vcn" dns_label = “cjphtstvcn" } resource “resource_type” “resource_name” {}
  • 20. © 2017 Capgemini. All rights reserved.23 23 b_vcn.tf
  • 21. © 2017 Capgemini. All rights reserved.24 24 c_igw.tf # ------ Create Internet Gateway resource "oci_core_internet_gateway" “cjph-tst-igw" { compartment_id = "${var.compartment_ocid}" display_name = “cjph-tst-igw" vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}" }
  • 22. © 2017 Capgemini. All rights reserved.25 25 c_igw.tf
  • 23. © 2017 Capgemini. All rights reserved.26 26 Terraform – Infrastructure build process Use terraform plan to show the build process. Pass the output to graphviz Use graphviz dot to view the DAG.
  • 24. © 2017 Capgemini. All rights reserved.27 27 Terraform data sources Allow us to fetch or compute read-only data from outside Terraform or from a Terraform configuration, such as – • Image lists • Availability domains • Governance configurations • Configuration Metadata • Infrastructure resources Every data source in Terraform is mapped to a provider based on longest-prefix matching, such as aws_ for Amazon Web Services or oci_ for Oracle Cloud Infrastructure.
  • 25. © 2017 Capgemini. All rights reserved.28 28 datasources.tf # -------- get the list of available ADs data "oci_identity_availability_domains" "ADs" { compartment_id = "${var.tenancy_ocid}" } data “datasource_type” “datasource_name” {}
  • 26. © 2017 Capgemini. All rights reserved.29 29 d_subnets.tf # ------ Create public subnets resource "oci_core_subnet" "cjph-tst-ad1-admpub-subnet" { availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" cidr_block = "10.0.0.0/26" display_name = "cjph-tst-ad1-admpub-subnet" dns_label = "cjphtstadmpubsub" compartment_id = "${var.compartment_ocid}" vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}" } resource "oci_core_subnet" "cjph-tst-ad1-apppub-subnet" { availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" cidr_block = "10.0.0.64/26" display_name = "cjph-tst-ad1-apppub-subnet" dns_label = "cjphtstapppubsub" compartment_id = "${var.compartment_ocid}" vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}" } resource "oci_core_subnet" "cjph-tst-ad1-dbpub-subnet" { availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" cidr_block = "10.0.0.128/26" display_name = "cjph-tst-ad1-dbpub-subnet" dns_label = "cjphtstdbpubsub" compartment_id = "${var.compartment_ocid}" vcn_id = "${oci_core_virtual_network.cjph-tst-vcn.id}" }
  • 27. © 2017 Capgemini. All rights reserved.31 Tainting & destroying infrastructure
  • 28. © 2017 Capgemini. All rights reserved.32 32 Tainting a resource Tainting a resource can be done manually Tainting can be done by terraform during a failed apply operation Tainted resources will be destroyed and recreated on next apply command (terraform apply – does nothing Terraform taint oci_core_internet_gateway.cjph-tst-igw Terraform plan Terraform apply
  • 29. © 2017 Capgemini. All rights reserved.33 33 Destroying a resource Resources can be selectively destroyed using –target= Without options, terraform will destroy all resources
  • 30. © 2017 Capgemini. All rights reserved.34 34© 2017 Capgemini. All rights reserved. © 2017 Capgemini. All rights reserved.34 Agenda Overview of Terraform. Why choose Terraform? Terraform installation, structure, syntax, characteristics and deployment Sample use-cases and code examples 1 2 3 4 Best practices 5 Complementary tooling to incorporate Terraform into a DevOps approach
  • 31. © 2017 Capgemini. All rights reserved.35 35 Suggested best practices • Collaborate - Agree on a common approach and evolve it as a team • Keep your configurations DRY • Structure your configurations by environment/department/both • Control your source code • Keep groups of resources within configurations small – blast radius
  • 32. © 2017 Capgemini. All rights reserved.36 36© 2017 Capgemini. All rights reserved. © 2017 Capgemini. All rights reserved.36 Agenda Overview of Terraform. Why choose Terraform? Terraform installation, structure, syntax, characteristics and deployment Sample use-cases and code examples 1 2 3 4 Best practices 5 Complementary tooling to incorporate Terraform into a DevOps approach
  • 33. © 2017 Capgemini. All rights reserved.37 37Oracle Cloud | Johan Louwers | 2018 © 2017 Capgemini. All rights reserved. Oracle Cloud – IaaS Integration CODE BUILD TEST RELEASE OPERATE Developer Community Automatic code review Version control Build automation Deployment automation (unit) test automation Build automation Deployment automation Integration test automation Deployment automation Run operations Oracle Cloud Developer Services
  • 34. © 2017 Capgemini. All rights reserved.38 With more than 190,000 people, Capgemini is present in over 40 countries and celebrates its 50th Anniversary year in 2017. A global leader in consulting, technology and outsourcing services, the Group reported 2016 global revenues of EUR 12.5 billion. Together with its clients, Capgemini creates and delivers business, technology and digital solutions that fit their needs, enabling them to achieve innovation and competitiveness. A deeply multicultural organization, Capgemini has developed its own way of working, the Collaborative Business Experience™, and draws on Rightshore®, its worldwide delivery model. About Capgemini Learn more about us at www.capgemini.com This message contains information that may be privileged or confidential and is the property of the Capgemini Group. Copyright © 2017 Capgemini. All rights reserved. Rightshore® is a trademark belonging to Capgemini. This message is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Editor's Notes

  1. Rename some files to reorder them and show that the output is actually the same Now do a yum –y install graphviz Terraform graph Terraform graph > cjph.dot dot cjph.dot -Tsvg -o cjph.svg FTP the svg back and view it
  2. Terraform plan Terraform graph > cjph2.dot dot cjph2.dot -Tsvg -o cjph2.svg FTP the svg back and view it