Note: based on An Introduction to Terraform
- AWS account how to set it up
- AWS user with an access key and permission to create resources in EC2 how to set it up
- Installed aws-cli how to install
- Configured aws credentials aws configure
Note: This example deploys resources into your AWS account. They should fall under the AWS Free Tier but beware ;)
- Install Terraform. (If you're using brew try:
brew install terraform
) cd
into terraform-demo folder.- Create a vars.tf file based on vars.tf.example
- Run
terraform plan
. - If the plan looks ok, run
terraform apply
.
Note: Based on https://github.com/tuppa/flask
pip install ansible
cd
into ansible folder.- Create an inventory file called demo based on demo.example
- Execute
ANSIBLE_SSH_PIPELINING=1 ansible-playbook -i demo demo.yml
ALL DONE! :) now you can open {public_ip from terraform output} in your browser and get a hello from your aws flask app running on your aws instance