- Launch an ec2 instance
- Create an s3 bucket
- Create an s3 backend state
- Create an IAM group and policy
- Add users to an IAM group
- Sign up for AWS Free Tier account if you do not already have one
- Log into your root AWS account
- Select Services > IAM
- On the left nav bar select 'Users'
- Select 'Add user'
- Create a username 'terraform-admin'
- Select AWS access type as Programmatic access (and AWS management console access to view resources on the dashboard)
- Select Next: Permissions
- Select Create group
- Add a group name 'admins'
- Check AdministratorsAccess and Create group, check group
- Select Next: Tags
- Select Next: Review
- Select Create User
- You will need the generated access key Id, and the secret access key (Download the csv provided or store these values)
- mac:
brew install awscli
|aws --version
- windows: instructions
- linux: instructions
aws credentials configured locally
these credentials are stored in ~/.aws/credentials
aws configure
AWS Access Key ID [None]: <access key>
AWS Secret Access Key [None]: <secret key>
Default region name [None]: us-east-1
Default output format [None]: json
- mac:
brew install terraform
|terraform -help
- windows:
choco install terraform
|terraform -help
- linux: download |
echo $PATH
|mv ~/Downloads/terraform /usr/local/bin/
|terraform -help
clone the repo and navigate to the directory
git clone https://github.com/ari-hacks/terraform-aws-automation.git
cd terraform-aws-automation
In the terminal cd
into one of the directories from the list above
Run these commands to provision with Terraform
#Initialize Terraform
terraform init
#Check the plan to make sure the configuration will do what we expect it to do
terraform plan
#Apply the execution plan and build the stack
terraform apply
#Check the resource is up
terraform state list
terraform state show 'type.name'
#Tear down all provisions
terraform destroy