-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainBackend.ts
34 lines (29 loc) · 1.09 KB
/
mainBackend.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
#!/usr/bin/env node
import 'source-map-support/register'
import * as cdk from 'aws-cdk-lib'
import { AuthStack } from '../lib/authStack'
import { FileStorageStack } from '../lib/fileStorageStack'
import { DatabaseStack } from '../lib/databaseStack'
import { APIStack } from '../lib/apiStack'
const app = new cdk.App()
const databaseStack = new DatabaseStack(app, 'DatabaseStack', {})
const authStack = new AuthStack(app, 'AuthStack', {
stage: 'dev',
hasCognitoGroups: true,
groupNames: ['admin'],
userpoolConstructName: 'ChatUserPool',
identitypoolConstructName: 'ChatIdentityPool',
userTable: databaseStack.userTable,
})
const fileStorageStack = new FileStorageStack(app, 'FileStorageStack', {
authenticatedRole: authStack.authenticatedRole,
unauthenticatedRole: authStack.unauthenticatedRole,
allowedOrigins: ['http://localhost:3000'],
})
const apiStack = new APIStack(app, 'AppSyncAPIStack', {
userpool: authStack.userpool,
roomTable: databaseStack.roomTable,
messageTable: databaseStack.messageTable,
userTable: databaseStack.userTable,
unauthenticatedRole: authStack.unauthenticatedRole,
})