AWS, Bash, Terraform, JavaScript, TypeScript, React, Vite, and Tailwind.
You need an AWS account and an IAM role with an Access Key that has AdministratorAccess
.
Download the AWS CLI or install using Homebrew brew install awscli
Download Node.js or install using Homebrew brew install node
Download Terraform or install using Homebrew:
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
brew update
brew upgrade hashicorp/tap/terraform
This repo requires a domain name in Route 53. It scaffolds out all the infrastructure necessary for your web app and API including DNS records, multiple ACM Certs the for apex domain and sub domains, S3 buckets, CloudFront distributions, API Gateway, and a Lambda function.
The apex
domain (domain-name.com
for example) is redirected to the www
version (www.your-domain.com
) of the site. The API will be at api.your-domain.com
.
Simple fullstack apps in a single enviornment where you typically only need a few API endpoints and Lamdba functions.
Give the scripts execute permissions:
chmod +x ./infra/setup.sh ./infra/api.sh ./infra/deploy.sh ./infra/web.sh
Change into your infra
folder to continue:
cd infra
Run the setup using the below:
./setup.sh your-domain-name.com
Provided everything works, run:
./deploy.sh
The scripts should import your Hosted Zone into terraform state seemlessly. If there are any issues you can reference the Hosted Zone Id of your domain in infra/config/aws-hosted-zone-id.txt
.
If you need to manually import your domain run terraform import aws_route53_zone.hosted_zone YOUR_HOSTED_ZONE_ID
.
If you need to destroy Terraform state run terraform state rm aws_route53_zone.hosted_zone
prior to terraform destroy
and comment out the hosted_zone
in infra/main.tf