@astro-aws/adapter
An Astro adapter for building an SSR application and deploying it to AWS Lambda.
Install
Section titled “Install”# Using NPMnpx astro add @astro-aws/adapter
# Using Yarnyarn astro add @astro-aws/adapter
# Using PNPMpnpm astro add @astro-aws/adapter
# Using Bunbun x astro add @astro-aws/adapterManually
Section titled “Manually”- Install the package.
# Using NPMnpm install -D @astro-aws/adapter
# Using Yarnyarn add -D @astro-aws/adapter
# Using PNPMpnpm add -D @astro-aws/adapter
# Using Bunbun add -D @astro-aws/adapter- Add the following to your
astro.config.mjsfile.
import { defineConfig } from "astro/config"import astroAws from "@astro-aws/adapter"
export default defineConfig({ output: "server", adapter: astroAws(),})SSR Usage
Section titled “SSR Usage”- Install the package.
# Using NPMnpm install -D @astro-aws/adapter
# Using Yarnyarn add -D @astro-aws/adapter
# Using PNPMpnpm add -D @astro-aws/adapter
# Using Bunbun add -D @astro-aws/adapter- Add the following to your
astro.config.mjsfile.
import { defineConfig } from "astro/config"import astroAws from "@astro-aws/adapter"
export default defineConfig({ output: "server", adapter: astroAws({ mode: "ssr", }),})SSR Stream Usage
Section titled “SSR Stream Usage”- Install the package.
# Using NPMnpm install -D @astro-aws/adapter
# Using Yarnyarn add -D @astro-aws/adapter
# Using PNPMpnpm add -D @astro-aws/adapter
# Using Bunbun add -D @astro-aws/adapter- Add the following to your
astro.config.mjsfile.
import { defineConfig } from "astro/config"import astroAws from "@astro-aws/adapter"
export default defineConfig({ output: "server", adapter: astroAws({ mode: "ssr-stream", }),})Edge Usage
Section titled “Edge Usage”- Install the package.
# Using NPMnpm install -D @astro-aws/adapter
# Using Yarnyarn add -D @astro-aws/adapter
# Using PNPMpnpm add -D @astro-aws/adapter
# Using Bunbun add -D @astro-aws/adapter- Add the following to your
astro.config.mjsfile.
import { defineConfig } from "astro/config"import astroAws from "@astro-aws/adapter"
export default defineConfig({ output: "server", adapter: astroAws({ mode: "edge", }),})Limitations
Section titled “Limitations”- Environment variables are not supported
- Limited execution time (5 seconds for viewer request/response, 30 seconds for origin request/response)
- Smaller deployment package size limits
- Limited access to AWS services (no VPC access)
- No access to the file system (except
/tmp)
Example
Section titled “Example”See the source code of this site
For more information, see the documentation website