Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ti-infinite/GSMInfrastructure/llms.txt

Use this file to discover all available pages before exploring further.

GSM Infrastructure runs four microservices as ECS tasks on a single EC2 instance using the bridge network mode. All services are defined as ECS Task Definitions inside devops/infrastructure/template.yml and registered to a shared ECS cluster ({env}-{appName}-cluster). Container images are pulled from a private ECR repository ({env}-{appName}-respository) that is also created by the same CloudFormation stack. Each service has its own task family, port mapping, health check, and set of SSM-sourced secrets — but all share the same memory parameters (TaskMemory / TaskMemoryReservation), 256 CPU units, and a consistent deployment configuration with circuit-breaker rollback enabled.
TaskNumberDesired defaults to 0 — all four services start with zero running tasks. After the initial stack deployment you must update this parameter (or manually set the desired count in the ECS console) to actually run the services.

Shared Configuration

The following settings apply to every service unless noted otherwise in the per-service sections below.
SettingValue
Launch typeEC2
Network modebridge
CPU units256
Memory (hard limit)TaskMemory parameter (default: 512 MB)
Memory reservation (soft)TaskMemoryReservation parameter (default: 384 MB)
Health check interval30 s
Health check timeout10 s
Health check retries3
Health check start period120 s
HealthCheckGracePeriodSeconds60
MaximumPercent100
MinimumHealthyPercent0
Deployment circuit breakerEnabled, with rollback
Log driverawslogs/ecs/{env}-{appName}-backend (7-day retention)
HealthCheckGracePeriodSeconds: 60 gives containers time to complete their startup sequence before ECS begins evaluating health check results. Without this buffer, ECS may replace healthy containers that are simply slow to start.

Gateway Service

The gateway service is the public-facing entry point for all API traffic. CloudFront routes /api/* requests to the EC2 instance on port 80, which is bound directly to this container.
PropertyValue
Container namegsmgateway
Task family{env}-{appName}-gateway-task
ECS service name{env}-{appName}-gateway-service
ECR image taggateway-latest
Image URI{ecr-repo}:gateway-latest

Auth Service

The auth service handles authentication and token issuance. It is reachable from other containers via the Docker bridge network on port 8081.
PropertyValue
Container namegmsauth
Task family{env}-{appName}-auth-task
ECS service name{env}-{appName}-auth-service
ECR image tagauth-latest
Image URI{ecr-repo}:auth-latest

Application Service

The application service implements core business logic. It listens on port 8082 and is accessible to other containers through the Docker bridge.
PropertyValue
Container namegsmapplication
Task family{env}-{appName}-application-task
ECS service name{env}-{appName}-application-service
ECR image tagapplication-latest
Image URI{ecr-repo}:application-latest

Operations Service

The operations service handles administrative and operational workflows. It listens on port 8083 and shares the same secret profile as the auth and application services.
PropertyValue
Container namegsmoperations
Task family{env}-{appName}-operations-task
ECS service name{env}-{appName}-operations-service
ECR image taggsmoperations-latest
Image URI{ecr-repo}:gsmoperations-latest

Pushing Images to ECR

Before ECS can pull a container image, you must authenticate Docker to the ECR registry, tag your local image with the repository URI, and push it. The ECR repository name follows the pattern {env}-{appName}-respository (e.g. dev-gsmapplication-respository).
# Authenticate Docker to ECR
aws ecr get-login-password --region us-east-1 | \
  docker login --username AWS --password-stdin \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com

# Tag and push gateway image
docker tag my-gateway:latest \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:gateway-latest
docker push \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:gateway-latest

# Tag and push auth image
docker tag my-auth:latest \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:auth-latest
docker push \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:auth-latest

# Tag and push application image
docker tag my-application:latest \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:application-latest
docker push \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:application-latest

# Tag and push operations image
docker tag my-operations:latest \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:gsmoperations-latest
docker push \
  <account-id>.dkr.ecr.us-east-1.amazonaws.com/dev-gsmapplication-respository:gsmoperations-latest
After pushing a new image, force a new ECS deployment to pick it up:
aws ecs update-service \
  --cluster dev-gsmapplication-cluster \
  --service dev-gsmapplication-gateway-service \
  --force-new-deployment \
  --region us-east-1

Build docs developers (and LLMs) love