ronaldcmde / aws-terraform-workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS Terraform Workshop

Examples about Infrastructure as Code, using Terraform and AWS

Sample application: Hello From

Infrastructure diagram

Getting Started

Set up your local environment

pip install awscli
  • Configure AWS CLI with your AWS credentials
aws configure
  • Clone this repository
  • (Optional) install and use Landscape

State 1

Features

  • An EC2 instance
  • A security group
  • User data
  • Local tfstate

Concepts ✏️

  • HCL
  • Provider
  • Resource
  • State
  • Init
  • Plan
  • Apply
  • Destroy

State 2

Features

  • Remote backend 😁
  • Variables
  • Outputs

Concepts ✏️

  • Variables
  • Outputs
  • Count
terraform plan -var 'vpc_id=vpc-953f78ee' -var 'app_port=5000' -var 'instance_type=t2.micro' -var 'subnet_id=subnet-b1455dec' -var 'key_name=aws-terraform-workshop'
terraform plan -var 'vpc_id=vpc-953f78ee' -var 'app_port=5000' -var 'instance_type=t2.micro' -var 'subnet_id=subnet-b1455dec' -var 'key_name=aws-terraform-workshop' -var 'instances=2'

State 3

Features

  • A launch configuration
  • An autoscaling group
  • An ELB

This is the definitive infrastructure

Concepts ✏️

  • Variables file
  • Lists
terraform plan -var-file=myvars.tfvars

State 4

Features

  • "Environments"

Concepts ✏️

  • Modules
  • ifs (interpolation)

About


Languages

Language:HCL 95.3%Language:Shell 4.7%