Featured image of post CI/CD Basic

CI/CD Basic

Deploying the System to AWS

Link github

Github: https://github.com/prindoll/CI-CD-basic

Deploying the System to AWS

Project Structure

Frontend

  • Uses ReactJs
  • Dockerfile builds an image based on Node20, exposes port 3000.

Backend

  • Uses Java Spring Boot to create API
  • Dockerfile builds an image running on Java OpenJDK, exposes port 8080.

Database

  • Uses Mongo:5.0 image, port 27017.

Automatically Create AWS Resources Using Prebuilt Terraform

Terraform Modules Structure

The modules directory contains the following submodules:

1
2
3
4
5
6
7
modules/
  bastion/
  database/
  ecs_cluster/
  load_balance/
  networking/
  security/

Each submodule is responsible for a specific part of the infrastructure:

  • bastion/: Bastion host configuration
  • database/: Database resources
  • ecs_cluster/: ECS cluster setup
  • load_balance/: Load balancer configuration
  • networking/: VPC, subnet, and networking resources
  • security/: Security groups and related settings

Resources Include

  • Networking, VPC, Subnet, Security Group.
  • Application Load Balancer, TargetGroup, Listener
  • ECS Cluster
  • ECS Service FE
  • ECS Service BE
  • Document DB - MongoEngine
  • SecretManager containing MongoDB username and password.

Commands to Create Resources

  • cd dev
  • terraform init
  • terraform plan --var-file terraform.tfvars
  • terraform apply --var-file terraform.tfvars

CICD Using Jenkins

  • Create Jenkins jobs in each frontend and backend folder
  • Configure Jenkins for automatic build
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy