AWS Deployment

Deploy your SaaS to AWS using SST.dev.

The boilerplate uses SST.dev to deploy Nuxt applications to AWS.

With SST, your entire infrastructure is defined in code — in a single sst.config.ts file. This includes databases, buckets, queues, topics, etc.

What's Included

The AWS deployment setup comes with:

  • CloudFront CDN deployment
  • S3 bucket for static assets
  • Edge function deployment
  • Infrastructure as Code with SST
  • Async job processing with SQS/SNS
  • Database and storage integration
  • Domain and SSL configuration

Architecture Overview

When deployed, your application is distributed across AWS services:

  • Static assets are served from S3 buckets
  • Server functions run on CloudFront's edge network
  • Additional AWS resources are automatically provisioned via SST

Deployment Setup

AWS Account Configuration

First, create an AWS account and set up your credentials:

  1. Create an AWS IAM user:
  • Go to AWS IAM Console
  • Create new user with programmatic access
  • Attach 'AdministratorAccess' policy (you can restrict this later)
  1. Configure AWS credentials locally:
# Install AWS CLI if you haven't already
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

# Configure credentials
aws configure

When running aws configure, you'll be prompted for:

AWS Access Key ID [None]: AKIAXXXXXXXXXXXXXXXX
AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Default region name [None]: us-east-1
Default output format [None]: json
  1. Verify your credentials:
aws sts get-caller-identity

Your credentials will be stored in ~/.aws/credentials. SST will automatically use these credentials for deployment.

On CI/CD platforms like GitHub Actions, set these environment variables:

AWS_ACCESS_KEY_ID=AKIAXXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Domain Configuration

You have two options for domain setup:

Option 1: Using Route 53

If you're using Route 53 for your domain management, no additional configuration is needed. The deployment will automatically:

  • Create SSL certificates
  • Configure DNS records
  • Set up CloudFront distribution to use the domain

Option 2: Using External Domain Provider

If you're using another domain provider:

  1. Go to AWS Certificate Manager in the us-east-1 region
  2. Request a new certificate for your domain
  3. Verify domain ownership using one of these methods:
    • DNS validation (recommended)
    • Email validation
  4. Wait for certificate validation to complete
  5. Copy the certificate ARN for the next step

After certificate validation, you'll need to update your domain's DNS records to point to the CloudFront distribution. The exact CNAME/A records will be provided after deployment.

Environment Variables

Configure your domain settings in .env:

# Required: Your domain
APP_DOMAIN=saas-boilerplate.dev

# Only required if NOT using Route 53
APP_DOMAIN_CERT_ARN="arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/4bedxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Prisma Output

To ensure Prisma works correctly with AWS Lambda, update your Prisma schema:

~/prisma/schema.prisma
generator client {
  provider        = "prisma-client-js"
  binaryTargets   = ["native", "rhel-openssl-3.0.x"]
  output          = "../node_modules/.prisma/client" // -> uncomment this line
}

Deployment Command

Deploy your application using:

pnpm sst deploy --stage production

Key Features

  1. Serverless Architecture: Pay-as-you-go scaling
  2. Edge Computing: Global low-latency performance
  3. Infrastructure as Code: Version-controlled infrastructure
  4. AWS Integration: Easy access to AWS services
  5. Automated Setup: One-command deployment

Need Help?

See It in Action

Want to see it in action? The site you're reading is deployed on AWS using SST.dev!