-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
47 lines (43 loc) · 1.06 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
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "tt-crew-app",
removal: input?.stage === "production" ? "retain" : "remove",
protect: ["production"].includes(input?.stage),
home: "aws",
};
},
async run() {
const SENTRY_AUTH_TOKEN = new sst.Secret("SENTRY_AUTH_TOKEN");
const vpc = new sst.aws.Vpc("TT-VPC", {
bastion: true,
nat: "ec2",
});
const database = new sst.aws.Postgres("TT-Database", {
vpc,
proxy: true,
dev: {
username: "postgres",
password: "password",
database: "postgres",
host: "localhost",
port: 5432,
},
});
new sst.x.DevCommand("Studio", {
link: [database],
dev: {
command: "pnpm drizzle-kit studio",
},
});
new sst.aws.Nextjs("TT-Nextjs", {
link: [SENTRY_AUTH_TOKEN, database],
vpc,
domain:
$app.stage === "production"
? "tt-crew.app"
: `${$app.stage}-preview.tt-crew.app`,
});
},
});