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.
- 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
- 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
- Push this repo to GitHub.
- Create Jenkins pipeline job pointing to repo (use
jenkins/Jenkinsfile). - Add Jenkins credentials (AWS access/secret or use instance role).
- In Jenkins, ensure build agent has Docker, AWS CLI, Terraform installed.
- On first run you can manually create ECR repos or let Jenkins create them.
- Run Jenkins job (it will build images, push to ECR, then run
terraform apply). - After terraform completes, check outputs for App Runner URLs.
- Confirm SNS email (if set) by clicking confirmation sent to email.
- Test:
GET <blog-service-url>/healthPOST <blog-service-url>/postwith JSON payload{"title":"Hi","body":"Hello world"}GET <blog-service-url>/poststo see stored items.
- Terraform uses
image_tagpassed 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 destroyinterraform/when done, and delete ECR repos if needed.
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