@gradientedge/cdk-utils 5.13.0 → 6.0.1
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/construct/api-to-eventbridge-target/index.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/index.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +23 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +124 -243
- package/dist/src/lib/construct/{api-to-eventbridge-target → api-to-eventbridge-target-with-sns}/api-destined-lambda.d.ts +1 -1
- package/dist/src/lib/construct/{api-to-eventbridge-target → api-to-eventbridge-target-with-sns}/api-destined-lambda.js +1 -1
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/index.d.ts +2 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/index.js +18 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +193 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +631 -0
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -1
- package/dist/src/lib/construct/index.d.ts +1 -0
- package/dist/src/lib/construct/index.js +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +1 -1
- package/dist/src/lib/{construct/api-to-eventbridge-target/api-destination-event.d.ts → helper/api-to-eventbridge-target-event.d.ts} +5 -3
- package/dist/src/lib/{construct/api-to-eventbridge-target/api-destination-event.js → helper/api-to-eventbridge-target-event.js} +6 -4
- package/dist/src/lib/{construct/api-to-eventbridge-target/api-destined-rest-api.d.ts → helper/api-to-eventbridge-target-rest-api.d.ts} +4 -4
- package/dist/src/lib/{construct/api-to-eventbridge-target/api-destined-rest-api.js → helper/api-to-eventbridge-target-rest-api.js} +5 -5
- package/dist/src/lib/helper/index.d.ts +2 -0
- package/dist/src/lib/helper/index.js +18 -0
- package/dist/src/lib/manager/aws/ecs-manager.js +5 -0
- package/dist/src/lib/manager/aws/sqs-manager.js +0 -1
- package/dist/src/lib/types/aws/index.d.ts +10 -5
- package/package.json +11 -11
- package/src/lib/construct/api-to-eventbridge-target/index.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +131 -280
- package/src/lib/construct/{api-to-eventbridge-target → api-to-eventbridge-target-with-sns}/api-destined-lambda.ts +1 -1
- package/src/lib/construct/api-to-eventbridge-target-with-sns/index.ts +2 -0
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +703 -0
- package/src/lib/construct/graphql-api-lambda/main.ts +1 -1
- package/src/lib/construct/index.ts +1 -0
- package/src/lib/construct/site-with-ecs-backend/main.ts +1 -1
- package/src/lib/{construct/api-to-eventbridge-target/api-destination-event.ts → helper/api-to-eventbridge-target-event.ts} +5 -3
- package/src/lib/{construct/api-to-eventbridge-target/api-destined-rest-api.ts → helper/api-to-eventbridge-target-rest-api.ts} +4 -4
- package/src/lib/helper/index.ts +2 -0
- package/src/lib/manager/aws/ecs-manager.ts +5 -0
- package/src/lib/manager/aws/sqs-manager.ts +0 -2
- package/src/lib/types/aws/index.ts +10 -5
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ApiToEventbridgeTargetEvent = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @stability stable
|
|
6
6
|
* @category cdk-utils.api-to-eventbridge-target
|
|
7
7
|
* @subcategory member
|
|
8
|
-
* @classdesc Provides a construct to contain event resources for
|
|
8
|
+
* @classdesc Provides a construct to contain event resources for ApiToEventBridgeTargetWithSns
|
|
9
9
|
*/
|
|
10
|
-
class
|
|
10
|
+
class ApiToEventbridgeTargetEvent {
|
|
11
11
|
eventBus;
|
|
12
|
+
logGroup;
|
|
12
13
|
logGroupFailure;
|
|
13
14
|
logGroupSuccess;
|
|
15
|
+
rule;
|
|
14
16
|
ruleFailure;
|
|
15
17
|
ruleSuccess;
|
|
16
18
|
}
|
|
17
|
-
exports.
|
|
19
|
+
exports.ApiToEventbridgeTargetEvent = ApiToEventbridgeTargetEvent;
|
|
@@ -3,14 +3,14 @@ import * as acm from 'aws-cdk-lib/aws-certificatemanager';
|
|
|
3
3
|
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
4
4
|
import * as route53 from 'aws-cdk-lib/aws-route53';
|
|
5
5
|
import * as sns from 'aws-cdk-lib/aws-sns';
|
|
6
|
-
import * as types from '
|
|
6
|
+
import * as types from '../types/aws';
|
|
7
7
|
/**
|
|
8
8
|
* @stability stable
|
|
9
9
|
* @category cdk-utils.api-to-eventbridge-target
|
|
10
10
|
* @subcategory member
|
|
11
|
-
* @classdesc Provides a construct to contain api resources for
|
|
11
|
+
* @classdesc Provides a construct to contain api resources for ApiToEventBridgeTargetWithSns
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class ApiToEventbridgeTargetRestApi implements types.ApiToEventBridgeTargetRestApiType {
|
|
14
14
|
api: apig.RestApi;
|
|
15
15
|
certificate: acm.ICertificate;
|
|
16
16
|
domain: apig.DomainName;
|
|
@@ -31,5 +31,5 @@ export declare class ApiDestinedRestApi implements types.ApiDestinedRestApiType
|
|
|
31
31
|
resource: apig.Resource;
|
|
32
32
|
responseModel: apig.Model;
|
|
33
33
|
topic: sns.Topic;
|
|
34
|
-
|
|
34
|
+
role: iam.Role;
|
|
35
35
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ApiToEventbridgeTargetRestApi = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @stability stable
|
|
6
6
|
* @category cdk-utils.api-to-eventbridge-target
|
|
7
7
|
* @subcategory member
|
|
8
|
-
* @classdesc Provides a construct to contain api resources for
|
|
8
|
+
* @classdesc Provides a construct to contain api resources for ApiToEventBridgeTargetWithSns
|
|
9
9
|
*/
|
|
10
|
-
class
|
|
10
|
+
class ApiToEventbridgeTargetRestApi {
|
|
11
11
|
api;
|
|
12
12
|
certificate;
|
|
13
13
|
domain;
|
|
@@ -24,6 +24,6 @@ class ApiDestinedRestApi {
|
|
|
24
24
|
resource;
|
|
25
25
|
responseModel;
|
|
26
26
|
topic;
|
|
27
|
-
|
|
27
|
+
role;
|
|
28
28
|
}
|
|
29
|
-
exports.
|
|
29
|
+
exports.ApiToEventbridgeTargetRestApi = ApiToEventbridgeTargetRestApi;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api-to-eventbridge-target-event"), exports);
|
|
18
|
+
__exportStar(require("./api-to-eventbridge-target-rest-api"), exports);
|
|
@@ -60,6 +60,11 @@ class EcsManager {
|
|
|
60
60
|
const ecsCluster = new ecs.Cluster(scope, `${id}`, {
|
|
61
61
|
clusterName: `${props.clusterName}-${scope.props.stage}`,
|
|
62
62
|
vpc: vpc,
|
|
63
|
+
defaultCloudMapNamespace: props.defaultCloudMapNamespace,
|
|
64
|
+
capacity: props.capacity,
|
|
65
|
+
enableFargateCapacityProviders: props.enableFargateCapacityProviders,
|
|
66
|
+
containerInsights: props.containerInsights,
|
|
67
|
+
executeCommandConfiguration: props.executeCommandConfiguration,
|
|
63
68
|
});
|
|
64
69
|
utils.createCfnOutput(`${id}-clusterArn`, scope, ecsCluster.clusterArn);
|
|
65
70
|
utils.createCfnOutput(`${id}-clusterName`, scope, ecsCluster.clusterName);
|
|
@@ -58,7 +58,6 @@ class SqsManager {
|
|
|
58
58
|
createQueue(id, scope, props, deadLetterQueue) {
|
|
59
59
|
if (!props)
|
|
60
60
|
throw `Queue props undefined`;
|
|
61
|
-
console.log(props);
|
|
62
61
|
const queue = new sqs.Queue(scope, id, {
|
|
63
62
|
queueName: props.queueName,
|
|
64
63
|
visibilityTimeout: props.visibilityTimeoutInSecs
|
|
@@ -225,10 +225,12 @@ export interface GraphQlApiLambdaWithCacheProps extends GraphQlApiLambdaProps {
|
|
|
225
225
|
* @category cdk-utils.api-to-eventbridge-target
|
|
226
226
|
* @subcategory Types
|
|
227
227
|
*/
|
|
228
|
-
export interface
|
|
228
|
+
export interface ApiToEventBridgeTargetEventType {
|
|
229
229
|
eventBus: events.IEventBus;
|
|
230
|
+
logGroup: logs.LogGroup;
|
|
230
231
|
logGroupFailure: logs.LogGroup;
|
|
231
232
|
logGroupSuccess: logs.LogGroup;
|
|
233
|
+
rule: events.Rule;
|
|
232
234
|
ruleFailure: events.Rule;
|
|
233
235
|
ruleSuccess: events.Rule;
|
|
234
236
|
}
|
|
@@ -236,7 +238,7 @@ export interface ApiDestinationEventType {
|
|
|
236
238
|
* @category cdk-utils.api-to-eventbridge-target
|
|
237
239
|
* @subcategory Types
|
|
238
240
|
*/
|
|
239
|
-
export interface
|
|
241
|
+
export interface ApiToEventBridgeTargetRestApiType {
|
|
240
242
|
api: apig.IRestApi;
|
|
241
243
|
authoriser?: apig.IAuthorizer;
|
|
242
244
|
certificate: acm.ICertificate;
|
|
@@ -257,8 +259,9 @@ export interface ApiDestinedRestApiType {
|
|
|
257
259
|
methodResponse: apig.MethodResponse;
|
|
258
260
|
resource: apig.Resource;
|
|
259
261
|
responseModel: apig.Model;
|
|
260
|
-
topic
|
|
261
|
-
|
|
262
|
+
topic?: sns.ITopic;
|
|
263
|
+
role?: iam.Role;
|
|
264
|
+
policy?: iam.PolicyDocument;
|
|
262
265
|
}
|
|
263
266
|
/**
|
|
264
267
|
* @category cdk-utils.api-to-eventbridge-target
|
|
@@ -311,8 +314,10 @@ interface ApiToEventBridgeTargetLambdaProps {
|
|
|
311
314
|
*/
|
|
312
315
|
interface ApiToEventBridgeTargetEventProps {
|
|
313
316
|
eventBusName?: string;
|
|
317
|
+
logGroup?: LogProps;
|
|
314
318
|
logGroupSuccess?: LogProps;
|
|
315
319
|
logGroupFailure?: LogProps;
|
|
320
|
+
rule: EventRuleProps;
|
|
316
321
|
ruleSuccess: EventRuleProps;
|
|
317
322
|
ruleFailure: EventRuleProps;
|
|
318
323
|
}
|
|
@@ -325,7 +330,7 @@ export interface ApiToEventBridgeTargetProps extends CommonStackProps {
|
|
|
325
330
|
apiSubDomain: string;
|
|
326
331
|
api: ApiToEventBridgeTargetRestApiProps;
|
|
327
332
|
event: ApiToEventBridgeTargetEventProps;
|
|
328
|
-
lambda
|
|
333
|
+
lambda?: ApiToEventBridgeTargetLambdaProps;
|
|
329
334
|
logLevel: string;
|
|
330
335
|
nodeEnv: string;
|
|
331
336
|
timezone: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@types/lodash": "^4.14.182",
|
|
49
|
-
"@types/node": "^18.6.
|
|
49
|
+
"@types/node": "^18.6.4",
|
|
50
50
|
"app-root-path": "^3.0.0",
|
|
51
|
-
"aws-cdk-lib": "^2.
|
|
52
|
-
"aws-sdk": "^2.
|
|
53
|
-
"constructs": "^10.1.
|
|
51
|
+
"aws-cdk-lib": "^2.35.0",
|
|
52
|
+
"aws-sdk": "^2.1189.0",
|
|
53
|
+
"constructs": "^10.1.67",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"moment": "^2.29.4",
|
|
56
56
|
"nconf": "^0.12.0",
|
|
@@ -60,27 +60,27 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
62
62
|
"@types/jest": "^28.1.6",
|
|
63
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
64
|
-
"@typescript-eslint/parser": "^5.
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
64
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
65
65
|
"aws-cdk": "*",
|
|
66
66
|
"babel-eslint": "^10.1.0",
|
|
67
67
|
"better-docs": "^2.7.2",
|
|
68
68
|
"codecov": "^3.8.3",
|
|
69
69
|
"commitizen": "^4.2.5",
|
|
70
70
|
"dotenv": "^16.0.1",
|
|
71
|
-
"eslint": "^8.
|
|
71
|
+
"eslint": "^8.21.0",
|
|
72
72
|
"eslint-config-prettier": "^8.5.0",
|
|
73
73
|
"eslint-plugin-import": "^2.26.0",
|
|
74
74
|
"husky": "^8.0.1",
|
|
75
75
|
"jest": "^28.1.3",
|
|
76
|
-
"jest-extended": "^3.0.
|
|
76
|
+
"jest-extended": "^3.0.2",
|
|
77
77
|
"jest-junit": "^14.0.0",
|
|
78
78
|
"jsdoc": "^3.6.11",
|
|
79
79
|
"jsdoc-babel": "^0.5.0",
|
|
80
80
|
"jsdoc-mermaid": "^1.0.0",
|
|
81
81
|
"lerna": "^5.3.0",
|
|
82
82
|
"prettier": "^2.7.1",
|
|
83
|
-
"prettier-plugin-organize-imports": "^3.0.
|
|
83
|
+
"prettier-plugin-organize-imports": "^3.0.1",
|
|
84
84
|
"rimraf": "^3.0.2",
|
|
85
85
|
"semantic-release": "^19.0.3",
|
|
86
86
|
"ts-jest": "^28.0.7",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"typescript": "4.7.4"
|
|
89
89
|
},
|
|
90
90
|
"optionalDependencies": {
|
|
91
|
-
"@babel/core": "^7.18.
|
|
91
|
+
"@babel/core": "^7.18.10",
|
|
92
92
|
"prop-types": "^15.8.1",
|
|
93
93
|
"react": "^18.2.0",
|
|
94
94
|
"react-dom": "^18.2.0"
|