-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
72 lines (65 loc) · 1.88 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
65
66
67
68
69
70
71
72
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: 'vita',
removal: input?.stage === 'production' ? 'retain' : 'remove',
home: 'aws',
}
},
async run() {
const openApiKey = new sst.Secret('OpenApiKey')
const facebookId = new sst.Secret('FacebookId')
const facebookSecret = new sst.Secret('FacebookSecret')
const googleId = new sst.Secret('GoogleId')
const googleSecret = new sst.Secret('GoogleSecret')
const WebhookVerifyToken = new sst.Secret('WebhookVerifyToken')
const GraphApiToken = new sst.Secret('GraphApiToken')
const GeminiApiKey = new sst.Secret('GeminiApiKey')
const StripeSecretKey = new sst.Secret("StripeSecretKey")
const StripeWebhookSecret = new sst.Secret("StripeWebhookSecret")
const database = new sst.aws.Postgres('MyDatabase', {
scaling: {
min: '0.5 ACU',
max: '1 ACU',
},
})
const bucket = new sst.aws.Bucket('MyBucket', {
public: true,
})
const blogCron = new sst.aws.Cron('MyCronJob', {
schedule: 'cron(0 6 * * ? *)',
job: {
handler: 'src/cron_functions/blog.handler',
timeout: '60 seconds'
}
})
const remindersCron = new sst.aws.Cron('RemindersJob', {
schedule: 'rate(30 minutes)',
job: {
handler: 'src/cron_functions/reminders.handler',
timeout: '60 seconds'
}
})
new sst.aws.Nextjs('MyWeb', {
link: [
bucket,
database,
openApiKey,
facebookId,
facebookSecret,
googleId,
googleSecret,
WebhookVerifyToken,
GraphApiToken,
GeminiApiKey,
StripeSecretKey,
StripeWebhookSecret
],
environment: {
NEXTAUTH_URL: process.env.NEXTAUTH_URL!,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET!,
},
})
},
})