Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
sveltekit-adapter-aws-pulumi
Advanced tools
This project contains a SvelteKit adapter to deploy SvelteKit to AWS using Pulumi.
npm create svelte@latest my-app
cd my-app
npm install
npm install -D sveltekit-adapter-aws-pulumi
npm run build
npx adapter-stack-destroy
svelte.config.js
import { adapter } from 'sveltekit-adapter-aws-pulumi'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({
autoDeploy: true,
}),
},
}
export default config
The following diagram shows the architecture deployed by this package. The key features are as follows:
export interface AWSAdapterProps {
artifactPath?: string // Build output directory (default: build)
autoDeploy?: boolean // Should automatically deploy in SvelteKit build step (default: false)
defaultHeaders?: string[] // Default whitelist of headers for the SSR server. (default: ['Accept','Accept-Language','If-None-Match','Host','Origin','Referer','X-Forwarded-Host'])
extraHeaders?: string[] // Additional headers to add to whitelist. (default: [])
esbuildOptions?: any // Override or extend default esbuild options for the SSR server. Supports `external` (default `['node:*']`), `format` (default `cjs`), `target` (default `node18`), `banner` (default `{}`).
FQDN?: string // Full qualified domain name of CloudFront deployment (e.g. demo.example.com)
memorySize?: number // Memory size of SSR lambda in MB (default: 128)
pulumiPaths: string[] // For internal use only
region?: string // Region to deploy resources (default: us-east-2)
serverStreaming?: boolean // Use lambda streaming responses for SSR server (default: false)
stackName?: string // Pulumi stack name (default: dev)
}
Variables can be included in the environment of the SSR server by defining them
in a .env
file. For example:
AUTH_SECRET=
AUTH_TRUST_HOST=
Values can be added to the .env
file or defined as environment
variables. If environment variables are defined they will overwrite the values
in the .env file.
See $env/static/private in the SvelteKit documentation for further details.
A script is provided to destroy the infrastructure, with the following signature:
adapter-stack-destroy [artifactPath]
Destroy the SvelteKit adapter's Pulumi stacks
Positionals:
artifactPath directory containing the build artifacts. Defaults to 'build'
[string]
Options:
--version Show version number [boolean]
-s stack name [string]
--default-projects use the built-in Pulumi projects [boolean]
-f, --force cancel ongoing stack updates [boolean]
-h, --help Show help [boolean]
When running locally, adapter-stack-destroy
can be called with no arguments
and it will remove the Pulumi stacks based on a config file in the build
directory. If an alternative artifact path was used, pass this value to the
script.
When running in a stateless environment, such as CI, passing the option -s
with a stack name and --default-projects
will delete the given stack based
on the projects defined within the package.
This package utilises the SvelteKit AWS Adapter Base Package to prepare the files to be deployed. The project is seeking collaborators to develop alternative IAC solutions. Please open an issue in the project if you are interested in collaborating.
This package is derived from Mike Bild's adapter for CDK and inspired by James Bray's adapter for Serverless Framework.
FAQs
SvelteKit adapter for deploying to AWS using Pulumi.
The npm package sveltekit-adapter-aws-pulumi receives a total of 9 weekly downloads. As such, sveltekit-adapter-aws-pulumi popularity was classified as not popular.
We found that sveltekit-adapter-aws-pulumi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.