@gradientedge/cdk-utils 8.91.0 → 8.92.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/.eslintrc.json +40 -0
- package/app/api-destined-function/src/lib/lambda.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
- package/dist/lib/lambda.d.ts +6 -6
- package/dist/lib/lambda.js +6 -6
- package/dist/lib/lambda.js.map +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -7
- package/dist/src/lib/common/construct.js +4 -7
- package/dist/src/lib/common/stack.d.ts +9 -13
- package/dist/src/lib/common/stack.js +9 -13
- package/dist/src/lib/common/types.d.ts +0 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
- package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
- package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
- package/dist/src/lib/construct/static-site/main.d.ts +0 -17
- package/dist/src/lib/construct/static-site/main.js +1 -18
- package/dist/src/lib/construct/static-site/types.d.ts +9 -11
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
- package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
- package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
- package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
- package/dist/src/lib/services/aws/appconfig/main.js +19 -22
- package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
- package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
- package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
- package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
- package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
- package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
- package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
- package/dist/src/lib/services/aws/codebuild/main.js +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
- package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
- package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
- package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
- package/dist/src/lib/services/aws/elasticache/main.js +35 -39
- package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
- package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
- package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
- package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
- package/dist/src/lib/services/aws/evidently/main.js +19 -23
- package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
- package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
- package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
- package/dist/src/lib/services/aws/lambda/main.js +64 -69
- package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
- package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
- package/dist/src/lib/services/aws/route53/main.js +19 -23
- package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
- package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
- package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
- package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
- package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
- package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
- package/dist/src/lib/services/aws/step-function/main.js +91 -95
- package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
- package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
- package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
- package/dist/src/lib/types/aws/index.d.ts +0 -2
- package/dist/src/lib/utils/aws/index.d.ts +6 -9
- package/dist/src/lib/utils/aws/index.js +7 -10
- package/dist/src/lib/utils/index.d.ts +6 -13
- package/dist/src/lib/utils/index.js +4 -12
- package/package.json +1 -1
- package/src/lib/common/construct.ts +4 -7
- package/src/lib/common/stack.ts +9 -13
- package/src/lib/common/types.ts +0 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
- package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
- package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
- package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
- package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
- package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
- package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
- package/src/lib/construct/rest-api-lambda/main.ts +1 -19
- package/src/lib/construct/rest-api-lambda/types.ts +6 -10
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
- package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
- package/src/lib/construct/static-asset-deployment/main.ts +0 -8
- package/src/lib/construct/static-asset-deployment/types.ts +1 -1
- package/src/lib/construct/static-site/main.ts +1 -18
- package/src/lib/construct/static-site/types.ts +9 -11
- package/src/lib/services/aws/api-gateway/main.ts +43 -47
- package/src/lib/services/aws/api-gateway/types.ts +0 -2
- package/src/lib/services/aws/appconfig/constants.ts +26 -32
- package/src/lib/services/aws/appconfig/main.ts +19 -22
- package/src/lib/services/aws/appconfig/types.ts +1 -3
- package/src/lib/services/aws/certificate-manager/main.ts +5 -10
- package/src/lib/services/aws/certificate-manager/types.ts +3 -5
- package/src/lib/services/aws/cloudfront/main.ts +56 -62
- package/src/lib/services/aws/cloudfront/types.ts +1 -7
- package/src/lib/services/aws/cloudtrail/main.ts +8 -12
- package/src/lib/services/aws/cloudtrail/types.ts +0 -2
- package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
- package/src/lib/services/aws/cloudwatch/main.ts +116 -122
- package/src/lib/services/aws/cloudwatch/types.ts +20 -42
- package/src/lib/services/aws/codebuild/main.ts +3 -7
- package/src/lib/services/aws/dynamodb/main.ts +13 -17
- package/src/lib/services/aws/dynamodb/types.ts +0 -2
- package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
- package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
- package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
- package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
- package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
- package/src/lib/services/aws/elasticache/main.ts +35 -39
- package/src/lib/services/aws/elasticache/types.ts +0 -4
- package/src/lib/services/aws/eventbridge/main.ts +34 -38
- package/src/lib/services/aws/eventbridge/target.ts +8 -11
- package/src/lib/services/aws/eventbridge/types.ts +2 -10
- package/src/lib/services/aws/evidently/main.ts +19 -23
- package/src/lib/services/aws/evidently/types.ts +0 -10
- package/src/lib/services/aws/identity-access-management/main.ts +97 -101
- package/src/lib/services/aws/key-management-service/main.ts +6 -10
- package/src/lib/services/aws/key-management-service/types.ts +0 -2
- package/src/lib/services/aws/lambda/main.ts +64 -69
- package/src/lib/services/aws/lambda/types.ts +6 -16
- package/src/lib/services/aws/route53/main.ts +19 -23
- package/src/lib/services/aws/route53/types.ts +0 -2
- package/src/lib/services/aws/secrets-manager/main.ts +6 -28
- package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
- package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
- package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
- package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
- package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
- package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
- package/src/lib/services/aws/step-function/main.ts +91 -95
- package/src/lib/services/aws/step-function/types.ts +0 -32
- package/src/lib/services/aws/systems-manager/main.ts +13 -19
- package/src/lib/services/aws/systems-manager/types.ts +0 -2
- package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
- package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
- package/src/lib/types/aws/index.ts +0 -2
- package/src/lib/utils/aws/index.ts +7 -10
- package/src/lib/utils/index.ts +4 -12
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"es2021": true,
|
|
4
|
+
"node": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:@typescript-eslint/recommended",
|
|
9
|
+
"prettier",
|
|
10
|
+
"plugin:jsdoc/recommended-typescript"
|
|
11
|
+
],
|
|
12
|
+
"parser": "@typescript-eslint/parser",
|
|
13
|
+
"parserOptions": {
|
|
14
|
+
"ecmaVersion": 12,
|
|
15
|
+
"sourceType": "module"
|
|
16
|
+
},
|
|
17
|
+
"plugins": ["@typescript-eslint", "jsdoc"],
|
|
18
|
+
"rules": {
|
|
19
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
20
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
21
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
22
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
23
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
24
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
25
|
+
"jsdoc/require-param-description": "off",
|
|
26
|
+
"jsdoc/require-returns": "off",
|
|
27
|
+
"jsdoc/check-tag-names": "off",
|
|
28
|
+
"jsdoc/require-returns-description": "off",
|
|
29
|
+
"no-empty": "off",
|
|
30
|
+
"sort-keys": [
|
|
31
|
+
"error",
|
|
32
|
+
"asc",
|
|
33
|
+
{
|
|
34
|
+
"caseSensitive": true,
|
|
35
|
+
"natural": false,
|
|
36
|
+
"minKeys": 2
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -4,19 +4,19 @@ export const processEvent = (event: any) => {
|
|
|
4
4
|
if (!event) throw new Error('Invalid Event')
|
|
5
5
|
|
|
6
6
|
return {
|
|
7
|
-
statusCode: 200,
|
|
8
|
-
id: uuidv4(),
|
|
9
|
-
message: 'Webhook call successful',
|
|
10
7
|
body: {
|
|
11
8
|
event: event,
|
|
12
9
|
},
|
|
13
|
-
origin: event.headers?.origin,
|
|
14
|
-
source: 'custom:api-destined-lambda',
|
|
15
|
-
sourceId: process.env.SOURCE_ID,
|
|
16
10
|
httpMethod: event.httpMethod,
|
|
11
|
+
id: uuidv4(),
|
|
12
|
+
message: 'Webhook call successful',
|
|
13
|
+
origin: event.headers?.origin,
|
|
17
14
|
path: event.path,
|
|
18
15
|
referer: event.headers?.referer,
|
|
19
16
|
resource: event.resource,
|
|
17
|
+
source: 'custom:api-destined-lambda',
|
|
18
|
+
sourceId: process.env.SOURCE_ID,
|
|
19
|
+
statusCode: 200,
|
|
20
20
|
success: true,
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export declare const processEvent: (event: any) => {
|
|
2
|
-
statusCode: number;
|
|
3
|
-
id: string;
|
|
4
|
-
message: string;
|
|
5
2
|
body: {
|
|
6
3
|
event: any;
|
|
7
4
|
};
|
|
8
|
-
origin: any;
|
|
9
|
-
source: string;
|
|
10
|
-
sourceId: string | undefined;
|
|
11
5
|
httpMethod: any;
|
|
6
|
+
id: string;
|
|
7
|
+
message: string;
|
|
8
|
+
origin: any;
|
|
12
9
|
path: any;
|
|
13
10
|
referer: any;
|
|
14
11
|
resource: any;
|
|
12
|
+
source: string;
|
|
13
|
+
sourceId: string | undefined;
|
|
14
|
+
statusCode: number;
|
|
15
15
|
success: boolean;
|
|
16
16
|
};
|
|
@@ -6,19 +6,19 @@ const processEvent = (event) => {
|
|
|
6
6
|
if (!event)
|
|
7
7
|
throw new Error('Invalid Event');
|
|
8
8
|
return {
|
|
9
|
-
statusCode: 200,
|
|
10
|
-
id: (0, uuid_1.v4)(),
|
|
11
|
-
message: 'Webhook call successful',
|
|
12
9
|
body: {
|
|
13
10
|
event: event,
|
|
14
11
|
},
|
|
15
|
-
origin: event.headers?.origin,
|
|
16
|
-
source: 'custom:api-destined-lambda',
|
|
17
|
-
sourceId: process.env.SOURCE_ID,
|
|
18
12
|
httpMethod: event.httpMethod,
|
|
13
|
+
id: (0, uuid_1.v4)(),
|
|
14
|
+
message: 'Webhook call successful',
|
|
15
|
+
origin: event.headers?.origin,
|
|
19
16
|
path: event.path,
|
|
20
17
|
referer: event.headers?.referer,
|
|
21
18
|
resource: event.resource,
|
|
19
|
+
source: 'custom:api-destined-lambda',
|
|
20
|
+
sourceId: process.env.SOURCE_ID,
|
|
21
|
+
statusCode: 200,
|
|
22
22
|
success: true,
|
|
23
23
|
};
|
|
24
24
|
};
|
package/dist/lib/lambda.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export declare const processEvent: (event: any) => {
|
|
2
|
-
statusCode: number;
|
|
3
|
-
id: string;
|
|
4
|
-
message: string;
|
|
5
2
|
body: {
|
|
6
3
|
event: any;
|
|
7
4
|
};
|
|
8
|
-
origin: any;
|
|
9
|
-
source: string;
|
|
10
|
-
sourceId: string | undefined;
|
|
11
5
|
httpMethod: any;
|
|
6
|
+
id: string;
|
|
7
|
+
message: string;
|
|
8
|
+
origin: any;
|
|
12
9
|
path: any;
|
|
13
10
|
referer: any;
|
|
14
11
|
resource: any;
|
|
12
|
+
source: string;
|
|
13
|
+
sourceId: string | undefined;
|
|
14
|
+
statusCode: number;
|
|
15
15
|
success: boolean;
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=lambda.d.ts.map
|
package/dist/lib/lambda.js
CHANGED
|
@@ -6,19 +6,19 @@ const processEvent = (event) => {
|
|
|
6
6
|
if (!event)
|
|
7
7
|
throw new Error('Invalid Event');
|
|
8
8
|
return {
|
|
9
|
-
statusCode: 200,
|
|
10
|
-
id: (0, uuid_1.v4)(),
|
|
11
|
-
message: 'Webhook call successful',
|
|
12
9
|
body: {
|
|
13
10
|
event: event,
|
|
14
11
|
},
|
|
15
|
-
origin: event.headers?.origin,
|
|
16
|
-
source: 'custom:api-destined-lambda',
|
|
17
|
-
sourceId: process.env.SOURCE_ID,
|
|
18
12
|
httpMethod: event.httpMethod,
|
|
13
|
+
id: (0, uuid_1.v4)(),
|
|
14
|
+
message: 'Webhook call successful',
|
|
15
|
+
origin: event.headers?.origin,
|
|
19
16
|
path: event.path,
|
|
20
17
|
referer: event.headers?.referer,
|
|
21
18
|
resource: event.resource,
|
|
19
|
+
source: 'custom:api-destined-lambda',
|
|
20
|
+
sourceId: process.env.SOURCE_ID,
|
|
21
|
+
statusCode: 200,
|
|
22
22
|
success: true,
|
|
23
23
|
};
|
|
24
24
|
};
|
package/dist/lib/lambda.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lambda.js","sourceRoot":"","sources":["../../app/api-destined-function/src/lib/lambda.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAE5B,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;IACzC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IAE5C,OAAO;QACL,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"lambda.js","sourceRoot":"","sources":["../../app/api-destined-function/src/lib/lambda.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAE5B,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;IACzC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IAE5C,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK;SACb;QACD,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,EAAE,EAAE,IAAA,SAAM,GAAE;QACZ,OAAO,EAAE,yBAAyB;QAClC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM;QAC7B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO;QAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,4BAA4B;QACpC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;QAC/B,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,IAAI;KACd,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,YAAY,gBAmBxB;AAED,OAAO,CAAC,OAAO,GAAG,KAAK,EAAE,KAAU,EAAE,OAAY,EAAE,QAAa,EAAE,EAAE;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;IAC5C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAChD,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5D,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC,CAAA;AAC5C,CAAC,CAAA"}
|
|
@@ -3,11 +3,8 @@ import { Construct } from 'constructs';
|
|
|
3
3
|
import * as aws from '../services/aws';
|
|
4
4
|
import { CommonStackProps } from './types';
|
|
5
5
|
/**
|
|
6
|
-
* @stability stable
|
|
7
|
-
* @category cdk-utils.common-construct
|
|
8
6
|
* @subcategory Construct
|
|
9
7
|
* @classdesc Common construct to use as a base for all higher level constructs.
|
|
10
|
-
*
|
|
11
8
|
* @example
|
|
12
9
|
* import { CommonConstruct } from '@gradientedge/cdk-utils';
|
|
13
10
|
*
|
|
@@ -53,10 +50,10 @@ export declare class CommonConstruct extends Construct {
|
|
|
53
50
|
constructor(parent: Construct, id: string, props: CommonStackProps);
|
|
54
51
|
/**
|
|
55
52
|
* @summary Helper method to add CloudFormation outputs from the construct
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
53
|
+
* @param id scoped id of the resource
|
|
54
|
+
* @param value the value of the exported output
|
|
55
|
+
* @param description optional description for the output
|
|
56
|
+
* @param overrideId Flag which indicates whether to override the default logical id of the output
|
|
60
57
|
*/
|
|
61
58
|
protected addCfnOutput(id: string, value: string, description?: string, overrideId?: boolean): cdk.CfnOutput;
|
|
62
59
|
/**
|
|
@@ -28,11 +28,8 @@ const constructs_1 = require("constructs");
|
|
|
28
28
|
const aws = __importStar(require("../services/aws"));
|
|
29
29
|
const utils = __importStar(require("../utils"));
|
|
30
30
|
/**
|
|
31
|
-
* @stability stable
|
|
32
|
-
* @category cdk-utils.common-construct
|
|
33
31
|
* @subcategory Construct
|
|
34
32
|
* @classdesc Common construct to use as a base for all higher level constructs.
|
|
35
|
-
*
|
|
36
33
|
* @example
|
|
37
34
|
* import { CommonConstruct } from '@gradientedge/cdk-utils';
|
|
38
35
|
*
|
|
@@ -111,10 +108,10 @@ class CommonConstruct extends constructs_1.Construct {
|
|
|
111
108
|
}
|
|
112
109
|
/**
|
|
113
110
|
* @summary Helper method to add CloudFormation outputs from the construct
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @param
|
|
111
|
+
* @param id scoped id of the resource
|
|
112
|
+
* @param value the value of the exported output
|
|
113
|
+
* @param description optional description for the output
|
|
114
|
+
* @param overrideId Flag which indicates whether to override the default logical id of the output
|
|
118
115
|
*/
|
|
119
116
|
addCfnOutput(id, value, description, overrideId = true) {
|
|
120
117
|
return utils.createCfnOutput(id, this, value, description, overrideId);
|
|
@@ -2,11 +2,7 @@ import * as cdk from 'aws-cdk-lib';
|
|
|
2
2
|
import { CommonStackProps } from './types';
|
|
3
3
|
import { CommonConstruct } from './construct';
|
|
4
4
|
/**
|
|
5
|
-
* @stability stable
|
|
6
|
-
* @category cdk-utils.common-stack
|
|
7
|
-
* @subcategory Construct
|
|
8
5
|
* @classdesc Common stack to use as a base for all higher level constructs.
|
|
9
|
-
*
|
|
10
6
|
* @example
|
|
11
7
|
* import { CommonStack } from '@gradientedge/cdk-utils'
|
|
12
8
|
*
|
|
@@ -24,21 +20,21 @@ export declare class CommonStack extends cdk.Stack {
|
|
|
24
20
|
constructor(parent: cdk.App, name: string, props: cdk.StackProps);
|
|
25
21
|
/**
|
|
26
22
|
* @summary Method to determine the core CDK construct properties injected via context cdk.json
|
|
27
|
-
* @param
|
|
28
|
-
* @
|
|
23
|
+
* @param props The stack properties
|
|
24
|
+
* @returns The stack properties
|
|
29
25
|
*/
|
|
30
26
|
protected determineConstructProps(props: cdk.StackProps): {
|
|
31
|
-
stackName: string | undefined;
|
|
32
|
-
name: string;
|
|
33
|
-
region: any;
|
|
34
|
-
stage: any;
|
|
35
27
|
domainName: any;
|
|
36
|
-
|
|
28
|
+
excludeDomainNameForBuckets: any;
|
|
37
29
|
extraContexts: any;
|
|
38
|
-
skipStageForARecords: any;
|
|
39
30
|
logRetention: any;
|
|
40
|
-
|
|
31
|
+
name: string;
|
|
41
32
|
nodejsRuntime: any;
|
|
33
|
+
region: any;
|
|
34
|
+
skipStageForARecords: any;
|
|
35
|
+
stackName: string | undefined;
|
|
36
|
+
stage: any;
|
|
37
|
+
subDomain: any;
|
|
42
38
|
};
|
|
43
39
|
/**
|
|
44
40
|
* @summary Method to determine extra cdk contexts apart from the main cdk.json
|
|
@@ -31,11 +31,7 @@ const construct_1 = require("./construct");
|
|
|
31
31
|
const appRoot = require('app-root-path');
|
|
32
32
|
const fs = require('fs');
|
|
33
33
|
/**
|
|
34
|
-
* @stability stable
|
|
35
|
-
* @category cdk-utils.common-stack
|
|
36
|
-
* @subcategory Construct
|
|
37
34
|
* @classdesc Common stack to use as a base for all higher level constructs.
|
|
38
|
-
*
|
|
39
35
|
* @example
|
|
40
36
|
* import { CommonStack } from '@gradientedge/cdk-utils'
|
|
41
37
|
*
|
|
@@ -62,22 +58,22 @@ class CommonStack extends cdk.Stack {
|
|
|
62
58
|
}
|
|
63
59
|
/**
|
|
64
60
|
* @summary Method to determine the core CDK construct properties injected via context cdk.json
|
|
65
|
-
* @param
|
|
66
|
-
* @
|
|
61
|
+
* @param props The stack properties
|
|
62
|
+
* @returns The stack properties
|
|
67
63
|
*/
|
|
68
64
|
determineConstructProps(props) {
|
|
69
65
|
return {
|
|
70
|
-
stackName: props.stackName,
|
|
71
|
-
name: props.stackName || 'cdk-utils',
|
|
72
|
-
region: this.node.tryGetContext('region'),
|
|
73
|
-
stage: this.node.tryGetContext('stage'),
|
|
74
66
|
domainName: this.node.tryGetContext('domainName'),
|
|
75
|
-
|
|
67
|
+
excludeDomainNameForBuckets: this.node.tryGetContext('excludeDomainNameForBuckets'),
|
|
76
68
|
extraContexts: this.node.tryGetContext('extraContexts'),
|
|
77
|
-
skipStageForARecords: this.node.tryGetContext('skipStageForARecords'),
|
|
78
69
|
logRetention: this.node.tryGetContext('logRetention'),
|
|
79
|
-
|
|
70
|
+
name: props.stackName || 'cdk-utils',
|
|
80
71
|
nodejsRuntime: this.node.tryGetContext('nodejsRuntime') ?? CommonStack.NODEJS_RUNTIME,
|
|
72
|
+
region: this.node.tryGetContext('region'),
|
|
73
|
+
skipStageForARecords: this.node.tryGetContext('skipStageForARecords'),
|
|
74
|
+
stackName: props.stackName,
|
|
75
|
+
stage: this.node.tryGetContext('stage'),
|
|
76
|
+
subDomain: this.node.tryGetContext('subDomain'),
|
|
81
77
|
};
|
|
82
78
|
}
|
|
83
79
|
/**
|
|
@@ -2,8 +2,6 @@ import * as cdk from 'aws-cdk-lib';
|
|
|
2
2
|
import { Runtime, Tracing } from 'aws-cdk-lib/aws-lambda';
|
|
3
3
|
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
|
|
4
4
|
/**
|
|
5
|
-
* @category cdk-utils.common-stack
|
|
6
|
-
* @subcategory Properties
|
|
7
5
|
*/
|
|
8
6
|
export interface CommonStackProps extends cdk.StackProps {
|
|
9
7
|
name: string;
|
|
@@ -6,9 +6,6 @@ import * as route53 from 'aws-cdk-lib/aws-route53';
|
|
|
6
6
|
import * as sns from 'aws-cdk-lib/aws-sns';
|
|
7
7
|
import { ApiToEventBridgeTargetRestApiType } from './types';
|
|
8
8
|
/**
|
|
9
|
-
* @stability stable
|
|
10
|
-
* @category cdk-utils.api-to-eventbridge-target
|
|
11
|
-
* @subcategory member
|
|
12
9
|
* @classdesc Provides a construct to contain api resources for ApiToEventBridgeTargetWithSns
|
|
13
10
|
*/
|
|
14
11
|
export declare class ApiToEventbridgeTargetRestApi implements ApiToEventBridgeTargetRestApiType {
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApiToEventbridgeTargetRestApi = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* @stability stable
|
|
6
|
-
* @category cdk-utils.api-to-eventbridge-target
|
|
7
|
-
* @subcategory member
|
|
8
5
|
* @classdesc Provides a construct to contain api resources for ApiToEventBridgeTargetWithSns
|
|
9
6
|
*/
|
|
10
7
|
class ApiToEventbridgeTargetRestApi {
|
|
@@ -2,9 +2,6 @@ import * as events from 'aws-cdk-lib/aws-events';
|
|
|
2
2
|
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
3
3
|
import { ApiToEventBridgeTargetEventType } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* @stability stable
|
|
6
|
-
* @category cdk-utils.api-to-eventbridge-target
|
|
7
|
-
* @subcategory member
|
|
8
5
|
* @classdesc Provides a construct to contain event resources for ApiToEventBridgeTargetWithSns
|
|
9
6
|
*/
|
|
10
7
|
export declare class ApiToEventbridgeTargetEvent implements ApiToEventBridgeTargetEventType {
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApiToEventbridgeTargetEvent = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* @stability stable
|
|
6
|
-
* @category cdk-utils.api-to-eventbridge-target
|
|
7
|
-
* @subcategory member
|
|
8
5
|
* @classdesc Provides a construct to contain event resources for ApiToEventBridgeTargetWithSns
|
|
9
6
|
*/
|
|
10
7
|
class ApiToEventbridgeTargetEvent {
|
|
@@ -3,13 +3,9 @@ import { Construct } from 'constructs';
|
|
|
3
3
|
import { CommonConstruct } from '../../common';
|
|
4
4
|
import { ApiToEventBridgeTargetEventType, ApiToEventBridgeTargetProps, ApiToEventBridgeTargetRestApiType } from './types';
|
|
5
5
|
/**
|
|
6
|
-
* @stability stable
|
|
7
|
-
* @category cdk-utils.api-to-eventbridge-target
|
|
8
|
-
* @subcategory construct
|
|
9
6
|
* @classdesc Provides a construct to create and deploy API Gateway invocations to EventBridge
|
|
10
7
|
*
|
|
11
8
|
* <b>Architecture</b><br/> 
|
|
12
|
-
*
|
|
13
9
|
* @example
|
|
14
10
|
* import { ApiToEventBridgeTarget, ApiToEventBridgeTargetProps } '@gradientedge/cdk-utils'
|
|
15
11
|
* import { Construct } from 'constructs'
|
|
@@ -22,7 +18,6 @@ import { ApiToEventBridgeTargetEventType, ApiToEventBridgeTargetProps, ApiToEven
|
|
|
22
18
|
* this.initResources()
|
|
23
19
|
* }
|
|
24
20
|
* }
|
|
25
|
-
* @mixin
|
|
26
21
|
*/
|
|
27
22
|
export declare class ApiToEventBridgeTarget extends CommonConstruct {
|
|
28
23
|
props: ApiToEventBridgeTargetProps;
|
|
@@ -36,114 +31,92 @@ export declare class ApiToEventBridgeTarget extends CommonConstruct {
|
|
|
36
31
|
/**
|
|
37
32
|
* @summary Method to resolve secrets from SecretsManager
|
|
38
33
|
* - To be implemented in the overriding method in the implementation class
|
|
39
|
-
* @protected
|
|
40
34
|
*/
|
|
41
35
|
protected resolveSecrets(): void;
|
|
42
36
|
/**
|
|
43
37
|
* @summary Method to resolve a hosted zone based on domain attributes
|
|
44
|
-
* @protected
|
|
45
38
|
*/
|
|
46
39
|
protected resolveHostedZone(): void;
|
|
47
40
|
/**
|
|
48
41
|
* @summary Method to resolve a certificate based on attributes
|
|
49
|
-
* @protected
|
|
50
42
|
*/
|
|
51
43
|
protected resolveCertificate(): void;
|
|
52
44
|
/**
|
|
53
45
|
* @summary Method to create or use an existing eventbus for api payload deliveries
|
|
54
|
-
* @protected
|
|
55
46
|
*/
|
|
56
47
|
protected createApiToEventBridgeTargetEventBus(): void;
|
|
57
48
|
/**
|
|
58
49
|
* @summary Method to create a log group for successful api payload deliveries
|
|
59
|
-
* @protected
|
|
60
50
|
*/
|
|
61
51
|
protected createApiToEventBridgeTargetLogGroup(): void;
|
|
62
52
|
/**
|
|
63
53
|
* Method to create EventBridge rule with lambda target for success
|
|
64
|
-
* @protected
|
|
65
54
|
*/
|
|
66
55
|
protected createApiToEventBridgeTargetRule(): void;
|
|
67
56
|
protected createApiToEventBridgeTargetPolicy(): void;
|
|
68
57
|
/**
|
|
69
58
|
* @summary Method to create a role for api integration
|
|
70
|
-
* @protected
|
|
71
59
|
*/
|
|
72
60
|
protected createApiToEventBridgeTargetRole(): void;
|
|
73
61
|
/**
|
|
74
62
|
* @summary Method to create api integration request parameters
|
|
75
|
-
* @protected
|
|
76
63
|
*/
|
|
77
64
|
protected createApiToEventBridgeTargetIntegrationRequestParameters(): void;
|
|
78
65
|
/**
|
|
79
66
|
* @summary Method to create api integration request templates
|
|
80
|
-
* @protected
|
|
81
67
|
*/
|
|
82
68
|
protected createApiToEventBridgeTargetIntegrationRequestTemplates(): void;
|
|
83
69
|
/**
|
|
84
70
|
* @summary Method to create api integration response
|
|
85
|
-
* @protected
|
|
86
71
|
*/
|
|
87
72
|
protected createApiToEventBridgeTargetIntegrationResponse(): void;
|
|
88
73
|
/**
|
|
89
74
|
* @summary Method to create api integration error response
|
|
90
|
-
* @protected
|
|
91
75
|
*/
|
|
92
76
|
protected createApiToEventBridgeTargetIntegrationErrorResponse(): void;
|
|
93
77
|
/**
|
|
94
78
|
* @summary Method to create api integration
|
|
95
|
-
* @protected
|
|
96
79
|
*/
|
|
97
80
|
protected createApiToEventBridgeTargetIntegration(): void;
|
|
98
81
|
/**
|
|
99
82
|
* @summary Method to create api integration method response
|
|
100
|
-
* @protected
|
|
101
83
|
*/
|
|
102
84
|
protected createApiToEventBridgeTargetMethodResponse(): void;
|
|
103
85
|
/**
|
|
104
86
|
* @summary Method to create api integration method error response
|
|
105
|
-
* @protected
|
|
106
87
|
*/
|
|
107
88
|
protected createApiToEventBridgeTargetMethodErrorResponse(): void;
|
|
108
89
|
protected createApiToEventBridgeTargetRestApiLogGroup(): void;
|
|
109
90
|
/**
|
|
110
91
|
* @summary Method to create rest restApi for Api
|
|
111
|
-
* @protected
|
|
112
92
|
*/
|
|
113
93
|
protected createApiToEventBridgeTargetRestApi(): void;
|
|
114
94
|
/**
|
|
115
95
|
* @summary Method to create api integration response model
|
|
116
|
-
* @protected
|
|
117
96
|
*/
|
|
118
97
|
protected createApiToEventBridgeTargetResponseModel(): void;
|
|
119
98
|
/**
|
|
120
99
|
* @summary Method to create api integration error response model
|
|
121
|
-
* @protected
|
|
122
100
|
*/
|
|
123
101
|
protected createApiToEventBridgeTargetErrorResponseModel(): void;
|
|
124
102
|
/**
|
|
125
103
|
* @summary Method to create api integration resource
|
|
126
|
-
* @protected
|
|
127
104
|
*/
|
|
128
105
|
protected createApiToEventBridgeTargetResource(): void;
|
|
129
106
|
/**
|
|
130
107
|
* @summary Method to create api integration resource method
|
|
131
|
-
* @protected
|
|
132
108
|
*/
|
|
133
109
|
protected createApiToEventBridgeTargetResourceMethod(): void;
|
|
134
110
|
/**
|
|
135
111
|
* @summary Method to create custom restApi domain for Api
|
|
136
|
-
* @protected
|
|
137
112
|
*/
|
|
138
113
|
protected createApiDomain(): void;
|
|
139
114
|
/**
|
|
140
115
|
* @summary Method to create base path mappings for Api
|
|
141
|
-
* @protected
|
|
142
116
|
*/
|
|
143
117
|
protected createApiBasePathMapping(): void;
|
|
144
118
|
/**
|
|
145
119
|
* @summary Method to create route53 records for Api
|
|
146
|
-
* @protected
|
|
147
120
|
*/
|
|
148
121
|
protected createApiRouteAssets(): void;
|
|
149
122
|
}
|