Skip to content

Deployments & Resources

David Zhu edited this page Mar 30, 2025 · 1 revision

This is documentation for the resources provisioned for the the AUCC website, and their intended usage

Deployments

The AUCC website is deployed on Fly.io, a platform that hosts our applications on virtual private servers (VPS). We have two separate environments for the website: staging and production.

  • aucc-staging: This is where we deploy updates first to test them in a real-world environment without affecting users.
  • aucc-production: This is the live website that users visit. It holds the final, stable version of the app.
    • This is not deployed yet

We also have ephemeral preview apps that are created during the lifecycle of a PR to be able to preview the PR. These apps are prefixed with the name aucc-preview-, and are tore down when the PR is closed.


Other Resources

  • Neon: A serverless Postgres provider.

AWS Resources

Important

All created resources should be prefixed with aucc- for clarity.

Additionally, resources should also be suffixed with prod or staging unless they are shared between the environments

Overview

Infrastructure for the AUCC website is provisioned using Terraform, a widely used tool for managing infrastructure as code (IaC). Terraform allows us to define, provision, and manage cloud resources efficiently and consistently.

Terraform configuration files are stored in the /terraform directory of the project.

Getting Started

Before applying Terraform configurations, ensure the following steps are completed:

1. Install Terraform

Download and install Terraform from the official website.

2. Install the AWS CLI

The AWS Command Line Interface (CLI) is used for managing AWS services. Install it from the AWS CLI Documentation.

3. Set Up AWS Credentials

You need AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to provision resources. If you don't have access to these credentials request the from the tech team. You can set these credentials in your shell environment temporarily or configure them permanently.

Option 1: Temporary Shell Setup

In your terminal, run the following commands:

export AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_ACCESS_KEY>

These environment variables will only persist for the current terminal session.

Option 2: Permanent Setup via AWS CLI

Alternatively, you can configure your AWS credentials using the AWS CLI by running:

aws configure

Follow the prompts to enter your AWS access key, secret key, region, and output format.

4. Navigate to the Terraform Directory

Once your AWS credentials are configured, navigate to the /terraform directory in the project.

5. Review Changes with terraform plan

To see what resources will be created or modified, run the following Terraform command:

terraform plan -var-file=<env>.tfvars

Replace <env> with either staging or `prod depending on the environment.

6. Apply Changes with terraform apply

Once you've reviewed the plan and confirmed that the resources are correct, apply the changes by running:

terraform apply -var-file=<env>.tfvars

Again, replace <env> with staging or prod, depending on the environment.

Environment-Specific Configuration Files

Terraform uses .tfvars files to set environment-specific variables. Ensure that you are applying the correct configuration file for your environment:

For staging environment: terraform apply -var-file=staging.tfvars

For production environment: terraform apply -var-file=prod.tfvars

By following these steps, you will be able to provision and manage AWS resources efficiently for the AUCC website using Terraform.

Clone this wiki locally