@gradientedge/cdk-utils 8.122.0 → 8.123.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.
- package/dist/src/lib/aws/common/stack.js +5 -7
- package/dist/src/lib/aws/construct/api-to-any-target/main.js +24 -26
- package/dist/src/lib/aws/construct/api-to-eventbridge-target/main.js +85 -103
- package/dist/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.js +94 -120
- package/dist/src/lib/aws/construct/api-to-lambda-target/main.js +8 -10
- package/dist/src/lib/aws/construct/graphql-api-lambda/main.js +7 -3
- package/dist/src/lib/aws/construct/graphql-api-lambda-with-cache/main.js +5 -1
- package/dist/src/lib/aws/construct/lambda-with-iam-access/main.js +5 -1
- package/dist/src/lib/aws/construct/rest-api-lambda/main.js +7 -3
- package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/main.js +5 -1
- package/dist/src/lib/aws/construct/site-with-ecs-backend/main.js +8 -6
- package/dist/src/lib/aws/construct/static-asset-deployment/main.js +5 -1
- package/dist/src/lib/aws/services/api-gateway/main.js +18 -10
- package/dist/src/lib/aws/services/cloudfront/main.js +11 -7
- package/dist/src/lib/aws/services/cloudwatch/logs.js +8 -4
- package/dist/src/lib/aws/services/cloudwatch/main.js +36 -78
- package/dist/src/lib/aws/services/dynamodb/main.js +6 -2
- package/dist/src/lib/aws/services/elastic-container-service/main.js +8 -4
- package/dist/src/lib/aws/services/elastic-file-system/main.js +5 -1
- package/dist/src/lib/aws/services/elasticache/main.js +6 -2
- package/dist/src/lib/aws/services/eventbridge/main.js +8 -4
- package/dist/src/lib/aws/services/lambda/main.js +7 -3
- package/dist/src/lib/aws/services/simple-notification-service/main.js +6 -2
- package/dist/src/lib/aws/services/simple-queue-service/main.js +6 -2
- package/dist/src/lib/aws/services/simple-storage-service/main.js +8 -4
- package/dist/src/lib/aws/services/step-function/main.js +52 -32
- package/dist/src/lib/aws/services/virtual-private-cloud/main.js +8 -4
- package/dist/src/lib/azure/common/stack.js +5 -7
- package/dist/src/lib/common/index.js +7 -3
- package/package.json +8 -8
- package/src/lib/aws/common/stack.ts +5 -7
- package/src/lib/aws/construct/api-to-any-target/main.ts +25 -27
- package/src/lib/aws/construct/api-to-eventbridge-target/main.ts +85 -103
- package/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.ts +94 -120
- package/src/lib/aws/construct/api-to-lambda-target/main.ts +8 -10
- package/src/lib/aws/construct/graphql-api-lambda/main.ts +4 -3
- package/src/lib/aws/construct/graphql-api-lambda-with-cache/main.ts +2 -1
- package/src/lib/aws/construct/lambda-with-iam-access/main.ts +2 -1
- package/src/lib/aws/construct/rest-api-lambda/main.ts +4 -3
- package/src/lib/aws/construct/rest-api-lambda-with-cache/main.ts +2 -1
- package/src/lib/aws/construct/site-with-ecs-backend/main.ts +8 -9
- package/src/lib/aws/construct/static-asset-deployment/main.ts +2 -1
- package/src/lib/aws/services/api-gateway/main.ts +9 -6
- package/src/lib/aws/services/cloudfront/main.ts +8 -7
- package/src/lib/aws/services/cloudwatch/logs.ts +6 -5
- package/src/lib/aws/services/cloudwatch/main.ts +35 -81
- package/src/lib/aws/services/dynamodb/main.ts +3 -2
- package/src/lib/aws/services/elastic-container-service/main.ts +5 -4
- package/src/lib/aws/services/elastic-file-system/main.ts +2 -1
- package/src/lib/aws/services/elasticache/main.ts +3 -2
- package/src/lib/aws/services/eventbridge/main.ts +5 -4
- package/src/lib/aws/services/lambda/main.ts +4 -3
- package/src/lib/aws/services/simple-notification-service/main.ts +3 -2
- package/src/lib/aws/services/simple-queue-service/main.ts +3 -2
- package/src/lib/aws/services/simple-storage-service/main.ts +5 -4
- package/src/lib/aws/services/step-function/main.ts +17 -16
- package/src/lib/aws/services/virtual-private-cloud/main.ts +5 -4
- package/src/lib/azure/common/stack.ts +7 -9
- package/src/lib/common/index.ts +5 -3
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
});
|