-
Notifications
You must be signed in to change notification settings - Fork 0
Deployments & Resources
This is documentation for the resources provisioned for the the AUCC website, and their intended usage
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.
- This is deployed at https://aucc-staging.fly.dev/
-
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.
- Neon: A serverless Postgres provider.
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
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.
Before applying Terraform configurations, ensure the following steps are completed:
Download and install Terraform from the official website.
The AWS Command Line Interface (CLI) is used for managing AWS services. Install it from the AWS CLI Documentation.
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.
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.
Alternatively, you can configure your AWS credentials using the AWS CLI by running:
aws configureFollow the prompts to enter your AWS access key, secret key, region, and output format.
Once your AWS credentials are configured, navigate to the /terraform directory in the project.
To see what resources will be created or modified, run the following Terraform command:
terraform plan -var-file=<env>.tfvarsReplace <env> with either staging or `prod depending on the environment.
Once you've reviewed the plan and confirmed that the resources are correct, apply the changes by running:
terraform apply -var-file=<env>.tfvarsAgain, replace <env> with staging or prod, depending on the environment.
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.