Deploy Springboot-based Demo Java-App to AWS (AutoScaling, Elastic Load Balancer, RDS) via AWS CLI script and demonstrate "reactive scaling" via CloudWatch Alarms.
Demonstrates what can be done, not that it shall be done this way...
- Understand every single line in ec2/launch_aws_env.sh
- Adjust ec2/launch_aws_env.sh (e.g. choose unique S3 bucket name, ...)
- Ensure all dependencies are installed & configured (AWS CLI, AWS access- & secret key, AWS region, jq, ...)
- mvn clean install
- . ./ec2/launch_aws_env.sh
- Wait for script completion (and browse the Amazon Web Services Console in meanwhile: RDS, EC2, S3, CloudWatch, ...)
- Check for errors. There should be none. Otherwise, "cleanup the mess" (delete all $/h AWS resources)
- Expect answers from 2 web servers (try multiple times): curl http://$LB_DNS
- curl http://$LB_DNS?cmd=sleep&time=1000
- Generate some load (a few HTTP GETs every now and then). Wait for up-scaling
- Expect answers from 3 web servers (try multiple times): curl http://$LB_DNS
- curl http://$LB_DNS?cmd=sleep&time=50
- Generate some load (a few HTTP GETs every now and then). Wait for 2x down-scaling
- Expect answers from 1 web server (try multiple times): curl http://$LB_DNS
- Cleanup the mess manually in the AWS Console: delete AWS RDS, AutoScaling Group, Load Balancer, SGs, Keys, S3, Bucket, etc (delete all $/h AWS resources)
Works on my homebrew-powered OSX machine. Ask Google ;-) or browse the AWS docs...