-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
44 lines (40 loc) · 1.11 KB
/
sst.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/// <reference path="./.sst/platform/config.d.ts" />
import { WorkflowEngine } from "./src/sst";
export default $config({
app(input) {
return {
name: "mini-workflow-example",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
profile: process.env.AWS_PROFILE,
region: "us-west-2",
version: "6.52.0",
},
},
};
},
async run() {
const engine = new WorkflowEngine("WorkflowEngine", {
worker: "example/index.execute",
orchestrator: "example/index.orchestrate",
});
// this lambda function is an API that can be used to trigger workflows
const api = new sst.aws.Function("Api", {
handler: "example/index.api",
url: true,
link: [engine.history, engine.events],
environment: {
BUCKET_NAME: engine.history.name,
QUEUE_URL: engine.events.url,
QUEUE_ARN: engine.events.arn,
WORKER_FUNCTION_NAME: engine.worker.name,
TIMER_QUEUE_URL: engine.timers.url,
},
});
return {
url: api.url,
};
},
});