Demonstration of requirements understanding, proposing a solution and implementation of Infrastructure as a Code by using the latest tools and techniques.
- What is this repository for
- Problem Statement
- Proposed Solution
- Assumptions
- Deliverable Content
- Development Cycle
- Developer Setup
- Configuration
- Pre-reqs
- Deployments
- Contribute
- Screenshots
- A terraform project to solve the task for tecAlliance
- Demonstrates infrastructure architecture for AWS Cloud
- CI/CD implementation using Github Actions in repo
- The live environment will be established on AWS.
- As per the provided instructions, I would like to use terraform for the infrastructure provisioning.
- A custom VPC along with public and private subnests will be created.
- As demanded, a
MySQL
RDS Instance will be prepared for persistence. - Backend EC2 will be hosted in one of the private subnets.
- The Frontend required multiple instances, so an Auto Scalling Group with the provided configs might be a good solution.
- For testing, a bastion host will be provisioned, which will have necessary access to lookup inside the private resources.
- Frontends will be connected to an Application Load Balancer.
- Frontend and Backend instances should include some script for bootstraping / initial configurations.
- Terraform should use necessary features for security and reusability of code.
- A ci/cd pipeline should be inplaced for mocking the whole flow in repository.
- Resources should be used as modules. (Will keep in same repo)
- The project should be prepared in a way to easily scale for a multi environment deployments with minimal changes.
- ALB endpoint should be shown as an output.
- Frontends and Backend wont have any applications to serve the requests.
- Some health check servers will started i.e nginx,
- This task is to demonstrate the infrastructure best practices.
- There won't be a requirements to keep this system up for a long time, instead, some screenshot can be provided for validation.
- Provision of resources to setup a Bastion host will be conditional.
- Due to unavailability of SSL/TLS Certificate, ALB could not be tested on https port:443, but the code will be provided
├── .github
│ └── workflows
│ └── terraform.yml
├── .gitignore
├── README.md
├── blueprint
│ ├── backend.tf
│ ├── main.tf
│ ├── modules
│ │ ├── backend
│ │ │ ├── main.tf
│ │ │ ├── outputs.tf
│ │ │ └── variables.tf
│ │ ├── bastion
│ │ │ ├── main.tf
│ │ │ ├── outputs.tf
│ │ │ └── variables.tf
│ │ ├── database
│ │ │ ├── main.tf
│ │ │ ├── outputs.tf
│ │ │ └── variables.tf
│ │ ├── frontend
│ │ │ ├── main.tf
│ │ │ └── variables.tf
│ │ ├── load_balancer
│ │ │ ├── main.tf
│ │ │ ├── outputs.tf
│ │ │ └── variables.tf
│ │ ├── network
│ │ │ ├── main.tf
│ │ │ ├── outputs.tf
│ │ │ └── variables.tf
│ │ └── security_groups
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── outputs.tf
│ └── variables.tf
├── envs
│ └── dev
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
└── scripts
├── init_backend_server.sh
├── init_bastion_host.sh
└── init_frontend_server.sh
- Distributes the whole development into Small tasks
- Each Issue shows a feature
- Each commit shows a small progress
- Pull Requests are done for major tasks
- Pipelines Each commit is built by CI/CD Pipeline
To setup the project locally you need to clone this repo, from main
branch or some latest TAG
cd to envs/dev
# cd to `envs/dev` and initialize the project
$ terraform init
# to Validate
$ terraform validate
# to plan
$ terraform plan
# Apply the changes to aws cloud
$ terraform apply
# Cleanup
$ terraform destroy
- Terraform should be installed
⚠️ AWS Credentials should be setup as defualt profile of local machine
- terrafom (used
Terraform v1.4.3-dev
) - aws credentials
- VS Code
- When a
pull request
is merged inmain
,Github Action
starts and following steps are done by automated CI/CD:- Makes a deployment to AWS (Mock)
- Forks are always appreciated