-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
53 lines (45 loc) · 1.3 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
45
46
47
48
49
50
51
52
53
/// <reference path="./.sst/platform/config.d.ts" />
import { readdirSync } from "fs";
const AWS_ORG_NAME = process.env.AWS_ORG_NAME;
if (!AWS_ORG_NAME) throw new Error("AWS_ORG_NAME is not set");
const AWS_REGION = process.env.AWS_REGION;
if (!AWS_REGION) throw new Error("AWS_REGION is not set");
export default $config({
app(input) {
return {
name: "printworks",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
profile:
input?.stage === "production"
? `${AWS_ORG_NAME}-production`
: `${AWS_ORG_NAME}-dev`,
region: AWS_REGION as aws.Region,
},
awsx: true,
cloudflare: true,
azuread: true,
"@pulumiverse/time": true,
tls: true,
random: true,
command: true,
},
version: ">= 3.0.1",
};
},
async run() {
$transform(sst.aws.Function, (args) => {
args.architecture ??= "arm64";
args.runtime ??= "nodejs22.x";
});
const outputs = {};
for (const dir of readdirSync("./infra")) {
if (dir === "custom") continue;
const infra = await import(`./infra/${dir}`);
if (infra.outputs) Object.assign(outputs, infra.outputs);
}
return outputs;
},
});