Skip to content

siyashaha24/CCD-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Blog Microservices (CI/CD → App Runner) - Quickstart

Overview

Three microservices:

  • blog-service (stores posts in DynamoDB, calls sentiment & notify services)
  • sentiment-service (calls AWS Comprehend)
  • notify-service (publishes to SNS)

CI/CD: Jenkins pipeline builds Docker images, pushes to ECR, runs Terraform to deploy App Runner services.

Pre-requisites

  • AWS Account
  • AWS CLI configured on Jenkins agent (or Jenkins running on EC2 with IAM role)
  • Docker available on Jenkins build agent
  • Terraform installed on Jenkins agent (or in pipeline)
  • Jenkins with Git plugin & pipeline support
  • (Optional) SonarQube + Sonar Scanner configured in Jenkins

Set variables

  • AWS account id (numeric) — used by Jenkinsfile and Terraform
  • AWS region (default in code: us-east-1)
  • SNS email (for notifications) — set in terraform/variables.tf or pass as var

Quick steps

  1. Push this repo to GitHub.
  2. Create Jenkins pipeline job pointing to repo (use jenkins/Jenkinsfile).
  3. Add Jenkins credentials (AWS access/secret or use instance role).
  4. In Jenkins, ensure build agent has Docker, AWS CLI, Terraform installed.
  5. On first run you can manually create ECR repos or let Jenkins create them.
  6. Run Jenkins job (it will build images, push to ECR, then run terraform apply).
  7. After terraform completes, check outputs for App Runner URLs.
  8. Confirm SNS email (if set) by clicking confirmation sent to email.
  9. Test:
    • GET <blog-service-url>/health
    • POST <blog-service-url>/post with JSON payload {"title":"Hi","body":"Hello world"}
    • GET <blog-service-url>/posts to see stored items.

Notes

  • Terraform uses image_tag passed by Jenkins (BUILD_NUMBER) — thus each pipeline run deploys the new tag.
  • App Runner needs permission to access DynamoDB, SNS, Comprehend. Terraform attaches a role/policy accordingly.
  • To avoid charges: terraform destroy in terraform/ when done, and delete ECR repos if needed.

Cleanup

cd terraform
terraform destroy -var="aws_region=us-east-1" -var="aws_account_id=<ACCOUNT_ID>" -var="image_tag=<tag>"
# Delete ECR repos if needed:
aws ecr delete-repository --repository-name blog-svc --force
aws ecr delete-repository --repository-name senti-svc --force
aws ecr delete-repository --repository-name notify-svc --force

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published