-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
40 lines (37 loc) · 935 Bytes
/
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
/// <reference path="./.sst/platform/config.d.ts" />
import dotenv from 'dotenv';
dotenv.config();
export default $config({
app(input) {
return {
name: 'aurora-dsql',
removal: 'remove',
protect: ['production'].includes(input?.stage),
home: 'aws',
};
},
async run() {
const dsqlClusterIdentifier = process.env.CLUSTER_IDENTIFIER!;
const api = new sst.aws.Function('api', {
handler: 'lambda/api.handler',
timeout: '60 seconds',
link: [],
url: true,
environment: {
CLUSTER_IDENTIFIER: dsqlClusterIdentifier,
},
permissions: [
{
actions: ['dsql:DbConnect', 'dsql:DbConnectAdmin'],
resources: ['*'],
},
],
});
new sst.aws.Nextjs('frontend', {
environment: {
NEXT_PUBLIC_API_URL: api.url,
NEXT_PUBLIC_CLUSTER_IDENTIFIER: dsqlClusterIdentifier,
},
});
},
});