Skip to content

Deployment

Dev Singh edited this page Aug 27, 2025 · 2 revisions

The system supports two environments:

  1. QA (acmqa) - For testing, development, and QA tasks.
  2. Production (acmprod) - For live usage

Deployment Prerequisites

Before deploying, ensure:

  1. You have the AWS CLI installed, with a profile configured with appropriate permissions
  2. You're authenticated to the correct AWS account
  3. All changes are committed to Git
  4. Local tests pass

AWS Authentication

Before deployment, authenticate to AWS using SSO:

aws configure sso

When prompted:

  • SSO URL: https://acmillinois.awsapps.com/start/#
  • SSO Region: us-east-1
  • Select appropriate account (acmqa or acmprod)

Verify authentication:

aws sts get-caller-identity

Export the profile:

export AWS_PROFILE=<PROFILE RETURNED BY AWS CLI>

Building the Application

  1. Clean previous builds:
make clean
  1. Build the Lambda functions and frontend:
make build

This creates deployment packages in the dist/ and dist_ui/ directories.

Deploying to AWS

Only those with InfraSuperuserAccess can deploy to AWS. Infra developers must create a branch on GitHub and create a Pull Request.

Development Environment

To deploy to the development environment:

make deploy_dev

This will:

  1. Deploy the Terraform application
  2. Upload Lambda functions
  3. Upload frontend assets to S3
  4. Invalidate CloudFront cache

Production Environment

To deploy to the production environment:

make deploy_prod

Important: Production deployments should only be done after thorough testing in the development environment.

Deployment Process

The deployment process uses Terraform to manage infrastructure. The templates are in the terraform/ directory and are separated by the uses of each piece of infrastructure.

The deployment runs these steps:

  1. Build and package the API code
  2. Update resource state using Terraform
  3. Wait for update to complete
  4. Upload frontend assets to S3
  5. Invalidate CloudFront cache

Post-Deployment Verification

After deployment, verify that:

  1. Terraform updated successfully
  2. Lambda functions were deployed
  3. API endpoints respond correctly
  4. Frontend loads properly

We can run make dev_health_check or make prod_health_check for a basic health check.

Issues during/after deployment

If issues occur during deployment, you should manually re-deploy the last deployed application tag.

Monitoring Deployments

Monitor the deployment through:

  1. Terraform logs in Github Actions
  2. CloudWatch logs
  3. Infra Cloudwatch dashboard (PROD only).

For detailed execution logs, check CloudWatch logs for the Lambda functions.

Clone this wiki locally