@gradientedge/cdk-utils 8.122.0 → 8.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/app/api-destined-function/node_modules/.bin/uuid +2 -2
  2. package/app/api-destined-function/package.json +1 -1
  3. package/dist/src/lib/aws/common/stack.js +5 -7
  4. package/dist/src/lib/aws/construct/api-to-any-target/main.js +24 -26
  5. package/dist/src/lib/aws/construct/api-to-eventbridge-target/main.js +85 -103
  6. package/dist/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.js +94 -120
  7. package/dist/src/lib/aws/construct/api-to-lambda-target/main.js +8 -10
  8. package/dist/src/lib/aws/construct/graphql-api-lambda/main.js +7 -3
  9. package/dist/src/lib/aws/construct/graphql-api-lambda-with-cache/main.js +5 -1
  10. package/dist/src/lib/aws/construct/lambda-with-iam-access/main.js +5 -1
  11. package/dist/src/lib/aws/construct/rest-api-lambda/main.js +7 -3
  12. package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/main.js +5 -1
  13. package/dist/src/lib/aws/construct/site-with-ecs-backend/main.js +8 -6
  14. package/dist/src/lib/aws/construct/static-asset-deployment/main.js +5 -1
  15. package/dist/src/lib/aws/services/api-gateway/main.js +18 -10
  16. package/dist/src/lib/aws/services/cloudfront/main.js +11 -7
  17. package/dist/src/lib/aws/services/cloudwatch/logs.js +8 -4
  18. package/dist/src/lib/aws/services/cloudwatch/main.js +36 -78
  19. package/dist/src/lib/aws/services/dynamodb/main.js +6 -2
  20. package/dist/src/lib/aws/services/elastic-container-service/main.js +8 -4
  21. package/dist/src/lib/aws/services/elastic-file-system/main.js +5 -1
  22. package/dist/src/lib/aws/services/elasticache/main.js +6 -2
  23. package/dist/src/lib/aws/services/eventbridge/main.js +8 -4
  24. package/dist/src/lib/aws/services/lambda/main.js +7 -3
  25. package/dist/src/lib/aws/services/simple-notification-service/main.js +6 -2
  26. package/dist/src/lib/aws/services/simple-queue-service/main.js +6 -2
  27. package/dist/src/lib/aws/services/simple-storage-service/main.js +8 -4
  28. package/dist/src/lib/aws/services/step-function/main.js +52 -32
  29. package/dist/src/lib/aws/services/virtual-private-cloud/main.js +8 -4
  30. package/dist/src/lib/azure/common/stack.js +5 -7
  31. package/dist/src/lib/common/index.js +7 -3
  32. package/package.json +16 -16
  33. package/src/lib/aws/common/stack.ts +5 -7
  34. package/src/lib/aws/construct/api-to-any-target/main.ts +25 -27
  35. package/src/lib/aws/construct/api-to-eventbridge-target/main.ts +85 -103
  36. package/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.ts +94 -120
  37. package/src/lib/aws/construct/api-to-lambda-target/main.ts +8 -10
  38. package/src/lib/aws/construct/graphql-api-lambda/main.ts +4 -3
  39. package/src/lib/aws/construct/graphql-api-lambda-with-cache/main.ts +2 -1
  40. package/src/lib/aws/construct/lambda-with-iam-access/main.ts +2 -1
  41. package/src/lib/aws/construct/rest-api-lambda/main.ts +4 -3
  42. package/src/lib/aws/construct/rest-api-lambda-with-cache/main.ts +2 -1
  43. package/src/lib/aws/construct/site-with-ecs-backend/main.ts +8 -9
  44. package/src/lib/aws/construct/static-asset-deployment/main.ts +2 -1
  45. package/src/lib/aws/services/api-gateway/main.ts +9 -6
  46. package/src/lib/aws/services/cloudfront/main.ts +8 -7
  47. package/src/lib/aws/services/cloudwatch/logs.ts +6 -5
  48. package/src/lib/aws/services/cloudwatch/main.ts +35 -81
  49. package/src/lib/aws/services/dynamodb/main.ts +3 -2
  50. package/src/lib/aws/services/elastic-container-service/main.ts +5 -4
  51. package/src/lib/aws/services/elastic-file-system/main.ts +2 -1
  52. package/src/lib/aws/services/elasticache/main.ts +3 -2
  53. package/src/lib/aws/services/eventbridge/main.ts +5 -4
  54. package/src/lib/aws/services/lambda/main.ts +4 -3
  55. package/src/lib/aws/services/simple-notification-service/main.ts +3 -2
  56. package/src/lib/aws/services/simple-queue-service/main.ts +3 -2
  57. package/src/lib/aws/services/simple-storage-service/main.ts +5 -4
  58. package/src/lib/aws/services/step-function/main.ts +17 -16
  59. package/src/lib/aws/services/virtual-private-cloud/main.ts +5 -4
  60. package/src/lib/azure/common/stack.ts +7 -9
  61. package/src/lib/common/index.ts +5 -3
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/bin/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/bin/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/bin/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.0/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/bin/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/uuid@9.0.1/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../uuid/dist/bin/uuid" "$@"
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@types/uuid": "^9.0.3",
20
- "uuid": "^9.0.0"
20
+ "uuid": "^9.0.1"
21
21
  },
