Scripts to automate ECS fargate and create a cluster/service/task and run a publicly exposed web server in a container.
Create a new cluster and start the site in a container:
./cluster_up.sh
./start.sh
Stop the container and tear down the cluster:
./stop.sh
./cluster_down.sh
Use this command to grab the latest task-id:
ecs-cli compose --project-name richandersonio-web service ps --cluster-config richandersonio-web --ecs-profile richandersonio-web-profile
ecs-cli logs --task-id {insert-task-id} --follow --cluster-config tutorial --ecs-profile tutorial-profile
The ecs-params.yml is configured to use an existing VPC + two subnets. Don't forget to update these if they ever change.
Don't forget to install the AWS ECS CLI: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.html
Another useful guide I used: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-up.html