This project is a proof of concept commissioned by a client to demonstrate the ability to build a scalable and secure infrastructure using Infrastructure as Code (IaC) practices on AWS/Azure and establish a robust DevOps pipeline for building and deploying a Java application. The project is divided into three main parts: creating a base Amazon Machine Image (AMI) using Packer, containerizing a Java application and implementing a CI/CD pipeline, and deploying the infrastructure using Terraform.
- Support multibranch pipeline
- Have Public, private and secure subnets.
- Have a Different Name for each docker image based on the commit branch and the commit ID for better discovery of the correct docker image.
The project is divided into three parts. Please refer to the links of the project for a more detail explanation.
| Part 1 | Part 2 | Part 3 |
|---|
Objective: Build a base AMI with the required software pre-installed.
Tools: Packer, AWS/Azure
Software to be Installed:
- CloudWatch Agent
- AWS SSM Agent
- Docker
- Git Client
Provisioning: Use shell script for provisioning.
CI Tool: Any CI tool of choice (e.g., Jenkins, GitHub Actions) to build the Packer pipeline.
Objective: Build and containerize a Java application, scan the code, and push the container to a repository.
Tools: GitLab, Azure DevOps, Jenkins, GitHub Actions, JFrog Artifactory, SonarCloud
Steps:
- Containerize the application using Docker.
- Implement a CI/CD pipeline to build the application and produce a container image.
- Scan the code and Docker files using SonarCloud.
- Push the container image to JFrog Artifactory.
Objective: Deploy a secure, scalable infrastructure.
Tools: Terraform, AWS/Azure
Infrastructure Components:
- VPC with Public, Private, and Secure subnets
- Load Balancer in Public Subnet
- Auto Scaling Group in Private Subnet
- RDS Cluster in Secure Subnet Best Practices:
- Store state in S3/Azure Blob with cross-region replication and encryption.
- Enable state locking using DynamoDB.
- Use the GitOps approach for Terraform to apply on merge to the main branch.



