Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MikeBild/sveltekit-adapter-aws
A SvelteKit adapter for AWS using the AWS-CDK
https://github.com/MikeBild/sveltekit-adapter-aws
aws aws-cdk deployment sveltejs sveltekit
Last synced: 7 days ago
JSON representation
A SvelteKit adapter for AWS using the AWS-CDK
- Host: GitHub
- URL: https://github.com/MikeBild/sveltekit-adapter-aws
- Owner: MikeBild
- License: mit
- Created: 2021-08-26T13:17:17.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-16T13:52:18.000Z (over 1 year ago)
- Last Synced: 2024-10-30T01:59:42.287Z (12 days ago)
- Topics: aws, aws-cdk, deployment, sveltejs, sveltekit
- Language: TypeScript
- Homepage:
- Size: 497 KB
- Stars: 135
- Watchers: 8
- Forks: 31
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# SvelteKit Adapter AWS
This project contains a SvelteKit adapter to deploy SvelteKit to AWS using AWS-CDK.
## How to use?
1. Create a SvelteKit project "my-app" - `npm create svelte@latest my-app`
2. `cd my-app`
3. `npm install`
4. `npm install -D sveltekit-adapter-aws`
5. edit **svelte.config.js**## Basic setup example
**svelte.config.js**
```javascript
import { adapter } from 'sveltekit-adapter-aws';
import preprocess from 'svelte-preprocess';export default {
preprocess: preprocess(),
kit: {
adapter: adapter({
autoDeploy: true,
}),
},
};
```## Architecture
![Architecture](architecture.png)
## Configuration
```typescript
export interface AWSAdapterProps {
cdkProjectPath?: string; // AWS-CDK App file path for AWS-CDK custom deployment applications (e.g. ${process.cwd()}/deploy.js)
artifactPath?: string; // Build output directory (default: build)
autoDeploy?: boolean; // Should automatically deploy in SvelteKit build step (default: false)
stackName?: string; // AWS-CDK CloudFormation Stackname (default: AWSAdapterStack-Default)
esbuildOptions?: any; // Override or extend default esbuild options. Supports `external` (default `['node:*']`), `format` (default `cjs`), `target` (default `node16`), `banner` (default `{}`).
FQDN?: string; // Full qualified domain name of CloudFront deployment (e.g. demo.example.com)
MEMORY_SIZE?: number; // Memory size of SSR lambda in MB (default 128 MB)
LOG_RETENTION_DAYS?: number; // Log retention in days of SSR lambda (default 7 days)
zoneName?: string; // The name of the hosted zone in Route 53 (defaults to the TLD from the FQDN)
}
```## Example usages
- [Basic](https://github.com/MikeBild/sveltekit-adapter-aws-basic-example)
- [Advanced](https://github.com/MikeBild/sveltekit-adapter-aws-advanced-example)
- [Full Workshop Example](https://github.com/MikeBild/serverless-workshop-sveltekit)