-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
42 lines (38 loc) · 1022 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
37
38
39
40
41
42
/// <reference path="./.sst/platform/config.d.ts" />
import { AppEnv } from "./types";
const DOMAIN_NAME = "sgcarstrends.com";
const DOMAIN: Record<string, any> = {
dev: { name: `dev.${DOMAIN_NAME}` },
staging: { name: `staging.${DOMAIN_NAME}` },
prod: { name: DOMAIN_NAME, redirects: [`www.${DOMAIN_NAME}`] },
};
export default $config({
app(input) {
return {
name: "sgcarstrends",
removal: input?.stage === AppEnv.PROD ? "retain" : "remove",
home: "aws",
providers: {
aws: { region: "ap-southeast-1" },
cloudflare: true,
},
};
},
async run() {
new sst.aws.Nextjs("Site", {
domain: {
...DOMAIN[$app.stage],
dns: sst.cloudflare.dns(),
},
environment: {
SG_CARS_TRENDS_API_TOKEN: process.env.SG_CARS_TRENDS_API_TOKEN!,
DATABASE_URL: process.env.DATABASE_URL!,
APP_ENV: $app.stage,
},
server: {
architecture: "arm64",
memory: "10240 MB",
},
});
},
});