This repository contains the Terraform (IaC) configuration for deploying an AWS infrastructure for two distinct ECS Fargate services.
Each service has its own CodePipeline pipeline and implements a Blue/Green deployment strategy.
The services utilize AWS Secrets Manager for credentials and DynamoDB as the database solution.
This challenge was proposed by the Development Team of Altostratus Cloud Consulting.
- API Service
- Authentication Service
Each service has its pipeline configuration allowing for continuous integration and deployment via AWS CodePipeline, integrating with GitHub for source control.
- ECS Fargate: Runs the services in a serverless Fargate cluster.
- CodePipeline: Orchestrates the CI/CD process for each service.
- CodeBuild: Builds Docker images and pushes them to ECR.
- CodeDeploy: Handles the deployment using a blue/green strategy.
- Application Load Balancer: Balances and routes traffic to the correct ECS services.
- DynamoDB: Serves as the database for the services.
- Secrets Manager: Secrets gets pulled from here by the ECS services.
- ECR: Stores Docker images.
- CloudWatch: Monitors and logs the services.
- IAM Roles and Policies: Ensures correct permissions for all services and tasks.
- AWS Account
terraform
installed- Configured AWS CLI (Or properly set environment variables, see
.env.example
) - GitHub repository for source code (see: poner mis repos aqui)
- Clone the Repository: Start by cloning this repository to your local machine or cloud environment.
git clone https://github.com/HakimHC/altostratus-golang-iac.git cd altostratus-golang-iac
- Initialize Terraform:
terraform init
- Apply the Terraform Configuration:
Approve the plan when prompted to start the deployment.
terraform apply
After applying the configuration, you must approve the pending connection created by the Terraform config.
For this, you must go to the Developer Tools
section in the AWS console and do the following:
Click on update pending connection and follow the instructions to configure the app on you profile.
The Terraform configuration is modular, and settings can be adjusted in the variables.tf
file. Ensure all configurations, such as project and repository names, AWS regions, and resource specifics, align with your AWS setup.
I want to thank the Altostratus team for all of the resources provided in the bootcamp and for making this possible. Thank you.