Examples about Infrastructure as Code, using Terraform and AWS
Sample application: Hello From
- Install Terraform
- Install AWS CLI. If you have Pip, just run
pip install awscli
- Configure AWS CLI with your AWS credentials
aws configure
- Clone this repository
- (Optional) install and use Landscape
- An EC2 instance
- A security group
- User data
- Local tfstate
- HCL
- Provider
- Resource
- State
- Init
- Plan
- Apply
- Destroy
- Remote backend 😁
- Variables
- Outputs
- 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'
- A launch configuration
- An autoscaling group
- An ELB
This is the definitive infrastructure
- Variables file
- Lists
terraform plan -var-file=myvars.tfvars
- "Environments"
- Modules
- ifs (interpolation)