Requirements
- Terraform installed
- Docker installed
- AWS cli setup
Limitations
- Currently this is set to deploy to eu-west2 (London)
- There is hard set configurations to only allow one service to be configured
- The ECS cluster is deployed to the default VPC
- It allows for all traffic !!!! DO NOT RUN THIS FOR EXTENTED PERIODS OF TIME
First setup a aws image registry using
<project root>/.deployECR.sh
This should give you a registry URL needed for the next command below The run
<project root>/buildAndDeploy.sh <ECR registry URL>
The buildAndDeploy script will
- Install dependencies locally
- Dockerise it to an image
- Push to a the aws ECR
- Deploy and ECS cluster
- Deploy the image to a container running in the ECS cluster
- Create a ./destroy.sh
- The ECS cluster is made of EC2 t3.micro instances, As this is in the default VPC it is publically accessable, you should be able to do the curls below on an EC2 instance
To do a tear down run ./destroy
The application is a nodejs express app
curl <host>:7070/data
Will retrieve all data of IP to data posted below
curl -X POST <host>:7070/data -d home
Will assosaite the data payload with the IP