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.

Before running any CloudFormation deployment for GSM Infrastructure, make sure every item on this page is in place. The stacks build on top of existing AWS resources and GitHub configuration — skipping any prerequisite will cause the deployment to fail mid-way and leave partial resources behind.

AWS account requirements

All GSM Infrastructure stacks deploy into the us-east-1 region. Your AWS account must already contain:
  • An existing VPC whose ID you will supply as the VpcId parameter
  • A private subnet inside that VPC (PrivateSubnet1Id) in at least one Availability Zone — the ECS EC2 instance is launched into this subnet
  • Sufficient IAM permissions to create stacks with CAPABILITY_IAM and CAPABILITY_NAMED_IAM (the base stack provisions the executor role that handles all subsequent deployments)

Required tools

ToolPurpose
AWS CLI v2Deploy the base stack manually before GitHub Actions can take over
AWS Console or CloudFormation CLIInspect stack events, outputs, and drift
GitHub ActionsAutomated deployment; runners use ubuntu-latest
The ongoing infrastructure and scheduler stacks are deployed exclusively via GitHub Actions once the base stack is in place. You only need the AWS CLI for the one-time base stack setup.

EC2 key pair

The infrastructure stack launches an ECS-optimized EC2 instance. A pre-existing EC2 key pair must exist in us-east-1 before deploying. Its name is passed via the Ec2PenKeyName parameter (default: dev-key-ec2). Set the KEYPEM_EC2_NAME GitHub repository variable to match the exact name of your key pair in AWS.

SSM Parameter Store values

These two SSM parameters must exist in Parameter Store before the infrastructure stack is deployed. The ECS task definitions reference them directly via ValueFrom — if either parameter is missing, all container startups will fail and the deploy will roll back.
Create the following parameters under your target environment prefix (replace {env} with dev, qa, or prod):
Parameter pathDescriptionWorkflow variable
{env}/backend/DB_MASTER_URLFull database connection string for the SQL Server master databaseDB_MASTER_URL_PARAM
{env}/backend/JWT_SECRETSecret key used to sign and verify JWT tokensJWT_SECRET_PARAM
Use the SecureString type and encrypt with the default AWS-managed KMS key so the ECS execution role can decrypt them at task startup.

GitHub repository variables

The GitHub Actions workflows are driven entirely by repository-level (and environment-level) variables. None of the values below are hardcoded in the workflow YAML files.

Workflow feature flags

WORKFLOW_INFRASTRUCTURE_ENABLED and WORKFLOW_SCHEDULER_ENABLED act as feature flags. Both jobs check these values at the very start — the entire workflow is skipped unless the value is the string 'true'. Set them to 'false' to pause deployments without removing the workflow file.
VariableTypeDescription
WORKFLOW_INFRASTRUCTURE_ENABLED'true' | 'false'Enables or disables the infrastructure deploy workflow
WORKFLOW_SCHEDULER_ENABLED'true' | 'false'Enables or disables the scheduler deploy workflow

Application

VariableExampleDescription
APP_NAMEgsmapplicationApplication name prefix used in every CloudFormation resource name

Budget and alerting

VariableExampleDescription
BUDGET_LIMIT30Monthly USD spend limit; triggers an SNS alert at 100%
ALERT_EMAILops@example.comEmail address that receives budget overage notifications

CloudFront / EC2 authentication

VariableExampleDescription
CLOUDFRONT_HEADERmy-secret-header-valueCustom X-CloudFront-Origin header value sent by CloudFront to the EC2 origin; the backend validates this to reject direct traffic

ECS task sizing

VariableExampleDescription
TASK_NUMBER_DESIRED1Desired number of running ECS tasks per service; set to 0 to pause all services
TASK_MEMORY512Hard memory limit per ECS container (MB)
TASK_MEMORY_RESERVATION384Soft memory reservation per ECS container (MB)

Database connectivity

VariableExampleDescription
PORT_DB1433TCP port for the SQL Server database
DB_MASTER_URL_PARAMdev/backend/DB_MASTER_URLSSM parameter path for the DB connection URL
DB_MASTER_IP10.0.0.5/32CIDR block of the database provider, used in the EC2 security group egress rule

JWT

VariableExampleDescription
JWT_SECRET_PARAMdev/backend/JWT_SECRETSSM parameter path for the JWT signing secret

Networking

VariableExampleDescription
VPC_IDvpc-0abc123defID of the existing VPC
VPC_ID_CIDR_BLOCK10.0.0.0/16CIDR block of the VPC; used in security group ingress rules
PRIVATE_SUBNET_ID_1subnet-0abc123defID of the private subnet for the EC2 instance

EC2

VariableExampleDescription
KEYPEM_EC2_NAMEdev-key-ec2Name of the existing EC2 key pair
EC2_INSTANCE_TYPEt4g.mediumEC2 instance type (must be ARM64-compatible — the AMI is amazon-linux-2023/arm64)
DNS_EC2_ELASTIC_IP52.1.2.3DNS name or IP of an existing Elastic IP to attach; leave empty to allocate a new EIP automatically

GitHub repository secrets

SecretDescription
AWS_INFRA_ROLE_ARNARN of the InfraExecutorRole created by the base stack. Both workflows use this ARN to assume the role via GitHub OIDC — no long-lived AWS credentials are stored.
Retrieve the ARN from the InfraRoleArn output of the base CloudFormation stack and add it as a repository secret under Settings → Secrets and variables → Actions → Secrets.

GitHub environments

The workflows use the GitHub environment named infra-{env} to scope secrets, protection rules, and variable overrides per environment. Create the following three environments in GitHub Settings → Environments before the first workflow run:
Environment nameMaps to AWS environment
infra-devdev (deployed from develop branch)
infra-qaqa (deployed from quality branch)
infra-prodprod (deployed from main branch)
Each environment can carry its own copy of AWS_INFRA_ROLE_ARN and any variable overrides (for example, a higher BUDGET_LIMIT for production). Protection rules such as required reviewers are strongly recommended for infra-prod.

Build docs developers (and LLMs) love