The script (infrastructure-as-code) to deploy a secured and high-availablity web application stored in AWS S3 and deployed in Apache Web Server.
- There are two availability zones each of which separate into private and public subnet.
- A Load balancer to Application servers with auto-scaling capability.
- Application server instance specification: 2vCPUs, 4GB RAM, 10GB disk.
- Application servers are secured in a private subnet and only accepts traffic from bastion host and load balancer.
- bastion hosts and load balancers are in public subnets.
- load balancer accepts http request on port 80
- Application servers can access internet via NAT gateway for critical OS updates and patches.
- Bastion host in each availability zone can SSH access to instances of application servers for debugging and trouble shooting.
- Application servers use Ubuntu machine images.
- Applcation code is stored in S3 bucket with IAM permissions.
- Applcation servers are configured with IAM instance profile to enable access to AWS S3 bucket.
- Health checks and thresholds are defined to check system availability.
- The script is to automate the process of creating, updating, deleting the whole environment in a predicted manner and short period of time.
- Create a Key Pair in AWS EC2 for application server access.
- Create a Key pair for Bastion host.
- Make appropriate change to file servers_parameters.json
- Clone the git repository
- Create infra stack first by running:
./create_stack.sh infra infra.yml infra_parameters.json
- Check the status of infra stack, and if infrastructrue is completed, create servers stack by running:
./create_stack.sh servers servers.yml servers_parameters.json
- Check the status of servers stack. Access load balancer dns name in the output of the servers stack. You shoud your web app deploy successfully.