|
1 |
| -import path from 'node:path'; |
2 | 1 | import * as cdk from 'aws-cdk-lib';
|
| 2 | +import { AccessLogFormat, LambdaRestApi, LogGroupLogDestination } from 'aws-cdk-lib/aws-apigateway'; |
| 3 | +import { Certificate } from 'aws-cdk-lib/aws-certificatemanager'; |
3 | 4 | import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
4 | 5 | import * as lambda from 'aws-cdk-lib/aws-lambda';
|
5 | 6 | import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
|
6 | 7 | import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
7 |
| -import { AccessLogFormat, LambdaRestApi, LogGroupLogDestination } from 'aws-cdk-lib/aws-apigateway'; |
8 |
| -import { Certificate } from 'aws-cdk-lib/aws-certificatemanager'; |
9 | 8 | import { Construct } from 'constructs';
|
10 | 9 |
|
11 |
| -import { GraphweaverAppConfig } from './types'; |
12 | 10 | import { DatabaseStack } from './database';
|
| 11 | +import { GraphweaverAppConfig } from './types'; |
13 | 12 |
|
14 | 13 | export class LambdaStack extends cdk.NestedStack {
|
15 | 14 | public readonly lambda: lambda.Function;
|
@@ -107,7 +106,7 @@ export class LambdaStack extends cdk.NestedStack {
|
107 | 106 | accessLogFormat: AccessLogFormat.jsonWithStandardFields(),
|
108 | 107 | },
|
109 | 108 | defaultCorsPreflightOptions: {
|
110 |
| - allowOrigins: [`https://${config.adminUI.url}`], |
| 109 | + allowOrigins: config.lambda.allowedOrigins ?? [`https://${config.adminUI.url}`], |
111 | 110 | allowMethods: ['GET', 'POST', 'OPTIONS'],
|
112 | 111 | allowHeaders: [
|
113 | 112 | 'Content-Type',
|
|
0 commit comments