forked from storacha/w3infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
56 lines (51 loc) · 1.8 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
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 { FilecoinStack } from './stacks/filecoin-stack.js'
// import { RoundaboutStack } from './stacks/roundabout-stack.js'
import { isPrBuild } from './stacks/config.js'
export default {
config(_input) {
return {
name: 'upload-service',
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,
},
tracing: app.stage === 'staging' || isPrBuild(app.stage)
? 'active'
: 'disabled'
})
app.stack(UploadDbStack)
// FIXME: needs update to work with indexing service
// app.stack(RoundaboutStack)
app.stack(BillingDbStack)
app.stack(UcanInvocationStack)
app.stack(BillingStack)
app.stack(FilecoinStack)
app.stack(UploadApiStack)
// 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', 'upload-service')
Tags.of(app).add('Repository', 'https://github.com/storacha/upload-service-infra')
Tags.of(app).add('Environment', `${app.stage}`)
Tags.of(app).add('ManagedBy', 'SST')
},
} satisfies SSTConfig