-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
64 lines (60 loc) · 1.7 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/triple-slash-reference */
/* eslint-disable @typescript-eslint/require-await */
/* eslint-disable no-new */
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "sebastian-software-remix",
removal: input.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
region: "eu-central-1",
// AWS Profile configuration in ~/.aws/credentials
// You need aws_access_key_id and aws_secret_access_key of an account that
// can write to the stack.
// We currently ignore stage and always use PROD profile.
profile: process.env.CI ? undefined : "sebastiansoftwarede"
},
cloudflare: true
}
}
},
async run() {
sst.Linkable.wrap(aws.dynamodb.Table, (table) => ({
properties: { tableName: table.name }
}))
const table = new sst.aws.Dynamo("WebVitals", {
fields: {
id: "string"
},
primaryIndex: { hashKey: "id" }
})
let domain
if ($app.stage === "production") {
domain = {
name: "sebastian-software.de",
redirects: ["www.sebastian-software.de"],
dns: sst.cloudflare.dns({
zone: "1849459b28dd975658208ee4ffdb2257",
transform: {
record(record) {
record.content = record.value
delete record.value
}
}
})
}
}
new sst.aws.Remix("Website", {
domain,
server: {
architecture: "arm64",
memory: "1024 MB"
},
link: [table]
})
}
})