forked from webdevcody/pantry-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
48 lines (45 loc) · 1.35 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
import { SSTConfig } from "sst";
import { NextjsSite } from "sst/constructs";
import { RetentionDays } from "aws-cdk-lib/aws-logs";
import * as cdk from "aws-cdk-lib";
import * as cf from "aws-cdk-lib/aws-cloudfront";
export default {
config(_input) {
return {
name: "pantry-tracker",
region: "us-east-1",
};
},
stacks(app) {
app.stack(function Site({ stack }) {
const serverCachePolicy = new cf.CachePolicy(stack, "ServerCache", {
queryStringBehavior: cf.CacheQueryStringBehavior.all(),
headerBehavior: cf.CacheHeaderBehavior.none(),
cookieBehavior: cf.CacheCookieBehavior.none(),
defaultTtl: cdk.Duration.days(0),
maxTtl: cdk.Duration.days(365),
minTtl: cdk.Duration.days(0),
enableAcceptEncodingBrotli: true,
enableAcceptEncodingGzip: true,
});
const site = new NextjsSite(stack, "site", {
// customDomain: {
// domainName: "webdevcody.com",
// domainAlias: "www.ytchaptersgenerator.com",
// },
cdk: {
serverCachePolicy,
server: {
logRetention: RetentionDays.ONE_MONTH,
},
},
environment: {
DATABASE_URL: process.env.DATABASE_URL!,
},
});
stack.addOutputs({
SiteUrl: site.url,
});
});
},
} satisfies SSTConfig;