@gradientedge/cdk-utils 8.118.0 → 8.119.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/app/api-destined-function/package.json +1 -1
- package/dist/src/lib/common/construct.d.ts +32 -32
- package/dist/src/lib/common/construct.js +36 -59
- package/dist/src/lib/common/stack.d.ts +8 -7
- package/dist/src/lib/common/stack.js +17 -37
- package/dist/src/lib/common/types.d.ts +2 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
- package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
- package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
- package/dist/src/lib/construct/application-configuration/main.js +17 -41
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
- package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
- package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
- package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
- package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
- package/dist/src/lib/construct/static-site/main.d.ts +15 -15
- package/dist/src/lib/construct/static-site/main.js +4 -27
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +10 -10
- package/dist/src/lib/services/aws/api-gateway/main.js +21 -44
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +2 -2
- package/dist/src/lib/services/aws/appconfig/main.d.ts +7 -7
- package/dist/src/lib/services/aws/appconfig/main.js +14 -37
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -5
- package/dist/src/lib/services/aws/certificate-manager/main.js +10 -33
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +2 -2
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +18 -18
- package/dist/src/lib/services/aws/cloudfront/main.js +46 -45
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +2 -3
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +5 -5
- package/dist/src/lib/services/aws/cloudtrail/main.js +5 -28
- package/dist/src/lib/services/aws/codebuild/main.d.ts +3 -3
- package/dist/src/lib/services/aws/codebuild/main.js +7 -30
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -3
- package/dist/src/lib/services/aws/dynamodb/main.js +8 -31
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +2 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +4 -27
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +10 -10
- package/dist/src/lib/services/aws/elastic-container-service/main.js +27 -50
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +4 -4
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +3 -3
- package/dist/src/lib/services/aws/elastic-file-system/main.js +12 -35
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +4 -4
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -31
- package/dist/src/lib/services/aws/elasticache/main.d.ts +4 -4
- package/dist/src/lib/services/aws/elasticache/main.js +10 -33
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +13 -13
- package/dist/src/lib/services/aws/eventbridge/main.js +26 -49
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +10 -10
- package/dist/src/lib/services/aws/eventbridge/target.js +6 -29
- package/dist/src/lib/services/aws/evidently/main.d.ts +7 -7
- package/dist/src/lib/services/aws/evidently/main.js +18 -41
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +48 -49
- package/dist/src/lib/services/aws/identity-access-management/main.js +110 -133
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +2 -2
- package/dist/src/lib/services/aws/key-management-service/main.js +5 -28
- package/dist/src/lib/services/aws/lambda/main.d.ts +11 -13
- package/dist/src/lib/services/aws/lambda/main.js +31 -58
- package/dist/src/lib/services/aws/route53/main.d.ts +9 -9
- package/dist/src/lib/services/aws/route53/main.js +21 -44
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +5 -6
- package/dist/src/lib/services/aws/secrets-manager/main.js +10 -33
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +4 -4
- package/dist/src/lib/services/aws/simple-notification-service/main.js +11 -34
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +6 -7
- package/dist/src/lib/services/aws/simple-queue-service/main.js +15 -38
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +10 -11
- package/dist/src/lib/services/aws/simple-storage-service/main.js +31 -54
- package/dist/src/lib/services/aws/step-function/main.d.ts +31 -32
- package/dist/src/lib/services/aws/step-function/main.js +33 -57
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +4 -4
- package/dist/src/lib/services/aws/systems-manager/main.js +10 -33
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +5 -6
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +14 -37
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +3 -3
- package/dist/src/lib/services/aws/web-application-firewall/main.js +8 -31
- package/dist/src/lib/utils/aws/index.d.ts +6 -3
- package/dist/src/lib/utils/aws/index.js +9 -26
- package/package.json +15 -15
- package/src/lib/common/construct.ts +97 -67
- package/src/lib/common/stack.ts +12 -12
- package/src/lib/common/types.ts +2 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
- package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
- package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
- package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
- package/src/lib/construct/application-configuration/main.ts +31 -24
- package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
- package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
- package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
- package/src/lib/construct/rest-api-lambda/main.ts +21 -21
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
- package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
- package/src/lib/construct/static-asset-deployment/main.ts +6 -6
- package/src/lib/construct/static-site/main.ts +23 -17
- package/src/lib/services/aws/api-gateway/main.ts +42 -36
- package/src/lib/services/aws/api-gateway/types.ts +2 -2
- package/src/lib/services/aws/appconfig/main.ts +19 -19
- package/src/lib/services/aws/certificate-manager/main.ts +14 -14
- package/src/lib/services/aws/certificate-manager/types.ts +2 -2
- package/src/lib/services/aws/cloudfront/main.ts +88 -74
- package/src/lib/services/aws/cloudfront/types.ts +6 -3
- package/src/lib/services/aws/cloudtrail/main.ts +11 -11
- package/src/lib/services/aws/codebuild/main.ts +7 -7
- package/src/lib/services/aws/dynamodb/main.ts +8 -8
- package/src/lib/services/aws/elastic-container-registry/main.ts +4 -4
- package/src/lib/services/aws/elastic-container-service/main.ts +48 -37
- package/src/lib/services/aws/elastic-container-service/types.ts +4 -4
- package/src/lib/services/aws/elastic-file-system/main.ts +16 -16
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +11 -11
- package/src/lib/services/aws/elasticache/main.ts +10 -10
- package/src/lib/services/aws/eventbridge/main.ts +37 -37
- package/src/lib/services/aws/eventbridge/target.ts +14 -14
- package/src/lib/services/aws/evidently/main.ts +18 -18
- package/src/lib/services/aws/identity-access-management/main.ts +142 -134
- package/src/lib/services/aws/key-management-service/main.ts +5 -5
- package/src/lib/services/aws/lambda/main.ts +65 -59
- package/src/lib/services/aws/route53/main.ts +31 -31
- package/src/lib/services/aws/secrets-manager/main.ts +11 -15
- package/src/lib/services/aws/simple-notification-service/main.ts +13 -13
- package/src/lib/services/aws/simple-queue-service/main.ts +18 -18
- package/src/lib/services/aws/simple-storage-service/main.ts +40 -40
- package/src/lib/services/aws/step-function/main.ts +77 -65
- package/src/lib/services/aws/systems-manager/main.ts +17 -12
- package/src/lib/services/aws/virtual-private-cloud/main.ts +16 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +8 -8
- package/src/lib/utils/aws/index.ts +8 -5
|
@@ -1,37 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.ApiToEventBridgeTarget = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
4
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
+
const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
|
|
6
|
+
const aws_events_1 = require("aws-cdk-lib/aws-events");
|
|
7
|
+
const aws_events_targets_1 = require("aws-cdk-lib/aws-events-targets");
|
|
8
|
+
const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
32
9
|
const common_1 = require("../../common");
|
|
33
|
-
const event_1 = require("./event");
|
|
34
10
|
const api_1 = require("./api");
|
|
11
|
+
const event_1 = require("./event");
|
|
35
12
|
/**
|
|
36
13
|
* @classdesc Provides a construct to create and deploy API Gateway invocations to EventBridge
|
|
37
14
|
*
|
|
@@ -125,11 +102,11 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
125
102
|
this.apiToEventBridgeTargetRestApi.certificate = this.acmManager.resolveCertificate(`${this.id}-certificate`, this, this.props.api.certificate);
|
|
126
103
|
}
|
|
127
104
|
/**
|
|
128
|
-
* @summary Method to create or use an existing
|
|
105
|
+
* @summary Method to create or use an existing event bus for api payload deliveries
|
|
129
106
|
*/
|
|
130
107
|
createApiToEventBridgeTargetEventBus() {
|
|
131
108
|
if (this.props.api.useExisting) {
|
|
132
|
-
this.apiEvent.eventBus =
|
|
109
|
+
this.apiEvent.eventBus = aws_events_1.EventBus.fromEventBusName(this, `${this.id}-event-bus`, `${this.props.event.eventBusName}-${this.props.stage}`);
|
|
133
110
|
return;
|
|
134
111
|
}
|
|
135
112
|
this.apiEvent.eventBus = this.eventManager.createEventBus(`${this.id}-event-bus`, this, {
|
|
@@ -164,10 +141,10 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
164
141
|
},
|
|
165
142
|
...this.props.event.rule,
|
|
166
143
|
};
|
|
167
|
-
this.apiEvent.rule = this.eventManager.createRule(`${this.id}-api-to-eventbridge-target-rule`, this, this.props.event.rule, this.apiEvent.eventBus, [new
|
|
144
|
+
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)]);
|
|
168
145
|
}
|
|
169
146
|
createApiToEventBridgeTargetPolicy() {
|
|
170
|
-
this.apiToEventBridgeTargetRestApi.policy = new
|
|
147
|
+
this.apiToEventBridgeTargetRestApi.policy = new aws_iam_1.PolicyDocument({
|
|
171
148
|
statements: [this.iamManager.statementForPutEvents()],
|
|
172
149
|
});
|
|
173
150
|
}
|
|
@@ -177,8 +154,8 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
177
154
|
createApiToEventBridgeTargetRole() {
|
|
178
155
|
if (!this.apiToEventBridgeTargetRestApi.policy)
|
|
179
156
|
throw 'Policy undefined';
|
|
180
|
-
this.apiToEventBridgeTargetRestApi.role = new
|
|
181
|
-
assumedBy: new
|
|
157
|
+
this.apiToEventBridgeTargetRestApi.role = new aws_iam_1.Role(this, `${this.id}-rest-api-role`, {
|
|
158
|
+
assumedBy: new aws_iam_1.ServicePrincipal('apigateway.amazonaws.com'),
|
|
182
159
|
inlinePolicies: { policy: this.apiToEventBridgeTargetRestApi.policy },
|
|
183
160
|
});
|
|
184
161
|
}
|
|
@@ -200,7 +177,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
200
177
|
return;
|
|
201
178
|
this.apiToEventBridgeTargetRestApi.integrationRequestTemplates = {
|
|
202
179
|
'application/json': [
|
|
203
|
-
'#set($context.requestOverride.header.X-Amz-Target = "
|
|
180
|
+
'#set($context.requestOverride.header.X-Amz-Target = "AWSPutEvents")',
|
|
204
181
|
'#set($context.requestOverride.header.Content-Type = "application/x-amz-json-1.1")',
|
|
205
182
|
`{
|
|
206
183
|
"Entries": [
|
|
@@ -261,7 +238,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
261
238
|
createApiToEventBridgeTargetIntegration() {
|
|
262
239
|
if (!this.props.api.withResource)
|
|
263
240
|
return;
|
|
264
|
-
this.apiToEventBridgeTargetRestApi.integration = new
|
|
241
|
+
this.apiToEventBridgeTargetRestApi.integration = new aws_apigateway_1.Integration({
|
|
265
242
|
integrationHttpMethod: 'POST',
|
|
266
243
|
options: {
|
|
267
244
|
...{
|
|
@@ -270,13 +247,13 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
270
247
|
this.apiToEventBridgeTargetRestApi.integrationResponse,
|
|
271
248
|
this.apiToEventBridgeTargetRestApi.integrationErrorResponse,
|
|
272
249
|
],
|
|
273
|
-
passthroughBehavior:
|
|
250
|
+
passthroughBehavior: aws_apigateway_1.PassthroughBehavior.NEVER,
|
|
274
251
|
requestParameters: this.apiToEventBridgeTargetRestApi.integrationRequestParameters,
|
|
275
252
|
requestTemplates: this.apiToEventBridgeTargetRestApi.integrationRequestTemplates,
|
|
276
253
|
},
|
|
277
254
|
...this.props.api.integrationOptions,
|
|
278
255
|
},
|
|
279
|
-
type:
|
|
256
|
+
type: aws_apigateway_1.IntegrationType.AWS,
|
|
280
257
|
uri: `arn:aws:apigateway:${this.props.region}:events:path//`,
|
|
281
258
|
});
|
|
282
259
|
}
|
|
@@ -325,7 +302,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
325
302
|
createApiToEventBridgeTargetRestApiLogGroup() {
|
|
326
303
|
this.apiToEventBridgeTargetRestApi.accessLogGroup = this.logManager.createLogGroup(`${this.id}-rest-api-access-log`, this, {
|
|
327
304
|
logGroupName: `/custom/api/${this.id}-rest-api-access`,
|
|
328
|
-
removalPolicy:
|
|
305
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
329
306
|
});
|
|
330
307
|
}
|
|
331
308
|
/**
|
|
@@ -333,16 +310,16 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
333
310
|
*/
|
|
334
311
|
createApiToEventBridgeTargetRestApi() {
|
|
335
312
|
if (this.props.api.useExisting && this.props.api.importedRestApiRef) {
|
|
336
|
-
this.apiToEventBridgeTargetRestApi.api =
|
|
313
|
+
this.apiToEventBridgeTargetRestApi.api = aws_apigateway_1.RestApi.fromRestApiId(this, `${this.id}-rest-api`, aws_cdk_lib_1.Fn.importValue(this.props.api.importedRestApiRef));
|
|
337
314
|
return;
|
|
338
315
|
}
|
|
339
|
-
this.apiToEventBridgeTargetRestApi.api = new
|
|
316
|
+
this.apiToEventBridgeTargetRestApi.api = new aws_apigateway_1.RestApi(this, `${this.id}-rest-api`, {
|
|
340
317
|
...{
|
|
341
318
|
cloudWatchRole: this.props.api.restApi?.cloudWatchRole ?? true,
|
|
342
319
|
defaultCorsPreflightOptions: {
|
|
343
|
-
allowHeaders:
|
|
320
|
+
allowHeaders: aws_apigateway_1.Cors.DEFAULT_HEADERS,
|
|
344
321
|
allowMethods: ['POST'],
|
|
345
|
-
allowOrigins:
|
|
322
|
+
allowOrigins: aws_apigateway_1.Cors.ALL_ORIGINS,
|
|
346
323
|
},
|
|
347
324
|
defaultIntegration: this.apiToEventBridgeTargetRestApi.integration,
|
|
348
325
|
defaultMethodOptions: {
|
|
@@ -353,17 +330,17 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
353
330
|
},
|
|
354
331
|
deploy: this.props.api.restApi?.deploy ?? true,
|
|
355
332
|
deployOptions: {
|
|
356
|
-
accessLogDestination: new
|
|
357
|
-
accessLogFormat:
|
|
333
|
+
accessLogDestination: new aws_apigateway_1.LogGroupLogDestination(this.apiToEventBridgeTargetRestApi.accessLogGroup),
|
|
334
|
+
accessLogFormat: aws_apigateway_1.AccessLogFormat.jsonWithStandardFields(),
|
|
358
335
|
dataTraceEnabled: this.props.api.restApi?.deployOptions?.dataTraceEnabled,
|
|
359
336
|
description: `${this.id} - ${this.props.stage} stage`,
|
|
360
|
-
loggingLevel:
|
|
337
|
+
loggingLevel: aws_apigateway_1.MethodLoggingLevel.INFO,
|
|
361
338
|
metricsEnabled: true,
|
|
362
339
|
stageName: this.props.stage,
|
|
363
340
|
tracingEnabled: this.props.api.restApi?.deployOptions?.tracingEnabled,
|
|
364
341
|
},
|
|
365
342
|
endpointConfiguration: {
|
|
366
|
-
types: [
|
|
343
|
+
types: [aws_apigateway_1.EndpointType.REGIONAL],
|
|
367
344
|
},
|
|
368
345
|
restApiName: `${this.id}-rest-api-${this.props.stage}`,
|
|
369
346
|
},
|
|
@@ -378,16 +355,16 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
378
355
|
createApiToEventBridgeTargetResponseModel() {
|
|
379
356
|
if (!this.props.api.withResource)
|
|
380
357
|
return;
|
|
381
|
-
this.apiToEventBridgeTargetRestApi.responseModel = new
|
|
358
|
+
this.apiToEventBridgeTargetRestApi.responseModel = new aws_apigateway_1.Model(this, `${this.id}-response-model`, {
|
|
382
359
|
restApi: this.apiToEventBridgeTargetRestApi.api,
|
|
383
360
|
...{
|
|
384
361
|
contentType: 'application/json',
|
|
385
362
|
modelName: 'ResponseModel',
|
|
386
363
|
schema: {
|
|
387
|
-
properties: { message: { type:
|
|
388
|
-
schema:
|
|
364
|
+
properties: { message: { type: aws_apigateway_1.JsonSchemaType.STRING } },
|
|
365
|
+
schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
|
|
389
366
|
title: 'pollResponse',
|
|
390
|
-
type:
|
|
367
|
+
type: aws_apigateway_1.JsonSchemaType.OBJECT,
|
|
391
368
|
},
|
|
392
369
|
},
|
|
393
370
|
...this.props.api.responseModel,
|
|
@@ -399,19 +376,19 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
399
376
|
createApiToEventBridgeTargetErrorResponseModel() {
|
|
400
377
|
if (!this.props.api.withResource)
|
|
401
378
|
return;
|
|
402
|
-
this.apiToEventBridgeTargetRestApi.errorResponseModel = new
|
|
379
|
+
this.apiToEventBridgeTargetRestApi.errorResponseModel = new aws_apigateway_1.Model(this, `${this.id}-error-response-model`, {
|
|
403
380
|
restApi: this.apiToEventBridgeTargetRestApi.api,
|
|
404
381
|
...{
|
|
405
382
|
contentType: 'application/json',
|
|
406
383
|
modelName: 'ErrorResponseModel',
|
|
407
384
|
schema: {
|
|
408
385
|
properties: {
|
|
409
|
-
message: { type:
|
|
410
|
-
state: { type:
|
|
386
|
+
message: { type: aws_apigateway_1.JsonSchemaType.STRING },
|
|
387
|
+
state: { type: aws_apigateway_1.JsonSchemaType.STRING },
|
|
411
388
|
},
|
|
412
|
-
schema:
|
|
389
|
+
schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
|
|
413
390
|
title: 'errorResponse',
|
|
414
|
-
type:
|
|
391
|
+
type: aws_apigateway_1.JsonSchemaType.OBJECT,
|
|
415
392
|
},
|
|
416
393
|
},
|
|
417
394
|
...this.props.api.errorResponseModel,
|
|
@@ -425,9 +402,9 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
425
402
|
return;
|
|
426
403
|
let rootResource;
|
|
427
404
|
if (this.props.api.withResource && this.props.api.importedRestApiRootResourceRef) {
|
|
428
|
-
rootResource =
|
|
405
|
+
rootResource = aws_apigateway_1.Resource.fromResourceAttributes(this, `${this.id}-root-resource`, {
|
|
429
406
|
path: '/',
|
|
430
|
-
resourceId:
|
|
407
|
+
resourceId: aws_cdk_lib_1.Fn.importValue(this.props.api.importedRestApiRootResourceRef),
|
|
431
408
|
restApi: this.apiToEventBridgeTargetRestApi.api,
|
|
432
409
|
});
|
|
433
410
|
}
|
|
@@ -466,7 +443,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
466
443
|
createApiBasePathMapping() {
|
|
467
444
|
if (this.props.api.useExisting)
|
|
468
445
|
return;
|
|
469
|
-
new
|
|
446
|
+
new aws_apigateway_1.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
470
447
|
basePath: '',
|
|
471
448
|
domainName: this.apiToEventBridgeTargetRestApi.domain,
|
|
472
449
|
restApi: this.apiToEventBridgeTargetRestApi.api,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
|
|
2
|
+
import { IFunction, LayerVersion } from 'aws-cdk-lib/aws-lambda';
|
|
3
|
+
import { EventBridgeDestination } from 'aws-cdk-lib/aws-lambda-destinations';
|
|
4
4
|
import { ApiDestinedLambdaEnvironment, ApiDestinedLambdaType } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* @classdesc Provides a construct to contain lambda resources for ApiToEventBridgeTargetWithSns
|
|
7
7
|
*/
|
|
8
8
|
export declare class ApiDestinedLambda implements ApiDestinedLambdaType {
|
|
9
|
-
destinationFailure:
|
|
10
|
-
destinationSuccess:
|
|
9
|
+
destinationFailure: EventBridgeDestination;
|
|
10
|
+
destinationSuccess: EventBridgeDestination;
|
|
11
11
|
environment: ApiDestinedLambdaEnvironment;
|
|
12
|
-
function:
|
|
13
|
-
layers:
|
|
14
|
-
policy:
|
|
15
|
-
role:
|
|
12
|
+
function: IFunction;
|
|
13
|
+
layers: LayerVersion[];
|
|
14
|
+
policy: PolicyDocument;
|
|
15
|
+
role: Role;
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ISecret } from 'aws-cdk-lib/aws-secretsmanager';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
import { CommonConstruct } from '../../common';
|
|
4
4
|
import { ApiToEventBridgeTargetEventType, ApiToEventBridgeTargetProps, ApiToEventBridgeTargetRestApiType } from '../api-to-eventbridge-target';
|
|
@@ -24,7 +24,7 @@ import { ApiDestinedLambdaType } from './types';
|
|
|
24
24
|
export declare class ApiToEventBridgeTargetWithSns extends CommonConstruct {
|
|
25
25
|
props: ApiToEventBridgeTargetProps;
|
|
26
26
|
id: string;
|
|
27
|
-
applicationSecrets:
|
|
27
|
+
applicationSecrets: ISecret[];
|
|
28
28
|
apiDestinedLambda: ApiDestinedLambdaType;
|
|
29
29
|
apiEvent: ApiToEventBridgeTargetEventType;
|
|
30
30
|
apiDestinedRestApi: ApiToEventBridgeTargetRestApiType;
|
|
@@ -69,7 +69,7 @@ export declare class ApiToEventBridgeTargetWithSns extends CommonConstruct {
|
|
|
69
69
|
*/
|
|
70
70
|
protected createApiDestinedLambdaFunction(): void;
|
|
71
71
|
/**
|
|
72
|
-
* @summary Method to create or use an existing
|
|
72
|
+
* @summary Method to create or use an existing event bus for api destined payload deliveries
|
|
73
73
|
*/
|
|
74
74
|
protected createApiDestinedEventBus(): void;
|
|
75
75
|
/**
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.ApiToEventBridgeTargetWithSns = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
4
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
+
const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
|
|
6
|
+
const aws_events_1 = require("aws-cdk-lib/aws-events");
|
|
7
|
+
const aws_events_targets_1 = require("aws-cdk-lib/aws-events-targets");
|
|
8
|
+
const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
9
|
+
const aws_lambda_destinations_1 = require("aws-cdk-lib/aws-lambda-destinations");
|
|
33
10
|
const common_1 = require("../../common");
|
|
34
|
-
const api_destined_lambda_1 = require("./api-destined-lambda");
|
|
35
11
|
const api_to_eventbridge_target_1 = require("../api-to-eventbridge-target");
|
|
12
|
+
const api_destined_lambda_1 = require("./api-destined-lambda");
|
|
36
13
|
/**
|
|
37
14
|
* @deprecated Use ApiToEventBridgeTarget instead. This will be removed in a future release.
|
|
38
15
|
* @classdesc Provides a construct to create and deploy API Gateway invocations to EventBridge
|
|
@@ -143,7 +120,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
143
120
|
createApiDestinedLambdaPolicy() {
|
|
144
121
|
if (this.props.api.useExisting)
|
|
145
122
|
return;
|
|
146
|
-
this.apiDestinedLambda.policy = new
|
|
123
|
+
this.apiDestinedLambda.policy = new aws_iam_1.PolicyDocument({
|
|
147
124
|
statements: [this.iamManager.statementForPutEvents([this.apiEvent.eventBus.eventBusArn])],
|
|
148
125
|
});
|
|
149
126
|
}
|
|
@@ -186,8 +163,8 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
186
163
|
createApiDestinedLambdaDestinations() {
|
|
187
164
|
if (this.props.api.useExisting)
|
|
188
165
|
return;
|
|
189
|
-
this.apiDestinedLambda.destinationSuccess = new
|
|
190
|
-
this.apiDestinedLambda.destinationFailure = new
|
|
166
|
+
this.apiDestinedLambda.destinationSuccess = new aws_lambda_destinations_1.EventBridgeDestination(this.apiEvent.eventBus);
|
|
167
|
+
this.apiDestinedLambda.destinationFailure = new aws_lambda_destinations_1.EventBridgeDestination(this.apiEvent.eventBus);
|
|
191
168
|
}
|
|
192
169
|
/**
|
|
193
170
|
* @summary Method to create lambda function for Api Destined
|
|
@@ -206,11 +183,11 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
206
183
|
}, this.apiDestinedLambda.role, this.apiDestinedLambda.layers, this.props.lambda.source, this.props.lambda.handler ?? 'lambda.handler', this.apiDestinedLambda.environment);
|
|
207
184
|
}
|
|
208
185
|
/**
|
|
209
|
-
* @summary Method to create or use an existing
|
|
186
|
+
* @summary Method to create or use an existing event bus for api destined payload deliveries
|
|
210
187
|
*/
|
|
211
188
|
createApiDestinedEventBus() {
|
|
212
189
|
if (this.props.api.useExisting) {
|
|
213
|
-
this.apiEvent.eventBus =
|
|
190
|
+
this.apiEvent.eventBus = aws_events_1.EventBus.fromEventBusName(this, `${this.id}-destined-event-bus`, `${this.props.event.eventBusName}-${this.props.stage}`);
|
|
214
191
|
return;
|
|
215
192
|
}
|
|
216
193
|
this.apiEvent.eventBus = this.eventManager.createEventBus(`${this.id}-destined-event-bus`, this, {
|
|
@@ -253,7 +230,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
253
230
|
},
|
|
254
231
|
...this.props.event.ruleSuccess,
|
|
255
232
|
};
|
|
256
|
-
this.apiEvent.ruleSuccess = this.eventManager.createRule(`${this.id}-api-destination-rule-success`, this, this.props.event.ruleSuccess, this.apiEvent.eventBus, [new
|
|
233
|
+
this.apiEvent.ruleSuccess = this.eventManager.createRule(`${this.id}-api-destination-rule-success`, this, this.props.event.ruleSuccess, this.apiEvent.eventBus, [new aws_events_targets_1.CloudWatchLogGroup(this.apiEvent.logGroupSuccess)]);
|
|
257
234
|
}
|
|
258
235
|
/**
|
|
259
236
|
* @summary Method to create a log group for failed api destined payload deliveries
|
|
@@ -287,14 +264,14 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
287
264
|
},
|
|
288
265
|
...this.props.event.ruleFailure,
|
|
289
266
|
};
|
|
290
|
-
this.apiEvent.ruleFailure = this.eventManager.createRule(`${this.id}-api-destination-rule-failure`, this, this.props.event.ruleFailure, this.apiEvent.eventBus, [new
|
|
267
|
+
this.apiEvent.ruleFailure = this.eventManager.createRule(`${this.id}-api-destination-rule-failure`, this, this.props.event.ruleFailure, this.apiEvent.eventBus, [new aws_events_targets_1.CloudWatchLogGroup(this.apiEvent.logGroupFailure)]);
|
|
291
268
|
}
|
|
292
269
|
/**
|
|
293
270
|
* @summary Method to create a role for sns topic
|
|
294
271
|
*/
|
|
295
272
|
createApiDestinedTopicRole() {
|
|
296
|
-
this.apiDestinedRestApi.role = new
|
|
297
|
-
assumedBy: new
|
|
273
|
+
this.apiDestinedRestApi.role = new aws_iam_1.Role(this, `${this.id}-sns-rest-api-role`, {
|
|
274
|
+
assumedBy: new aws_iam_1.ServicePrincipal('apigateway.amazonaws.com'),
|
|
298
275
|
});
|
|
299
276
|
}
|
|
300
277
|
/**
|
|
@@ -383,7 +360,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
383
360
|
createApiDestinedIntegration() {
|
|
384
361
|
if (!this.props.api.withResource)
|
|
385
362
|
return;
|
|
386
|
-
this.apiDestinedRestApi.integration = new
|
|
363
|
+
this.apiDestinedRestApi.integration = new aws_apigateway_1.Integration({
|
|
387
364
|
integrationHttpMethod: 'POST',
|
|
388
365
|
options: {
|
|
389
366
|
...{
|
|
@@ -392,13 +369,13 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
392
369
|
this.apiDestinedRestApi.integrationResponse,
|
|
393
370
|
this.apiDestinedRestApi.integrationErrorResponse,
|
|
394
371
|
],
|
|
395
|
-
passthroughBehavior:
|
|
372
|
+
passthroughBehavior: aws_apigateway_1.PassthroughBehavior.NEVER,
|
|
396
373
|
requestParameters: this.apiDestinedRestApi.integrationRequestParameters,
|
|
397
374
|
requestTemplates: this.apiDestinedRestApi.integrationRequestTemplates,
|
|
398
375
|
},
|
|
399
376
|
...this.props.api.integrationOptions,
|
|
400
377
|
},
|
|
401
|
-
type:
|
|
378
|
+
type: aws_apigateway_1.IntegrationType.AWS,
|
|
402
379
|
uri: `arn:aws:apigateway:${this.props.region}:sns:path//`,
|
|
403
380
|
});
|
|
404
381
|
}
|
|
@@ -449,35 +426,35 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
449
426
|
*/
|
|
450
427
|
createApiDestinedRestApi() {
|
|
451
428
|
if (this.props.api.useExisting && this.props.api.importedRestApiRef) {
|
|
452
|
-
this.apiDestinedRestApi.api =
|
|
429
|
+
this.apiDestinedRestApi.api = aws_apigateway_1.RestApi.fromRestApiId(this, `${this.id}-sns-rest-api`, aws_cdk_lib_1.Fn.importValue(this.props.api.importedRestApiRef));
|
|
453
430
|
return;
|
|
454
431
|
}
|
|
455
432
|
const accessLogGroup = this.logManager.createLogGroup(`${this.id}-sns-rest-api-access-log`, this, {
|
|
456
433
|
logGroupName: `/custom/api/${this.id}-destined-rest-api-access`,
|
|
457
|
-
removalPolicy:
|
|
434
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
458
435
|
});
|
|
459
|
-
this.apiDestinedRestApi.api = new
|
|
436
|
+
this.apiDestinedRestApi.api = new aws_apigateway_1.RestApi(this, `${this.id}-sns-rest-api`, {
|
|
460
437
|
...{
|
|
461
438
|
defaultCorsPreflightOptions: {
|
|
462
|
-
allowHeaders:
|
|
439
|
+
allowHeaders: aws_apigateway_1.Cors.DEFAULT_HEADERS,
|
|
463
440
|
allowMethods: ['POST'],
|
|
464
|
-
allowOrigins:
|
|
441
|
+
allowOrigins: aws_apigateway_1.Cors.ALL_ORIGINS,
|
|
465
442
|
},
|
|
466
443
|
defaultIntegration: this.apiDestinedRestApi.integration,
|
|
467
444
|
defaultMethodOptions: {
|
|
468
445
|
methodResponses: [this.apiDestinedRestApi.methodResponse, this.apiDestinedRestApi.methodErrorResponse],
|
|
469
446
|
},
|
|
470
447
|
deployOptions: {
|
|
471
|
-
accessLogDestination: new
|
|
472
|
-
accessLogFormat:
|
|
448
|
+
accessLogDestination: new aws_apigateway_1.LogGroupLogDestination(accessLogGroup),
|
|
449
|
+
accessLogFormat: aws_apigateway_1.AccessLogFormat.jsonWithStandardFields(),
|
|
473
450
|
dataTraceEnabled: true,
|
|
474
451
|
description: `${this.id} - ${this.props.stage} stage`,
|
|
475
|
-
loggingLevel:
|
|
452
|
+
loggingLevel: aws_apigateway_1.MethodLoggingLevel.INFO,
|
|
476
453
|
metricsEnabled: true,
|
|
477
454
|
stageName: this.props.stage,
|
|
478
455
|
},
|
|
479
456
|
endpointConfiguration: {
|
|
480
|
-
types: [
|
|
457
|
+
types: [aws_apigateway_1.EndpointType.REGIONAL],
|
|
481
458
|
},
|
|
482
459
|
restApiName: `${this.id}-destined-rest-api-${this.props.stage}`,
|
|
483
460
|
},
|
|
@@ -492,16 +469,16 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
492
469
|
createApiDestinedResponseModel() {
|
|
493
470
|
if (!this.props.api.withResource)
|
|
494
471
|
return;
|
|
495
|
-
this.apiDestinedRestApi.responseModel = new
|
|
472
|
+
this.apiDestinedRestApi.responseModel = new aws_apigateway_1.Model(this, `${this.id}-response-model`, {
|
|
496
473
|
restApi: this.apiDestinedRestApi.api,
|
|
497
474
|
...{
|
|
498
475
|
contentType: 'application/json',
|
|
499
476
|
modelName: 'ResponseModel',
|
|
500
477
|
schema: {
|
|
501
|
-
properties: { message: { type:
|
|
502
|
-
schema:
|
|
478
|
+
properties: { message: { type: aws_apigateway_1.JsonSchemaType.STRING } },
|
|
479
|
+
schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
|
|
503
480
|
title: 'pollResponse',
|
|
504
|
-
type:
|
|
481
|
+
type: aws_apigateway_1.JsonSchemaType.OBJECT,
|
|
505
482
|
},
|
|
506
483
|
},
|
|
507
484
|
...this.props.api.responseModel,
|
|
@@ -513,19 +490,19 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
513
490
|
createApiDestinedErrorResponseModel() {
|
|
514
491
|
if (!this.props.api.withResource)
|
|
515
492
|
return;
|
|
516
|
-
this.apiDestinedRestApi.errorResponseModel = new
|
|
493
|
+
this.apiDestinedRestApi.errorResponseModel = new aws_apigateway_1.Model(this, `${this.id}-error-response-model`, {
|
|
517
494
|
restApi: this.apiDestinedRestApi.api,
|
|
518
495
|
...{
|
|
519
496
|
contentType: 'application/json',
|
|
520
497
|
modelName: 'ErrorResponseModel',
|
|
521
498
|
schema: {
|
|
522
499
|
properties: {
|
|
523
|
-
message: { type:
|
|
524
|
-
state: { type:
|
|
500
|
+
message: { type: aws_apigateway_1.JsonSchemaType.STRING },
|
|
501
|
+
state: { type: aws_apigateway_1.JsonSchemaType.STRING },
|
|
525
502
|
},
|
|
526
|
-
schema:
|
|
503
|
+
schema: aws_apigateway_1.JsonSchemaVersion.DRAFT4,
|
|
527
504
|
title: 'errorResponse',
|
|
528
|
-
type:
|
|
505
|
+
type: aws_apigateway_1.JsonSchemaType.OBJECT,
|
|
529
506
|
},
|
|
530
507
|
},
|
|
531
508
|
...this.props.api.errorResponseModel,
|
|
@@ -539,9 +516,9 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
539
516
|
return;
|
|
540
517
|
let rootResource;
|
|
541
518
|
if (this.props.api.withResource && this.props.api.importedRestApiRootResourceRef) {
|
|
542
|
-
rootResource =
|
|
519
|
+
rootResource = aws_apigateway_1.Resource.fromResourceAttributes(this, `${this.id}-root-resource`, {
|
|
543
520
|
path: '/',
|
|
544
|
-
resourceId:
|
|
521
|
+
resourceId: aws_cdk_lib_1.Fn.importValue(this.props.api.importedRestApiRootResourceRef),
|
|
545
522
|
restApi: this.apiDestinedRestApi.api,
|
|
546
523
|
});
|
|
547
524
|
}
|
|
@@ -577,7 +554,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
577
554
|
createApiBasePathMapping() {
|
|
578
555
|
if (this.props.api.useExisting)
|
|
579
556
|
return;
|
|
580
|
-
new
|
|
557
|
+
new aws_apigateway_1.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
581
558
|
basePath: '',
|
|
582
559
|
domainName: this.apiDestinedRestApi.domain,
|
|
583
560
|
restApi: this.apiDestinedRestApi.api,
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { BasePathMapping, DomainName, Integration, IntegrationResponse, Method, MethodResponse, Model, Resource, RestApi } from 'aws-cdk-lib/aws-apigateway';
|
|
2
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
3
|
+
import { Role } from 'aws-cdk-lib/aws-iam';
|
|
4
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
5
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53';
|
|
6
|
+
import { Topic } from 'aws-cdk-lib/aws-sns';
|
|
7
7
|
import { ApiToLambdaTargetRestApiType } from './types';
|
|
8
8
|
/**
|
|
9
9
|
* @classdesc Provides a construct to contain api resources for ApiToLambdaTarget
|
|
10
10
|
*/
|
|
11
11
|
export declare class ApiToLambdaTargetRestApi implements ApiToLambdaTargetRestApiType {
|
|
12
|
-
api:
|
|
13
|
-
basePathMappings:
|
|
14
|
-
certificate:
|
|
15
|
-
domain:
|
|
16
|
-
errorResponseModel:
|
|
17
|
-
hostedZone:
|
|
18
|
-
integration:
|
|
19
|
-
integrationErrorResponse:
|
|
12
|
+
api: RestApi;
|
|
13
|
+
basePathMappings: BasePathMapping[];
|
|
14
|
+
certificate: ICertificate;
|
|
15
|
+
domain: DomainName;
|
|
16
|
+
errorResponseModel: Model;
|
|
17
|
+
hostedZone: IHostedZone;
|
|
18
|
+
integration: Integration;
|
|
19
|
+
integrationErrorResponse: IntegrationResponse;
|
|
20
20
|
integrationRequestParameters: {
|
|
21
21
|
[p: string]: string;
|
|
22
22
|
};
|
|
23
23
|
integrationRequestTemplates: {
|
|
24
24
|
[p: string]: string;
|
|
25
25
|
};
|
|
26
|
-
integrationResponse:
|
|
27
|
-
lambda:
|
|
28
|
-
method:
|
|
29
|
-
methodErrorResponse:
|
|
30
|
-
methodResponse:
|
|
31
|
-
resource:
|
|
32
|
-
responseModel:
|
|
33
|
-
topic:
|
|
34
|
-
role:
|
|
26
|
+
integrationResponse: IntegrationResponse;
|
|
27
|
+
lambda: IFunction;
|
|
28
|
+
method: Method;
|
|
29
|
+
methodErrorResponse: MethodResponse;
|
|
30
|
+
methodResponse: MethodResponse;
|
|
31
|
+
resource: Resource;
|
|
32
|
+
responseModel: Model;
|
|
33
|
+
topic: Topic;
|
|
34
|
+
role: Role;
|
|
35
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ISecret } from 'aws-cdk-lib/aws-secretsmanager';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
import { CommonConstruct } from '../../common';
|
|
4
4
|
import { ApiToLambdaTargetProps, ApiToLambdaTargetRestApiType } from './types';
|
|
@@ -7,7 +7,7 @@ import { ApiToLambdaTargetProps, ApiToLambdaTargetRestApiType } from './types';
|
|
|
7
7
|
export declare class ApiToLambdaTarget extends CommonConstruct {
|
|
8
8
|
props: ApiToLambdaTargetProps;
|
|
9
9
|
id: string;
|
|
10
|
-
applicationSecrets:
|
|
10
|
+
applicationSecrets: ISecret[];
|
|
11
11
|
apiToLambdaTargetRestApi: ApiToLambdaTargetRestApiType;
|
|
12
12
|
apiResource: string;
|
|
13
13
|
constructor(parent: Construct, id: string, props: ApiToLambdaTargetProps);
|