🧐 About
This project is based on complete end-to-end automation using the clubbing of technologies - Ansible and Terraform. Main target is to deploy a webserver on EC2 instance, and make the architecture highly available using reliable AWS resources like s3 and CloudFront. Distinctly, this workflow has two parts - setting up the base architecture on AWS services and then deploying the webserver on this architecture.
Deployment of the project has been made by integration of two automation tools - Terraform (HCL) and Ansible.
The following architecture is setup using Terraform:-
- Key pair and security group created
- S3 created and uploaded an image into it, which makes the image highly available.
- CloudFront created using the S3 domain to reduce latency.
- Launched an EC2 instance.
- Created an EBS volume and attached it to the instance.
- Mounted the instance storage onto the EBS volume to ensure data availability.
Tasks carried out using Ansible are as follows:-
- Mounted the document root of HTTPD webserver (/var/www/html) onto the EBS storage.
- Installed and started the HTTPD webserver package.
- Configured the configuration file (customized document root) of httpd using jinja template.
- Copied the simple webpage to the document root directory.
- Restart httpd idempotently (only when there's a change in the conf. file)
🎈 Usage
The project can be utilised to setup a webserver on AWS with high availability using just a single command.
To get a complete insight of the working of the project, go through this article!
⛏️ Built Using
- RHEL-8 - Base OS
- AWS - Architecture setup
- Terraform - Infrastructure as a Code
- Ansible - Configuration management
✍️ Author
Saptarsi Roy - Do connect!