CI CD - adelinaenache/MenuMaker GitHub Wiki
MenuMaker Infrastructure
The MenuMaker backend server is hosted on AWS (Account: 608961235058
) in the eu-north-1
region, utilizing ECS with Fargate for container orchestration.
API Endpoints
- Staging API Endpoint: http://is-staging-lb-952812736.eu-north-1.elb.amazonaws.com/
- Production API Endpoint: http://is-production-lb-2078088807.eu-north-1.elb.amazonaws.com/
ECS Clusters
Each environment (staging and production) is managed in a separate ECS cluster:
- Staging Cluster: is-staging
- Production Cluster: is-production
Container Registry
The backend application is built into a Docker container and pushed to AWS Elastic Container Registry (ECR). While local pushes are possible, they are not recommended.
- Staging Container Registry: public.ecr.aws/j8q5s3a5/is/staging
- Production Container Registry: [public.ecr.aws/j8q5s3a5/is/production-backend]https://eu-north-1.console.aws.amazon.com/ecr/repositories/public/105014798579/is/production-backend?region=eu-north-1)
Task Definitions
Each service has a corresponding task definition where environment variables, container mappings, and registry details are configured:
- Staging Task Definition: staging-backend
- Production Task Definition: production-backend
The task configurations are also in the .aws
service.
Environment Variables
Environment variables are stored and managed in AWS Secrets Manager as key-value pairs. When adding a new secret, ensure it is referenced in the task definition for the respective environment.
- Staging Secrets: is-staging-backend
- Production Secrets: is-prod-backend
Logging
Logs are available in CloudWatch and can also be accessed through the ECS Service Logs tab.
- Staging Logs: CloudWatch Logs - Staging
- Production Logs: CloudWatch Logs - Production
Services
ECS services manage the scaling of backend containers. Currently, each service is configured to maintain one running task, with the ability to scale based on traffic in the future. To deploy the latest version of the backend, update the service with the latest task definition revision.
Load Balancer
An Application Load Balancer (ALB) is used to route traffic to the backend containers, which have dynamic IPs. The ALB also performs health checks on the /health
API endpoint.
- Staging Load Balancer: is-staging-lb-952812736.eu-north-1.elb.amazonaws.com
- Production Load Balancer: is-production-lb-2078088807.eu-north-1.elb.amazonaws.com
Frontend
The frontend is deployed on Vercel
.
- production: menu-maker-h5d5.vercel.app Each new PR generates a new preview.
CI/CD
Frontend
The frontend is updated every time a push is made on master. The deployments can be seen here, on Vercel: https://vercel.com/enacheadelina99s-projects/menu-maker-h5d5/deployments
Environment Variables and Secrets Management
Environment variables and secrets are configured and managed within the Settings > Actions section for each environment.
Authentication
Authentication is handled using an AWS OIDC (OpenID Connect) provider linked to our GitHub account, ensuring secure access to AWS resources.
Branch Deployment Strategy
- The
main
branch is configured to deploy the backend to the is-production environment. - The
dev
branch is configured to deploy the backend to the is-staging environment.
Deployments
The deployment process follows these steps using github actions:
- Build: Docker images are built and pushed to AWS ECR Public
- Task Definition: The ECS task definition is updated with the new image
- Deployment: The updated task definition is deployed to the ECS cluster
- Validation: The service stability is monitored automatically
The backend deployments can be seen here.