astro-sst
This adapter allows Astro to deploy your SSR site to AWS.
Installation
Add the AWS adapter to enable SSR in your Astro project with the following astro add
command. This will install the adapter and make the appropriate changes to your astro.config.mjs
file in one step.
# Using NPM
npx astro add astro-sst
# Using Yarn
yarn astro add astro-sst
# Using PNPM
pnpm astro add astro-sst
If you prefer to install the adapter manually instead, complete the following two steps:
-
Install the AWS adapter to your project’s dependencies using your preferred package manager. If you’re using npm or aren’t sure, run this in the terminal:
npm install astro-sst
-
Add two new lines to your
astro.config.mjs
project configuration file.import { defineConfig } from "astro/config"; import aws from "astro-sst/lambda"; export default defineConfig({ output: "server", adapter: aws(), });
Targets
You can deploy to different targets:
-
edge
: SSR inside a Lambda@Edge function. -
lambda
: SSR inside a Lambda function.
You can change where to target by changing the import:
import aws from "astro-sst/lambda";
import aws from "astro-sst/edge";