Infrastructure as a Code
- Install Terraform https://www.terraform.io/
- AWS Account https://aws.amazon.com
- ACloudGuru account/subscription http://acloud.guru/
In production environment a simple mistake could wreck your production environment especially when you're still trying out Terraform.
Setup a AWS Organization on top of your current account for testing purpose. This is a lot easier
I am using "AWS Organization" for Terraform testing, and I created a special user called rix@terraform
with a policy of SystemAdministrator
.
Each directory is independent from other directory. They maintain their own state
-
Go to a folder
$> cd ./chapter-8-vpc-part-1
-
On initialise your Terraform project
$> terraform init
-
Run "plan" and generate your
.tfstate
file$> terraform plan -var aws_profile="<your aws profile>" -out vpc-plan.tfstate
-
Apply the current Terraform plan
$> terraform apply -var aws_profile="<your aws profile>"
TBA
- VPC
- Internet Gateway
- 2 Route Tables
- Private and Public Subnet
- 2 EC2 assigned to public and private subnet
- Remote provisioner for inline Bash command eg. install Apache
- Setup a customise policy file for each chapter/example, rather than using
SystemAdministrator
- Add more chapter
- Provision VPC on Terraform https://github.com/devops-recipes/prov_aws_vpc_terraform
- Amazon Linux AMI https://aws.amazon.com/amazon-linux-ami/