Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/builder/examples/aws-lambda-sst/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# README

## Setup

1. init sst `pnpx sst@latest init`
2. replace the generated `./sst.config.ts` with `sst.config.ts`from this folder
3. copy the file `waku.ts` to
`.sst/platform/src/components/aws/waku.ts`
4. add `export * from "./waku.js";` to `.sst/platform/src/components/aws/index.ts`
5. change to include the deployment adapter `"build" : "waku build --with-aws-lambda"`

> **Optional:** activate streaming with `"build" : "DEPLOY_AWS_LAMBDA_STREAMING=true waku build --with-aws-lambda"`

## Deploy

```sh
pnpm sst deploy
```

## Configuration

see Comments in `.sst/platform/src/components/aws/waku.ts`

## Architecture

- AWS Cloudfront - global CDN and reverse proxy
- AWS Lambda Function - serverless function for the waku framework
- AWS S3 - static assets

Cloudfront can only handle by default 25 behaviors which does not allow to map all folders in the public folder.
The current setup only maps `public/assets` and `public/images` from cloudfront to s3.
The public folder is not included with in the lambda.
14 changes: 14 additions & 0 deletions docs/builder/examples/aws-lambda-sst/sst.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/// <reference path="./.sst/platform/config.d.ts" />

export default $config({
app(input) {
return {
name: 'wakustackdemoapp',
removal: input?.stage === 'production' ? 'retain' : 'remove',
home: 'aws',
};
},
async run() {
new sst.aws.Waku('WakuStackDemoApp');
},
});
Loading
Loading