Prerequisites
Before starting, ensure you have:- Terraform installed
psql(PostgreSQL client) installed- AWS Console access with permissions to create IAM users
- All required environment variables (see below)
Step 1: Create AWS Credentials
Create Terraform IAM User
- Go to AWS IAM Console
- Create a new user named
terraform - Attach the
AdministratorAccesspolicy to the user - Generate access keys for the user
Export AWS Credentials
Export the following environment variables:
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID | The AWS Access Key for terraform |
AWS_SECRET_ACCESS_KEY | The AWS Secret Key for terraform |
Export Additional Environment Variables
Export all environment variables specified in the Terraform README inputs:
Step 2: Create S3 Backend
The S3 backend stores Terraform state remotely, allowing team collaboration and state locking.
Prepare Configuration
In the
terraform/ directory:- Comment out the
terraformblock inprovider.tf - Comment out everything in
vault.tf
Step 3: Initial Infrastructure Deployment
Configure Vault DNS
After the initial apply, check the AWS Certificate Manager console for the DNS validation record required for the Vault TLS certificate.
Export Vault Token
After Vault is initialized, export the root token:
| Variable | Description |
|---|---|
VAULT_TOKEN | The root vault token you just generated |
Keep all previously exported environment variables active.
Step 4: Configure Vault DNS
Create the following DNS records in your DNS provider. Find the Elastic Load Balancer DNS name for Vault in the AWS Management Console.| Type | Name | Destination |
|---|---|---|
| CNAME | vault.pennlabs.org | xyz.us-east-1.elb.amazonaws.com |
| CNAME | _acme-challenge.pennlabs.org | _acme-challenge.upenn.club |
Replace
xyz.us-east-1.elb.amazonaws.com with the actual ELB DNS name from the AWS console.Step 5: Initialize Vault
Visit Vault UI
Navigate to https://vault.pennlabs.org and follow the initialization prompts.
Step 6: Complete Vault Configuration
Step 7: Configure Production DNS
Create the following DNS records. Find the Traefik load balancer IP address in the AWS Management Console.| Type | Name | Destination |
|---|---|---|
| A | pennlabs.org | y.y.y.y |
| CNAME | *.pennlabs.org | pennlabs.org |
| A | <all product domains> | y.y.y.y |
| CNAME | _acme-challenge.<all product domains> | _acme-challenge.upenn.club |
Replace
y.y.y.y with the actual Traefik IP address. Product domains include: ohq.io, pennbasics.com, penncfa.com, pennclubs.com, penncoursealert.com, penncourseplan.com, penncoursereview.com, penndegreeplan.com, penncourses.org, pennmobile.org.Verification
If all steps completed successfully, you should have:- A fully functional EKS Kubernetes cluster
- RDS PostgreSQL database cluster
- HashiCorp Vault for secrets management
- Configured DNS for all product domains
- GitHub Actions integration
- Monitoring and observability infrastructure