This repo serves as an example on how to provision infrastructure for distrubuted services. To keep it simple, i have written a simple microservice which exposed its API endpoints to uploads and retrives dummy files on AWS EC2 using packer, ansible, terraform.
Main objective of this repo is to see tools such as packer, ansible, terraform in action and how they complement each other.
- AWS CLI.
- AWS resource access. configured by "aws configure" with access key id and secret key.
- Ansible installed
- Terraform installed.
- packer installed.
- make init #This will create required SSH keys
- make packer-build #this will create AMI with required packages. ami-id will be written to terroform directory.
- make terrform-apply # this will provision and deploy the service to ec2.
- Use "http://{elb-dns}/uploader" to upload file
- Use "http://{elb-dns}/get?file=filename" to retrive file
- make terrform-destroy # this will de-provision the resources.