-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
36 lines (31 loc) · 880 Bytes
/
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
import { SSTConfig } from "sst";
import { RemovalPolicy } from 'aws-cdk-lib';
import { website, GraphqlStack } from "./stacks";
export default {
config(_input) {
return {
name: "cesium",
region: "us-east-1",
};
},
stacks(app) {
const protectedStacks = ['prod', 'dev'];
if (!protectedStacks.includes(app.stage)) {
app.setDefaultRemovalPolicy(RemovalPolicy.DESTROY);
}
app.setDefaultFunctionProps({
runtime: 'nodejs18.x',
architecture: 'arm_64',
environment: {
IS_PROD: (app.stage === 'prod').toString(),
GRAPHQL_API_KEY: process.env.GRAPHQL_API_KEY!
}
});
app.stack(GraphqlStack, {
terminationProtection: protectedStacks.includes(app.stage)
});
app.stack(website, {
terminationProtection: protectedStacks.includes(app.stage)
});
}
} satisfies SSTConfig;