-
Notifications
You must be signed in to change notification settings - Fork 7
/
sst.config.ts
62 lines (57 loc) · 2.03 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
import type { SSTConfig } from 'sst'
import { Tags, RemovalPolicy } from 'aws-cdk-lib'
import { BillingStack } from './stacks/billing-stack.js'
import { BillingDbStack } from './stacks/billing-db-stack.js'
import { UploadApiStack } from './stacks/upload-api-stack.js'
import { UploadDbStack } from './stacks/upload-db-stack.js'
import { UcanInvocationStack } from './stacks/ucan-invocation-stack.js'
import { BusStack } from './stacks/bus-stack.js'
import { CarparkStack } from './stacks/carpark-stack.js'
import { FilecoinStack } from './stacks/filecoin-stack.js'
import { SatnavStack } from './stacks/satnav-stack.js'
import { ReplicatorStack } from './stacks/replicator-stack.js'
import { UcanFirehoseStack } from './stacks/firehose-stack.js'
import { RoundaboutStack } from './stacks/roundabout-stack.js'
import { isPrBuild } from './stacks/config.js'
export default {
config(_input) {
return {
name: 'w3infra',
region: 'us-west-2',
}
},
stacks(app) {
if (isPrBuild(app.stage)) {
// destroy buckets and tables for PR builds
app.setDefaultRemovalPolicy(RemovalPolicy.DESTROY)
}
app.setDefaultFunctionProps({
runtime: 'nodejs20.x',
environment: {
NODE_OPTIONS: '--enable-source-maps',
},
nodejs: {
format: 'esm',
sourcemap: true,
},
})
app.stack(BusStack)
app.stack(UploadDbStack)
app.stack(RoundaboutStack)
app.stack(BillingDbStack)
app.stack(CarparkStack)
app.stack(UcanInvocationStack)
app.stack(BillingStack)
app.stack(FilecoinStack)
app.stack(SatnavStack)
app.stack(UploadApiStack)
app.stack(ReplicatorStack)
app.stack(UcanFirehoseStack)
// tags let us discover all the aws resource costs incurred by this app
// see: https://docs.sst.dev/advanced/tagging-resources
Tags.of(app).add('Project', 'w3infra')
Tags.of(app).add('Repository', 'https://github.com/web3-storage/w3infra')
Tags.of(app).add('Environment', `${app.stage}`)
Tags.of(app).add('ManagedBy', 'SST')
},
} satisfies SSTConfig