-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathsst.config.ts
41 lines (39 loc) · 1.1 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
/// <reference path="./.sst/platform/config.d.ts" />
// import { readdirSync } from "fs";
export default $config({
app(input) {
return {
name: "nestri",
removal: input?.stage === "production" ? "retain" : "remove",
protect: ["production"].includes(input?.stage),
home: "aws",
providers: {
aws: {
region: "us-east-1",
profile:
input.stage === "production" ? "nestri-production" : "nestri-dev",
},
cloudflare: "5.49.0",
random: "4.17.0",
command: "1.0.2",
},
};
},
async run() {
const fs = await import("fs")
$transform(sst.aws.Function, (args) => {
args.environment = $resolve([args.environment]).apply(([environment]) => {
return {
...environment,
NODE_OPTIONS: "--experimental-websocket",
};
});
});
const outputs = {};
for (const value of fs.readdirSync("./infra/")) {
const result = await import("./infra/" + value);
if (result.outputs) Object.assign(outputs, result.outputs);
}
return outputs;
},
});