This repository contains the infrastructure as code (IaC) for the Job Dashboard application using Terraform and AWS.
The application uses several AWS services:
- S3 + CloudFront for static website hosting
- Cognito for user authentication
- DynamoDB for data storage
- ACM for SSL/TLS certificates
- Route53 for DNS management (optional)
- AWS CLI installed and configured
- Terraform installed (v1.0.0+)
- A domain name (if using custom domain)
- AWS account with appropriate permissions
# Initialize Terraform
terraform init
# Review the deployment plan
terraform planIf using a custom domain (e.g., applicationpro.co):
-
Update your domain's nameservers on GoDaddy with the AWS nameservers. They will look something like this:
ns-1187.awsdns-20.org ns-1537.awsdns-00.co.uk ns-358.awsdns-44.com ns-547.awsdns-04.net -
Wait for DNS propagation (24-48 hours)
-
Deploy the certificate:
terraform apply
-
Create DNS validation records in your domain registrar:
- Type: CNAME
- Name: _1b4da9dc05abde4d1f1c156e8800f604
- Value: _3c30bd970e79efc62badfb838c52c5f7.xlfgrmvvlj.acm-validations.aws
-
Wait for certificate validation (up to 30 minutes)
The infrastructure is deployed in stages using Terraform variables:
-
Initial deployment:
# In terraform.tfvars domain_name = "applicationpro.co" create_dns_record = true validate_certificate = false use_custom_domain = false
-
After certificate validation:
# Update terraform.tfvars validate_certificate = true use_custom_domain = true # Apply changes terraform apply
- S3 bucket for static website hosting
- CloudFront distribution for content delivery
- ACM certificate for HTTPS
- User pool for authentication
- App client for frontend integration
- User groups: Admin, JobAdder, JobApplyer
- Jobs table
- Job notes table
- User settings table
- Hosted zone for domain management
- DNS records for certificate validation
- DNS records for CloudFront distribution
-
Upload frontend code to the S3 bucket:
aws s3 sync ./build/ s3://job-dashboard-prod-website
-
Create an admin user in Cognito:
aws cognito-idp admin-create-user \ --user-pool-id us-west-2_CuRT8yEh5 \ --username admin@example.com
-
Enable the API module in
main.tfwhen ready to deploy the backend
- Frontend:
https://ddxul9yt7at42.cloudfront.net(or your custom domain) - Cognito User Pool ID:
us-west-2_CuRT8yEh5 - Cognito App Client ID:
5u9tjqo7rit3h64mticul8n14f
Uncomment and configure additional modules in main.tf as needed.
- Modify the relevant
.tffiles - Run
terraform planto review changes - Run
terraform applyto apply changes
terraform destroy- All sensitive data is encrypted at rest
- HTTPS is enforced for all traffic
- Cognito handles user authentication
- DynamoDB tables use point-in-time recovery in production