hellocloud.io
Prepared By ~ Sai
Hello!
This is SAI.
Core Principles
● Humility
● Grit
● Deep Work
● Focus
● Consistency
©2017 HelloCloud.io
Infrastructure as Code ( IAC )
Referred to as Programmable Infrastructure
HelloCloud.io
The enabling idea of Infrastructure as Code is that the systems and devices used to run software
can be treated as if they, themselves, are software.
- Infrastructure as Code by Kief Morris
©2017 HelloCloud.io
HelloCloud.io
Source : Wikipedia ©2017 HelloCloud.io
HelloCloud.io
©2017 HelloCloud.io
“IAC” Tools
Google Cloud Deployment Manager
Microsoft Azure Resource Manager
©2017 HelloCloud.io
Source : terraform.io ©2017 HelloCloud.io
HelloCloud.io
AWS
EC2
VPC
S3
DynamoDB
IAM
CloudWatch
KMS
EBS
A
P
I
REQUEST - PROVISIONING INFRASTRUCTURE
plan, apply, destroy
RESPONSE
public_subnet
10.10.1.0/24
ap-southeast-2a
instance1
VPC : vpc1
10.10.0.0/16
REGION : ap-southeast-2
Internet gateway
Internet
Setup AWS VPC Peering with Terraform
VPC Peering
private_subnet
10.10.2.0/24
ap-southeast-2b
instance2
public_subnet
192.168.1.0/24
ap-southeast-2a
instance3
VPC : vpc2
192.168.0.0/16
REGION : ap-southeast-2
Internet gateway
private_subnet
192.168.2.0/24
ap-southeast-2b
instance4
Internet
©2017 HelloCloud.io
©2017 HelloCloud.io
©2017 HelloCloud.io
HelloCloud.io
Sample Terraform Code
provider "aws" {
region = "ap-southeast-2"
shared_credentials_file = "/Users/hellocloud/.aws/credentials"
profile = "terraform"
}
resource "aws_vpc" "vpc1" {
cidr_block = "10.10.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tags = { Name = "vpc1"}
}
resource "aws_vpc" "vpc2" {
cidr_block = "192.168.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tags = { Name = "vpc2"}
}
vpc_peering_project.tf
©2017 HelloCloud.io
©2017 HelloCloud.io
©2017 HelloCloud.io
HelloCloud.io
©2017 HelloCloud.io
Resource Providers > 60+
Source : https://www.terraform.io/docs/providers/index.html ©2017 HelloCloud.io
HelloCloud.io
Source : terraform.io HelloCloud.io
Use Terraform to manage Multi Clouds
HelloCloud.io
Q & A

HelloCloud.io - Introduction to IaC & Terraform