2016 - ignite - terraform to go from zero to prod in less than 1 month and then

20
From Zero to Prod in less than a Month and then… Satish Kumar Cloud Architect, Kasasa

Upload: devopsdaysaustin

Post on 16-Feb-2017

134 views

Category:

Software


0 download

TRANSCRIPT

Page 1: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

From Zero to Prod in less than a Month and then…

Satish KumarCloud Architect, Kasasa

Page 2: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN
Page 3: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN
Page 4: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

CLOUD FORMER

CLOUD FORMATION

Page 5: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

TERRAFORMING

Page 6: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN
Page 7: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

HASHICORP CONFIGURATION LANGUAGE a.k.a HCL

resource "aws_s3_bucket" "example" { bucket = "kasasa-satish-devopsdays-example"}

kasasa-satish-devopsdays-example

Page 8: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

PLAN:terraform plan –out demo.tfplan

INTENT

Page 9: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

PLAN:terraform plan –out demo.tfplan

INTENT

APPLY

PROGRESS

terraform.tfstate

RESULT

Page 10: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

terraform planterraform applyterraform refresh

resources

terraform.tfstate

*.tf

Page 11: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

Change resources

Destroy resources

Page 12: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

Image courtesy of Zurich, U.S.

Page 13: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN
Page 14: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

Error Reading Local State

Page 15: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

terraform.tfstate

Remote state

S3/Atlas/etcd/Consul

Page 16: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

variable “bucket_name” { default = "kasasa-satish-devopsdays-example”}

variable “env” {}

env = “prod”

Resource “aws_s3_bucket” “example” { bucket = ”${var.bucket_name}-${var.env}”}

Page 17: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN
Page 18: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN
Page 19: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

Remote state

Page 20: 2016 - IGNITE - Terraform to go from Zero to Prod in less than 1 month and THEN

Courtesty of charity.wtf