Terraform – Getting Started
DEPLOYING YOUR FIRST TERRAFORM CONFIGURATION
Ned Bellavance
MICROSOFT MVP, CLOUD AND DATACENTER MANAGEMENT
@ned1313 www.nedinthecloud.com
Overview
Automating infrastructure
What’s the scenario?
Terraform: “Hello world”
Automating Infrastructure Deployment
Provisioning Planning Using Source Reusing
Resources Updates Control Templates
The Scenario
DNS
Terraform Components
Terraform Executable Terraform File
variable "aws_access_key" {} Variables
variable "aws_secret_key" {}
provider "aws" { Provider
access_key = "access_key“
secret_key = “secret_key”
region = “us-east-1”
}
resource "aws_instance" "ex"{
Resource
ami = "ami-c58c1dd3"
instance_type = "t2.micro"
output "aws_public_ip" { Output
value =
"${aws_instance.ex.public_dns}"
}
Examine the Terraform file
Demo
Deploy the configuration
Review the results
Play along!
- AWS account
- Demo files
Some of the resources
deployed in AWS may cost
money. You’ve been
warned.
Key components of a Terraform file
Summary Deploying infrastructure
- Repeatable
- Consistent
Coming up
- Adding resources
- Planning updates
- Conquering the world?