-
Notifications
You must be signed in to change notification settings - Fork 42
/
sst.config.ts
44 lines (44 loc) · 1.15 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 { readdirSync } from "fs";
export default $config({
app(input) {
return {
name: "terminal-shop",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
region: "us-east-2",
profile: process.env.GITHUB_ACTIONS
? undefined
: input.stage === "production"
? "terminal-production"
: "terminal-dev",
},
planetscale: true,
cloudflare: true,
"pulumi-stripe": true,
random: true,
tls: true,
},
};
},
async run() {
$transform(cloudflare.WorkerScript, (script) => {
script.logpush = true;
});
sst.Linkable.wrap(cloudflare.Record, function (record) {
return {
properties: {
url: $interpolate`https://${record.name}`,
},
};
});
const outputs = {};
for (const value of readdirSync("./infra/")) {
const result = await import("./infra/" + value);
if (result.outputs) Object.assign(outputs, result.outputs);
}
return outputs;
},
});