22
22
  "devDependencies": {
23
23
  "mkdirp": "^3.0.1",
@@ -9,6 +9,7 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
9
9
  const fs_1 = __importDefault(require("fs"));
10
10
  const construct_1 = require("./construct");
11
11
  const app_root_path_1 = __importDefault(require("app-root-path"));
12
+ const lodash_1 = __importDefault(require("lodash"));
12
13
  const common_1 = require("../../common");
13
14
  /**
14
15
  * @classdesc Common stack to use as a base for all higher level constructs.
@@ -69,7 +70,7 @@ class CommonStack extends aws_cdk_lib_1.Stack {
69
70
  console.debug(`No additional contexts provided. Using default context properties from cdk.json`);
70
71
  return;
71
72
  }
72
- extraContexts.forEach((context) => {
73
+ lodash_1.default.forEach(extraContexts, (context) => {
73
74
  const extraContextPath = `${app_root_path_1.default.path}/${context}`;
74
75
  /* scenario where extra context is configured in cdk.json but absent in file system */
75
76
  if (!fs_1.default.existsSync(extraContextPath))
@@ -81,7 +82,7 @@ class CommonStack extends aws_cdk_lib_1.Stack {
81
82
  /* parse as JSON properties */
82
83
  const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'));
83
84
  /* set each of the property into the cdk node context */
84
- Object.keys(extraContextProps).forEach((propKey) => {
85
+ lodash_1.default.keys(extraContextProps).forEach((propKey) => {
85
86
  this.node.setContext(propKey, extraContextProps[propKey]);
86
87
  });
87
88
  });
@@ -115,13 +116,10 @@ class CommonStack extends aws_cdk_lib_1.Stack {
115
116
  /* parse as JSON properties */
116
117
  const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'));
117
118
  /* set each of the property into the cdk node context */
118
- Object.keys(stageContextProps).forEach((propKey) => {
119
+ lodash_1.default.keys(stageContextProps).forEach((propKey) => {
119
120
  /* handle object, array properties */
120
121
  if (typeof stageContextProps[propKey] === 'object' && !Array.isArray(stageContextProps[propKey])) {
121
- this.node.setContext(propKey, {
122
- ...this.node.tryGetContext(propKey),
123
- ...stageContextProps[propKey],
124
- });
122
+ this.node.setContext(propKey, lodash_1.default.merge(this.node.tryGetContext(propKey), stageContextProps[propKey]));
125
123
  }
126
124
  else {
127
125
  /* handle all other primitive properties */
@@ -85,33 +85,31 @@ class ApiToAnyTarget extends common_1.CommonConstruct {
85
85
  return;
86
86
  }
87
87
  this.apiToAnyTargetRestApi.api = new aws_apigateway_1.RestApi(this, `${this.id}-rest-api`, {
88
- ...{
89
- cloudWatchRole: this.props.api.restApi?.cloudWatchRole ?? true,
90
- defaultCorsPreflightOptions: {
91
- allowHeaders: aws_apigateway_1.Cors.DEFAULT_HEADERS,
92
- allowMethods: aws_apigateway_1.Cors.ALL_METHODS,
93
- allowOrigins: aws_apigateway_1.Cors.ALL_ORIGINS,
94
- },
95
- defaultIntegration: this.apiToAnyTargetRestApi.integration,
96
- defaultMethodOptions: {
97
- methodResponses: [this.apiToAnyTargetRestApi.methodResponse, this.apiToAnyTargetRestApi.methodErrorResponse],
98
- },
99
- deploy: this.props.api.restApi?.deploy ?? true,
100
- deployOptions: {
101
- accessLogDestination: new aws_apigateway_1.LogGroupLogDestination(this.apiToAnyTargetRestApi.accessLogGroup),
102
- accessLogFormat: aws_apigateway_1.AccessLogFormat.jsonWithStandardFields(),
103
- dataTraceEnabled: this.props.api.restApi?.deployOptions?.dataTraceEnabled,
104
- description: `${this.id} - ${this.props.stage} stage`,
105
- loggingLevel: aws_apigateway_1.MethodLoggingLevel.INFO,
106
- metricsEnabled: true,
107
- stageName: this.props.stage,
108
- tracingEnabled: this.props.api.restApi?.deployOptions?.tracingEnabled,
109
- },
110
- endpointConfiguration: {
111
- types: [this.isProductionStage() ? aws_apigateway_1.EndpointType.EDGE : aws_apigateway_1.EndpointType.REGIONAL],
112
- },
113
- restApiName: `${this.id}-rest-api-${this.props.stage}`,
88
+ cloudWatchRole: this.props.api.restApi?.cloudWatchRole ?? true,
89
+ defaultCorsPreflightOptions: {
90
+ allowHeaders: aws_apigateway_1.Cors.DEFAULT_HEADERS,
91
+ allowMethods: aws_apigateway_1.Cors.ALL_METHODS,
92
+ allowOrigins: aws_apigateway_1.Cors.ALL_ORIGINS,
114
93
  },
94
+ defaultIntegration: this.apiToAnyTargetRestApi.integration,
95
+ defaultMethodOptions: {
96
+ methodResponses: [this.apiToAnyTargetRestApi.methodResponse, this.apiToAnyTargetRestApi.methodErrorResponse],
97
+ },
98
+ deploy: this.props.api.restApi?.deploy ?? true,
99
+ deployOptions: {
100
+ accessLogDestination: new aws_apigateway_1.LogGroupLogDestination(this.apiToAnyTargetRestApi.accessLogGroup),
101
+ accessLogFormat: aws_apigateway_1.AccessLogFormat.jsonWithStandardFields(),
102
+ dataTraceEnabled: this.props.api.restApi?.deployOptions?.dataTraceEnabled,
103
+ description: `${this.id} - ${this.props.stage} stage`,
104
+ loggingLevel: aws_apigateway_1.MethodLoggingLevel.INFO,
105
+ metricsEnabled: true,
106
+ stageName: this.props.stage,
107
+ tracingEnabled: this.props.api.restApi?.deployOptions?.tracingEnabled,
108
+ },
109
+ endpointConfiguration: {
110
+ types: [this.isProductionStage() ? aws_apigateway_1.EndpointType.EDGE : aws_apigateway_1.EndpointType.REGIONAL],
111
+ },
112
+ restApiName: `${this.id}-rest-api-${this.props.stage}`,
115
113
  ...this.props.api.restApi,
116
114
  });
117
115
  this.addCfnOutput(`${this.id}-restApiId`, this.apiToAnyTargetRestApi.api.restApiId);
@@ -133,12 +133,10 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
133
133
  if (this.props.api.useExisting)
134
134
  return;
135
135
  this.props.event.rule = {
136
- ...{
137
- eventPattern: {
138
- source: ['api-to-eventbridge-target'],
139
- },
140
- ruleName: `${this.id}-api-to-eventbridge-target`,
136
+ eventPattern: {
137
+ source: ['api-to-eventbridge-target'],
141
138
  },
139
+ ruleName: `${this.id}-api-to-eventbridge-target`,
142
140
  ...this.props.event.rule,
143
141
  };
144
142
  this.apiEvent.rule = this.eventManager.createRule(`${this.id}-api-to-eventbridge-target-rule`, this, this.props.event.rule, this.apiEvent.eventBus, [new aws_events_targets_1.CloudWatchLogGroup(this.apiEvent.logGroup)]);
@@ -199,12 +197,10 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
199
197
  if (!this.props.api.withResource)
200
198
  return;
201
199
  this.apiToEventBridgeTargetRestApi.integrationResponse = this.props.api.integrationResponse ?? {
202
- ...{
203
- responseTemplates: {
204
- 'application/json': JSON.stringify({ message: 'Payload Submitted' }),
205
- },
206
- statusCode: '200',
200
+ responseTemplates: {
201
+ 'application/json': JSON.stringify({ message: 'Payload Submitted' }),
207
202
  },
203
+ statusCode: '200',
208
204
  };
209
205
  }
210
206
  /**
@@ -214,21 +210,19 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
214
210
  if (!this.props.api.withResource)
215
211
  return;
216
212
  this.apiToEventBridgeTargetRestApi.integrationErrorResponse = {
217
- ...{
218
- responseParameters: {
219
- 'method.response.header.Access-Control-Allow-Credentials': "'true'",
220
- 'method.response.header.Access-Control-Allow-Origin': "'*'",
221
- 'method.response.header.Content-Type': "'application/json'",
222
- },
223
- responseTemplates: {
224
- 'application/json': JSON.stringify({
225
- message: "$util.escapeJavaScript($input.path('$.errorMessage'))",
226
- state: 'error',
227
- }),
228
- },
229
- selectionPattern: '^\\[Error\\].*',
230
- statusCode: '400',
213
+ responseParameters: {
214
+ 'method.response.header.Access-Control-Allow-Credentials': "'true'",
215
+ 'method.response.header.Access-Control-Allow-Origin': "'*'",
216
+ 'method.response.header.Content-Type': "'application/json'",
231
217
  },
218
+ responseTemplates: {
219
+ 'application/json': JSON.stringify({
220
+ message: "$util.escapeJavaScript($input.path('$.errorMessage'))",
221
+ state: 'error',
222
+ }),
223
+ },
224
+ selectionPattern: '^\\[Error\\].*',
225
+ statusCode: '400',
232
226
  ...this.props.api.integrationErrorResponse,
233
227
  };
234
228
  }
@@ -241,16 +235,14 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
241
235
  this.apiToEventBridgeTargetRestApi.integration = new aws_apigateway_1.Integration({
242
236
  integrationHttpMethod: 'POST',
243
237
  options: {
244
- ...{
245
- credentialsRole: this.apiToEventBridgeTargetRestApi.role,
246
- integrationResponses: [
247
- this.apiToEventBridgeTargetRestApi.integrationResponse,
248
- this.apiToEventBridgeTargetRestApi.integrationErrorResponse,
249
- ],
250
- passthroughBehavior: aws_apigateway_1.PassthroughBehavior.NEVER,
251
- requestParameters: this.apiToEventBridgeTargetRestApi.integrationRequestParameters,
252
- requestTemplates: this.apiToEventBridgeTargetRestApi.integrationRequestTemplates,
253
- },
238
+ credentialsRole: this.apiToEventBridgeTargetRestApi.role,
239
+ integrationResponses: [
240
+ this.apiToEventBridgeTargetRestApi.integrationResponse,
241
+ this.apiToEventBridgeTargetRestApi.integrationErrorResponse,
242
+ ],
243
+ passthroughBehavior: aws_apigateway_1.PassthroughBehavior.NEVER,
244
+ requestParameters: this.apiToEventBridgeTargetRestApi.integrationRequestParameters,
245
+ requestTemplates: this.apiToEventBridgeTargetRestApi.integrationRequestTemplates,
254
246
  ...this.props.api.integrationOptions,
255
247
  },
256
248
  type: aws_apigateway_1.IntegrationType.AWS,
@@ -264,17 +256,15 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
264
256
  if (!this.props.api.withResource)
265
257
  return;
266
258
  this.apiToEventBridgeTargetRestApi.methodResponse = {
267
- ...{
268
- responseModels: {
269
- 'application/json': this.apiToEventBridgeTargetRestApi.responseModel,
270
- },
271
- responseParameters: {
272
- 'method.response.header.Access-Control-Allow-Credentials': true,
273
- 'method.response.header.Access-Control-Allow-Origin': true,
274
- 'method.response.header.Content-Type': true,
275
- },
276
- statusCode: '200',
259
+ responseModels: {
260
+ 'application/json': this.apiToEventBridgeTargetRestApi.responseModel,
261
+ },
262
+ responseParameters: {
263
+ 'method.response.header.Access-Control-Allow-Credentials': true,
264
+ 'method.response.header.Access-Control-Allow-Origin': true,
265
+ 'method.response.header.Content-Type': true,
277
266
  },
267
+ statusCode: '200',
278
268
  ...this.props.api.methodResponse,
279
269
  };
280
270
  }
@@ -285,17 +275,15 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
285
275
  if (!this.props.api.withResource)
286
276
  return;
287
277
  this.apiToEventBridgeTargetRestApi.methodErrorResponse = {
288
- ...{
289
- responseModels: {
290
- 'application/json': this.apiToEventBridgeTargetRestApi.errorResponseModel,
291
- },
292
- responseParameters: {
293
- 'method.response.header.Access-Control-Allow-Credentials': true,
294
- 'method.response.header.Access-Control-Allow-Origin': true,
295
- 'method.response.header.Content-Type': true,
296
- },
297
- statusCode: '400',
278
+ responseModels: {
279
+ 'application/json': this.apiToEventBridgeTargetRestApi.errorResponseModel,
298
280
  },
281
+ responseParameters: {
282
+ 'method.response.header.Access-Control-Allow-Credentials': true,
283
+ 'method.response.header.Access-Control-Allow-Origin': true,
284
+ 'method.response.header.Content-Type': true,
285
+ },
286
+ statusCode: '400',
299
287
  ...this.props.api.methodErrorResponse,
300
288
  };
301
289
  }
@@ -314,36 +302,34 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
314
302
  return;
315
303
  }
316
304
  this.apiToEventBridgeTargetRestApi.api = new aws_apigateway_1.RestApi(this, `${this.id}-rest-api`, {
317
- ...{
318
- cloudWatchRole: this.props.api.restApi?.cloudWatchRole ?? true,
319
- defaultCorsPreflightOptions: {
320
- allowHeaders: aws_apigateway_1.Cors.DEFAULT_HEADERS,
321
- allowMethods: ['POST'],
322
- allowOrigins: aws_apigateway_1.Cors.ALL_ORIGINS,
323
- },
324
- defaultIntegration: this.apiToEventBridgeTargetRestApi.integration,
325
- defaultMethodOptions: {
326
- methodResponses: [
327
- this.apiToEventBridgeTargetRestApi.methodResponse,
328
- this.apiToEventBridgeTargetRestApi.methodErrorResponse,
329
- ],
330
- },
331
- deploy: this.props.api.restApi?.deploy ?? true,
332
- deployOptions: {
333
- accessLogDestination: new aws_apigateway_1.LogGroupLogDestination(this.apiToEventBridgeTargetRestApi.accessLogGroup),
334
- accessLogFormat: aws_apigateway_1.AccessLogFormat.jsonWithStandardFields(),
335
- dataTraceEnabled: this.props.api.restApi?.deployOptions?.dataTraceEnabled,
336
- description: `${this.id} - ${this.props.stage} stage`,
337
- loggingLevel: aws_apigateway_1.MethodLoggingLevel.INFO,
338
- metricsEnabled: true,
339
- stageName: this.props.stage,
340
- tracingEnabled: this.props.api.restApi?.deployOptions?.tracingEnabled,
341
- },
342
- endpointConfiguration: {
343
- types: [aws_apigateway_1.EndpointType.REGIONAL],
344
- },
345
- restApiName: `${this.id}-rest-api-${this.props.stage}`,
305
+ cloudWatchRole: this.props.api.restApi?.cloudWatchRole ?? true,
306
+ defaultCorsPreflightOptions: {
307
+ allowHeaders: aws_apigateway_1.Cors.DEFAULT_HEADERS,
308
+ allowMethods: ['POST'],
309
+ allowOrigins: aws_apigateway_1.Cors.ALL_ORIGINS,
310
+ },
311
+ defaultIntegration: this.apiToEventBridgeTargetRestApi.integration,
312
+ defaultMethodOptions: {
313
+ methodResponses: [
314
+ this.apiToEventBridgeTargetRestApi.methodResponse,
315
+ this.apiToEventBridgeTargetRestApi.methodErrorResponse,
316
+ ],
317
+ },
318
+ deploy: this.props.api.restApi?.deploy ?? true,
319
+ deployOptions: {
320
+ accessLogDestination: new aws_apigateway_1.LogGroupLogDestination(this.apiToEventBridgeTargetRestApi.accessLogGroup),
321
+ accessLogFormat: aws_apigateway_1.AccessLogFormat.jsonWithStandardFields(),
322
+ dataTraceEnabled: this.props.api.restApi?.deployOptions?.dataTraceEnabled,
323
+ description: `${this.id} - ${this.props.stage} stage`,
324
+ loggingLevel: aws_apigateway_1.MethodLoggingLevel.INFO,
325
+ metricsEnabled: true,
326
+ stageName: this.props.stage,
327
+ tracingEnabled: this.props.api.restApi?.deployOptions?.tracingEnabled,
328
+ },
329
+ endpointConfiguration: {
330
+ types: [aws_apigateway_1.EndpointType.REGIONAL],
346
331
  },
332
+ restApiName: `${this.id}-rest-api-${this.props.stage}`,
347
333
  ...this.props.api.restApi,
348
334
  });
349
335
  this.addCfnOutput(`${this.id}-restApiId`, this.apiToEventBridgeTargetRestApi.api.restApiId);
@@ -357,15 +343,13 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
357
343
  return;
358
344
  this.apiToEventBridgeTargetRestApi.responseModel = new aws_apigateway_1.Model(this, `${this.id}-response-model`, {
359
345
  restApi: this.apiToEventBridgeTargetRestApi.api,
360
- ...{
361
- contentType: 'application/json',
362
- modelName: 'ResponseModel',
363
- schema: {
364
- properties: { message: { type: aws_apigateway_1.JsonSchemaType.STRING } },
365
- schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
366
- title: 'pollResponse',
367
- type: aws_apigateway_1.JsonSchemaType.OBJECT,
368
- },
346
+ contentType: 'application/json',
347
+ modelName: 'ResponseModel',
348
+ schema: {
349
+ properties: { message: { type: aws_apigateway_1.JsonSchemaType.STRING } },
350
+ schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
351
+ title: 'pollResponse',
352
+ type: aws_apigateway_1.JsonSchemaType.OBJECT,
369
353
  },
370
354
  ...this.props.api.responseModel,
371
355
  });
@@ -378,18 +362,16 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
378
362
  return;
379
363
  this.apiToEventBridgeTargetRestApi.errorResponseModel = new aws_apigateway_1.Model(this, `${this.id}-error-response-model`, {
380
364
  restApi: this.apiToEventBridgeTargetRestApi.api,
381
- ...{
382
- contentType: 'application/json',
383
- modelName: 'ErrorResponseModel',
384
- schema: {
385
- properties: {
386
- message: { type: aws_apigateway_1.JsonSchemaType.STRING },
387
- state: { type: aws_apigateway_1.JsonSchemaType.STRING },
388
- },
389
- schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
390
- title: 'errorResponse',
391
- type: aws_apigateway_1.JsonSchemaType.OBJECT,
365
+ contentType: 'application/json',
366
+ modelName: 'ErrorResponseModel',
367
+ schema: {
368
+ properties: {
369
+ message: { type: aws_apigateway_1.JsonSchemaType.STRING },
370
+ state: { type: aws_apigateway_1.JsonSchemaType.STRING },
392
371
  },
372
+ schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
373
+ title: 'errorResponse',
374
+ type: aws_apigateway_1.JsonSchemaType.OBJECT,
393
375
  },
394
376
  ...this.props.api.errorResponseModel,
395
377
  });