Deploying a web application on AWS-EC2
Tools and Technologies
Category | AWS Services & Technologies |
---|---|
Web Application | Java, MySQL, Hibernate ORM,Shell Scripts, AWS-SDK |
Infrastructure | VPC, ELB, RDS, Lambda, DynamoDB, Route53, Terraform |
Metrics & Logging Service | statsD, AWS Cloud-Watch, Log4js, Cloud-Watch Alarm |
Lambda & Notification Mechanism | Lambda,SNS, SES |
CI/CD Pipeline | Circle CI, AWS Code Deploy, Packer |
Security | SSL/TLS , RDS Encryption |
- created custom VPC with network setup using Terraform Script
- Attached Load balancers, auto scaling groups, SES and SNS services
- Created necessary service roles and policies for AWS resources
- Implemented Lambda function for emailing service
- Automated AMI creation using Hashicorp packer
- Created AMI template to share the image between multiple AWS accounts
- Created golden images by adding provisioners to boostrap instances with - JDK, Code deploy and Cloud watch agent
- Integrated Github repository with Circle-CI for continuous Integration
- Bootstrapped circle CI container with docker image to run the test cases and generate new code artifact
- Artifact is copied to S3 bucket and code deployement is triggered on running instances of autoscaling group
- In-Place deployment configuration hooks are placed for routing the traffic during deployment
- Embedded statD to collect various metrics such as counter for APIs hits and API response time etc
- Logged the info, errors and warnings using log4js and further mounted them in AWS cloud-watch for analysis
- Implemented CPU Utilization based alarms for changing number of instances in auto scaling group
- Implemented pub/sub mechanism with SNS and Lambda function
- when user requesting for password reset, message is published on SNS Topic
- Once message is published to SNS Topic, subscribed lambda function is trigged
- Lambda delivers password reset link email to requesting user and saves the entry in Dynamo DB with TTL of 15 minutes
API Impementation with Spring Boot and Hibernate ORM
Programming language : Java
External Libraries used:
- UUID - for generating tokens
- Bcrypt - for hashing out the passwords
- basic-auth - Authentication module
- Hibernate - ORM for Java
- mysql - dialect for hibernate
- mockito - for integration testing in java
- The application runs on AWS Cloud EC2 instance and is deployed via CircleCI pipe-line
- As soon as there is a merge take place to the webapp repository, the build gets triggered and deployment takes place in AWS account
- Load testing is done by JMeter, download JMeter from offical website and run the jmx script
- Script is available in webapp folder