-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsst.tanstack.ts
More file actions
70 lines (62 loc) · 2.63 KB
/
sst.tanstack.ts
File metadata and controls
70 lines (62 loc) · 2.63 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
this.stage = input?.stage
return {
name: "access-token-to",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
};
},
async run() {
const domain = $app.stage === "production"
? "app.onedollaroauth.com"
: `${$app.stage}.app.onedollaroauth.com`
const databaseUrlSecret = new sst.Secret("DATABASE_URL");
const betterAuthSecret = new sst.Secret("BETTER_AUTH_SECRET");
const githubClientIdSecret = new sst.Secret("GITHUB_CLIENT_ID");
const githubClientSecret = new sst.Secret("GITHUB_CLIENT_SECRET");
const googleClientIdSecret = new sst.Secret("GOOGLE_CLIENT_ID");
const googleClientSecret = new sst.Secret("GOOGLE_CLIENT_SECRET");
const evervaultAppIdSecret = new sst.Secret("EVERVAULT_APP_ID");
const evervaultApiKeySecret = new sst.Secret("EVERVAULT_API_KEY");
const betterAuthUrlSecret = new sst.Secret("BETTER_AUTH_URL");
const logLevelSecret = new sst.Secret("LOG_LEVEL");
const localUrlSecret = new sst.Secret("LOCAL_URL");
const polarAccessTokenSecret = new sst.Secret("POLAR_ACCESS_TOKEN");
const polarWebhookSecret = new sst.Secret("POLAR_WEBHOOK_SECRET");
const polarOrganizationIdSecret = new sst.Secret("POLAR_ORGANIZATION_ID");
const polarProductIdSecret = new sst.Secret("POLAR_PRODUCT_ID");
new sst.aws.TanStackStart("oauth-token-app", {
domain: {
name: domain,
redirects: [`www.${domain}`],
dns: sst.aws.dns()
},
buildCommand: 'npm run build',
server: {
memory: '1024 MB',
timeout: '20 seconds',
},
warm: $app.stage === "production" ? 20 : 1,
environment: {
NODE_ENV: $app.stage === "production" ? "production" : "development",
DATABASE_URL: databaseUrlSecret.value,
BETTER_AUTH_SECRET: betterAuthSecret.value,
GITHUB_CLIENT_ID: githubClientIdSecret.value,
GITHUB_CLIENT_SECRET: githubClientSecret.value,
GOOGLE_CLIENT_ID: googleClientIdSecret.value,
GOOGLE_CLIENT_SECRET: googleClientSecret.value,
EVERVAULT_APP_ID: evervaultAppIdSecret.value,
EVERVAULT_API_KEY: evervaultApiKeySecret.value,
BETTER_AUTH_URL: betterAuthUrlSecret.value,
LOG_LEVEL: logLevelSecret.value,
LOCAL_URL: localUrlSecret.value,
POLAR_ACCESS_TOKEN: polarAccessTokenSecret.value,
POLAR_WEBHOOK_SECRET: polarWebhookSecret.value,
POLAR_ORGANIZATION_ID: polarOrganizationIdSecret.value,
POLAR_PRODUCT_ID: polarProductIdSecret.value,
}
});
},
});