@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,32 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.determineCredentials = exports.createCfnOutput = void 0;
|
|
27
|
-
const cdk = __importStar(require("aws-cdk-lib"));
|
|
28
|
-
const _ = __importStar(require("lodash"));
|
|
29
7
|
const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
8
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
9
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
30
10
|
/**
|
|
31
11
|
* @summary Helper method to add CloudFormation outputs from the construct
|
|
32
12
|
* @param id scoped id of the resource
|
|
@@ -37,8 +17,8 @@ const credential_providers_1 = require("@aws-sdk/credential-providers");
|
|
|
37
17
|
* @returns The CloudFormation output
|
|
38
18
|
*/
|
|
39
19
|
function createCfnOutput(id, scope, value, description, overrideId = true) {
|
|
40
|
-
const camelName =
|
|
41
|
-
const output = new
|
|
20
|
+
const camelName = lodash_1.default.camelCase(id);
|
|
21
|
+
const output = new aws_cdk_lib_1.CfnOutput(scope, id, {
|
|
42
22
|
description,
|
|
43
23
|
exportName: `${scope.props.stackName}-${camelName}`,
|
|
44
24
|
value: value ?? '',
|
|
@@ -49,6 +29,9 @@ function createCfnOutput(id, scope, value, description, overrideId = true) {
|
|
|
49
29
|
return output;
|
|
50
30
|
}
|
|
51
31
|
exports.createCfnOutput = createCfnOutput;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
52
35
|
function determineCredentials() {
|
|
53
36
|
if (process.env.AWS_PROFILE)
|
|
54
37
|
return (0, credential_providers_1.fromIni)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.119.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
50
|
-
"@aws-sdk/credential-providers": "^3.
|
|
49
|
+
"@aws-sdk/client-secrets-manager": "^3.405.0",
|
|
50
|
+
"@aws-sdk/credential-providers": "^3.405.0",
|
|
51
51
|
"@aws-sdk/types": "^3.398.0",
|
|
52
52
|
"@types/lodash": "^4.14.197",
|
|
53
|
-
"@types/node": "^20.5.
|
|
54
|
-
"@types/uuid": "^9.0.
|
|
53
|
+
"@types/node": "^20.5.9",
|
|
54
|
+
"@types/uuid": "^9.0.3",
|
|
55
55
|
"app-root-path": "^3.1.0",
|
|
56
|
-
"aws-cdk-lib": "^2.
|
|
57
|
-
"constructs": "^10.2.
|
|
56
|
+
"aws-cdk-lib": "^2.94.0",
|
|
57
|
+
"constructs": "^10.2.70",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
59
|
"moment": "^2.29.4",
|
|
60
60
|
"nconf": "^0.12.0",
|
|
@@ -63,22 +63,22 @@
|
|
|
63
63
|
"uuid": "^9.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@babel/core": "^7.22.
|
|
67
|
-
"@babel/eslint-parser": "^7.22.
|
|
66
|
+
"@babel/core": "^7.22.15",
|
|
67
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
68
68
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
69
69
|
"@types/jest": "^29.5.4",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
71
|
-
"@typescript-eslint/parser": "^6.
|
|
72
|
-
"aws-cdk": "^2.
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
|
71
|
+
"@typescript-eslint/parser": "^6.6.0",
|
|
72
|
+
"aws-cdk": "^2.94.0",
|
|
73
73
|
"better-docs": "^2.7.2",
|
|
74
74
|
"codecov": "^3.8.3",
|
|
75
75
|
"commitizen": "^4.3.0",
|
|
76
|
-
"docdash": "^2.0.
|
|
76
|
+
"docdash": "^2.0.2",
|
|
77
77
|
"dotenv": "^16.3.1",
|
|
78
78
|
"eslint": "^8.48.0",
|
|
79
79
|
"eslint-config-prettier": "^9.0.0",
|
|
80
80
|
"eslint-plugin-import": "^2.28.1",
|
|
81
|
-
"eslint-plugin-jsdoc": "^46.5.
|
|
81
|
+
"eslint-plugin-jsdoc": "^46.5.1",
|
|
82
82
|
"husky": "^8.0.3",
|
|
83
83
|
"jest": "^29.6.4",
|
|
84
84
|
"jest-extended": "^4.0.1",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"jsdoc-mermaid": "^1.0.0",
|
|
89
89
|
"jsdoc-plugin-typescript": "^2.2.1",
|
|
90
90
|
"jsdoc-to-markdown": "^8.0.0",
|
|
91
|
-
"prettier": "^3.0.
|
|
91
|
+
"prettier": "^3.0.3",
|
|
92
92
|
"prettier-plugin-organize-imports": "^3.2.3",
|
|
93
93
|
"rimraf": "^5.0.1",
|
|
94
94
|
"semantic-release": "^21.1.1",
|
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CfnOutput } from 'aws-cdk-lib'
|
|
2
2
|
import { Construct } from 'constructs'
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
AcmManager,
|
|
5
|
+
ApiManager,
|
|
6
|
+
AppConfigManager,
|
|
7
|
+
CloudFrontManager,
|
|
8
|
+
CloudTrailManager,
|
|
9
|
+
CloudWatchManager,
|
|
10
|
+
CodeBuildManager,
|
|
11
|
+
DynamodbManager,
|
|
12
|
+
EcrManager,
|
|
13
|
+
EcsManager,
|
|
14
|
+
EfsManager,
|
|
15
|
+
EksManager,
|
|
16
|
+
ElastiCacheManager,
|
|
17
|
+
EventManager,
|
|
18
|
+
EventTargetManager,
|
|
19
|
+
EvidentlyManager,
|
|
20
|
+
IamManager,
|
|
21
|
+
KmsManager,
|
|
22
|
+
LambdaManager,
|
|
23
|
+
LogManager,
|
|
24
|
+
Route53Manager,
|
|
25
|
+
S3Manager,
|
|
26
|
+
SecretsManager,
|
|
27
|
+
SfnManager,
|
|
28
|
+
SnsManager,
|
|
29
|
+
SqsManager,
|
|
30
|
+
SsmManager,
|
|
31
|
+
VpcManager,
|
|
32
|
+
WafManager,
|
|
33
|
+
} from '../services'
|
|
34
|
+
import { createCfnOutput, isDevStage, isPrdStage, isTestStage, isUatStage } from '../utils'
|
|
5
35
|
import { CommonStackProps } from './types'
|
|
6
36
|
|
|
7
37
|
/**
|
|
@@ -19,70 +49,70 @@ import { CommonStackProps } from './types'
|
|
|
19
49
|
*/
|
|
20
50
|
export class CommonConstruct extends Construct {
|
|
21
51
|
props: CommonStackProps
|
|
22
|
-
acmManager:
|
|
23
|
-
apiManager:
|
|
24
|
-
appConfigManager:
|
|
25
|
-
codeBuildManager:
|
|
26
|
-
cloudFrontManager:
|
|
27
|
-
cloudTrailManager:
|
|
28
|
-
cloudWatchManager:
|
|
29
|
-
dynamodbManager:
|
|
30
|
-
ecrManager:
|
|
31
|
-
ecsManager:
|
|
32
|
-
efsManager:
|
|
33
|
-
eksManager:
|
|
34
|
-
elasticacheManager:
|
|
35
|
-
eventManager:
|
|
36
|
-
eventTargetManager:
|
|
37
|
-
evidentlyManager:
|
|
38
|
-
iamManager:
|
|
39
|
-
kmsManager:
|
|
40
|
-
lambdaManager:
|
|
41
|
-
logManager:
|
|
42
|
-
route53Manager:
|
|
43
|
-
s3Manager:
|
|
44
|
-
secretsManager:
|
|
45
|
-
sfnManager:
|
|
46
|
-
snsManager:
|
|
47
|
-
sqsManager:
|
|
48
|
-
ssmManager:
|
|
49
|
-
vpcManager:
|
|
50
|
-
wafManager:
|
|
52
|
+
acmManager: AcmManager
|
|
53
|
+
apiManager: ApiManager
|
|
54
|
+
appConfigManager: AppConfigManager
|
|
55
|
+
codeBuildManager: CodeBuildManager
|
|
56
|
+
cloudFrontManager: CloudFrontManager
|
|
57
|
+
cloudTrailManager: CloudTrailManager
|
|
58
|
+
cloudWatchManager: CloudWatchManager
|
|
59
|
+
dynamodbManager: DynamodbManager
|
|
60
|
+
ecrManager: EcrManager
|
|
61
|
+
ecsManager: EcsManager
|
|
62
|
+
efsManager: EfsManager
|
|
63
|
+
eksManager: EksManager
|
|
64
|
+
elasticacheManager: ElastiCacheManager
|
|
65
|
+
eventManager: EventManager
|
|
66
|
+
eventTargetManager: EventTargetManager
|
|
67
|
+
evidentlyManager: EvidentlyManager
|
|
68
|
+
iamManager: IamManager
|
|
69
|
+
kmsManager: KmsManager
|
|
70
|
+
lambdaManager: LambdaManager
|
|
71
|
+
logManager: LogManager
|
|
72
|
+
route53Manager: Route53Manager
|
|
73
|
+
s3Manager: S3Manager
|
|
74
|
+
secretsManager: SecretsManager
|
|
75
|
+
sfnManager: SfnManager
|
|
76
|
+
snsManager: SnsManager
|
|
77
|
+
sqsManager: SqsManager
|
|
78
|
+
ssmManager: SsmManager
|
|
79
|
+
vpcManager: VpcManager
|
|
80
|
+
wafManager: WafManager
|
|
51
81
|
|
|
52
82
|
fullyQualifiedDomainName: string
|
|
53
83
|
|
|
54
84
|
constructor(parent: Construct, id: string, props: CommonStackProps) {
|
|
55
85
|
super(parent, id)
|
|
56
86
|
this.props = props
|
|
57
|
-
this.acmManager = new
|
|
58
|
-
this.apiManager = new
|
|
59
|
-
this.appConfigManager = new
|
|
60
|
-
this.codeBuildManager = new
|
|
61
|
-
this.cloudFrontManager = new
|
|
62
|
-
this.cloudTrailManager = new
|
|
63
|
-
this.cloudWatchManager = new
|
|
64
|
-
this.dynamodbManager = new
|
|
65
|
-
this.ecrManager = new
|
|
66
|
-
this.ecsManager = new
|
|
67
|
-
this.efsManager = new
|
|
68
|
-
this.eksManager = new
|
|
69
|
-
this.elasticacheManager = new
|
|
70
|
-
this.eventManager = new
|
|
71
|
-
this.eventTargetManager = new
|
|
72
|
-
this.evidentlyManager = new
|
|
73
|
-
this.iamManager = new
|
|
74
|
-
this.kmsManager = new
|
|
75
|
-
this.lambdaManager = new
|
|
76
|
-
this.logManager = new
|
|
77
|
-
this.route53Manager = new
|
|
78
|
-
this.s3Manager = new
|
|
79
|
-
this.secretsManager = new
|
|
80
|
-
this.sfnManager = new
|
|
81
|
-
this.snsManager = new
|
|
82
|
-
this.sqsManager = new
|
|
83
|
-
this.ssmManager = new
|
|
84
|
-
this.vpcManager = new
|
|
85
|
-
this.wafManager = new
|
|
87
|
+
this.acmManager = new AcmManager()
|
|
88
|
+
this.apiManager = new ApiManager()
|
|
89
|
+
this.appConfigManager = new AppConfigManager()
|
|
90
|
+
this.codeBuildManager = new CodeBuildManager()
|
|
91
|
+
this.cloudFrontManager = new CloudFrontManager()
|
|
92
|
+
this.cloudTrailManager = new CloudTrailManager()
|
|
93
|
+
this.cloudWatchManager = new CloudWatchManager()
|
|
94
|
+
this.dynamodbManager = new DynamodbManager()
|
|
95
|
+
this.ecrManager = new EcrManager()
|
|
96
|
+
this.ecsManager = new EcsManager()
|
|
97
|
+
this.efsManager = new EfsManager()
|
|
98
|
+
this.eksManager = new EksManager()
|
|
99
|
+
this.elasticacheManager = new ElastiCacheManager()
|
|
100
|
+
this.eventManager = new EventManager()
|
|
101
|
+
this.eventTargetManager = new EventTargetManager()
|
|
102
|
+
this.evidentlyManager = new EvidentlyManager()
|
|
103
|
+
this.iamManager = new IamManager()
|
|
104
|
+
this.kmsManager = new KmsManager()
|
|
105
|
+
this.lambdaManager = new LambdaManager()
|
|
106
|
+
this.logManager = new LogManager()
|
|
107
|
+
this.route53Manager = new Route53Manager()
|
|
108
|
+
this.s3Manager = new S3Manager()
|
|
109
|
+
this.secretsManager = new SecretsManager()
|
|
110
|
+
this.sfnManager = new SfnManager()
|
|
111
|
+
this.snsManager = new SnsManager()
|
|
112
|
+
this.sqsManager = new SqsManager()
|
|
113
|
+
this.ssmManager = new SsmManager()
|
|
114
|
+
this.vpcManager = new VpcManager()
|
|
115
|
+
this.wafManager = new WafManager()
|
|
86
116
|
|
|
87
117
|
this.determineFullyQualifiedDomain()
|
|
88
118
|
}
|
|
@@ -94,8 +124,8 @@ export class CommonConstruct extends Construct {
|
|
|
94
124
|
* @param description optional description for the output
|
|
95
125
|
* @param overrideId Flag which indicates whether to override the default logical id of the output
|
|
96
126
|
*/
|
|
97
|
-
protected addCfnOutput(id: string, value: string, description?: string, overrideId = true):
|
|
98
|
-
return
|
|
127
|
+
protected addCfnOutput(id: string, value: string, description?: string, overrideId = true): CfnOutput {
|
|
128
|
+
return createCfnOutput(id, this, value, description, overrideId)
|
|
99
129
|
}
|
|
100
130
|
|
|
101
131
|
/**
|
|
@@ -111,25 +141,25 @@ export class CommonConstruct extends Construct {
|
|
|
111
141
|
* @summary Utility method to determine if the initialisation is in development (dev) stage
|
|
112
142
|
* This is determined by the stage property injected via cdk context
|
|
113
143
|
*/
|
|
114
|
-
public isDevelopmentStage = () =>
|
|
144
|
+
public isDevelopmentStage = () => isDevStage(this.props.stage)
|
|
115
145
|
|
|
116
146
|
/**
|
|
117
147
|
* @summary Utility method to determine if the initialisation is in test (tst) stage
|
|
118
148
|
* This is determined by the stage property injected via cdk context
|
|
119
149
|
*/
|
|
120
|
-
public isTestStage = () =>
|
|
150
|
+
public isTestStage = () => isTestStage(this.props.stage)
|
|
121
151
|
|
|
122
152
|
/**
|
|
123
153
|
* @summary Utility method to determine if the initialisation is in uat (uat) stage
|
|
124
154
|
* This is determined by the stage property injected via cdk context
|
|
125
155
|
*/
|
|
126
|
-
public isUatStage = () =>
|
|
156
|
+
public isUatStage = () => isUatStage(this.props.stage)
|
|
127
157
|
|
|
128
158
|
/**
|
|
129
159
|
* @summary Utility method to determine if the initialisation is in production (prd) stage
|
|
130
160
|
* This is determined by the stage property injected via cdk context
|
|
131
161
|
*/
|
|
132
|
-
public isProductionStage = () =>
|
|
162
|
+
public isProductionStage = () => isPrdStage(this.props.stage)
|
|
133
163
|
}
|
|
134
164
|
|
|
135
165
|
export const applyMixins = (derivedCtor: any, constructors: any[]) => {
|
package/src/lib/common/stack.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib'
|
|
2
|
+
import { Runtime } from 'aws-cdk-lib/aws-lambda'
|
|
3
|
+
import fs from 'fs'
|
|
4
4
|
import { isDevStage } from '../utils'
|
|
5
5
|
import { CommonConstruct } from './construct'
|
|
6
|
+
import { CommonStackProps } from './types'
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const fs = require('fs')
|
|
8
|
+
import appRoot from 'app-root-path'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @classdesc Common stack to use as a base for all higher level constructs.
|
|
@@ -13,19 +13,19 @@ const fs = require('fs')
|
|
|
13
13
|
* import { CommonStack } from '@gradientedge/cdk-utils'
|
|
14
14
|
*
|
|
15
15
|
* class CustomStack extends CommonStack {
|
|
16
|
-
* constructor(parent:
|
|
16
|
+
* constructor(parent: App, name: string, props: StackProps) {
|
|
17
17
|
* super(parent, name, props)
|
|
18
18
|
* // provision resources
|
|
19
19
|
* }
|
|
20
20
|
* }
|
|
21
21
|
*/
|
|
22
|
-
export class CommonStack extends
|
|
23
|
-
public static NODEJS_RUNTIME =
|
|
22
|
+
export class CommonStack extends Stack {
|
|
23
|
+
public static NODEJS_RUNTIME = Runtime.NODEJS_18_X
|
|
24
24
|
|
|
25
25
|
construct: CommonConstruct
|
|
26
26
|
props: CommonStackProps
|
|
27
27
|
|
|
28
|
-
constructor(parent:
|
|
28
|
+
constructor(parent: App, name: string, props: StackProps) {
|
|
29
29
|
super(parent, name, props)
|
|
30
30
|
|
|
31
31
|
/* determine extra cdk contexts */
|
|
@@ -45,7 +45,7 @@ export class CommonStack extends cdk.Stack {
|
|
|
45
45
|
* @param props The stack properties
|
|
46
46
|
* @returns The stack properties
|
|
47
47
|
*/
|
|
48
|
-
protected determineConstructProps(props:
|
|
48
|
+
protected determineConstructProps(props: StackProps) {
|
|
49
49
|
return {
|
|
50
50
|
domainName: this.node.tryGetContext('domainName'),
|
|
51
51
|
excludeDomainNameForBuckets: this.node.tryGetContext('excludeDomainNameForBuckets'),
|
|
@@ -86,7 +86,7 @@ export class CommonStack extends cdk.Stack {
|
|
|
86
86
|
if (debug) console.debug(`Adding additional contexts provided in ${extraContextPath}`)
|
|
87
87
|
|
|
88
88
|
/* parse as JSON properties */
|
|
89
|
-
const extraContextProps = JSON.parse(extraContextPropsBuffer)
|
|
89
|
+
const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'))
|
|
90
90
|
|
|
91
91
|
/* set each of the property into the cdk node context */
|
|
92
92
|
Object.keys(extraContextProps).forEach((propKey: any) => {
|
|
@@ -122,7 +122,7 @@ export class CommonStack extends cdk.Stack {
|
|
|
122
122
|
if (debug) console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`)
|
|
123
123
|
|
|
124
124
|
/* parse as JSON properties */
|
|
125
|
-
const stageContextProps = JSON.parse(stageContextPropsBuffer)
|
|
125
|
+
const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'))
|
|
126
126
|
|
|
127
127
|
/* set each of the property into the cdk node context */
|
|
128
128
|
Object.keys(stageContextProps).forEach((propKey: any) => {
|
package/src/lib/common/types.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { StackProps } 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
5
|
/**
|
|
6
6
|
*/
|
|
7
|
-
export interface CommonStackProps extends
|
|
7
|
+
export interface CommonStackProps extends StackProps {
|
|
8
8
|
name: string
|
|
9
9
|
region: string
|
|
10
10
|
stage: string
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import {
|
|
2
|
+
DomainName,
|
|
3
|
+
Integration,
|
|
4
|
+
IntegrationResponse,
|
|
5
|
+
Method,
|
|
6
|
+
MethodResponse,
|
|
7
|
+
Model,
|
|
8
|
+
Resource,
|
|
9
|
+
RestApi,
|
|
10
|
+
} from 'aws-cdk-lib/aws-apigateway'
|
|
11
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
|
|
12
|
+
import { Role } from 'aws-cdk-lib/aws-iam'
|
|
13
|
+
import { LogGroup } from 'aws-cdk-lib/aws-logs'
|
|
14
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53'
|
|
15
|
+
import { Topic } from 'aws-cdk-lib/aws-sns'
|
|
7
16
|
import { ApiToEventBridgeTargetRestApiType } from './types'
|
|
8
17
|
|
|
9
18
|
/**
|
|
10
19
|
* @classdesc Provides a construct to contain api resources for ApiToEventBridgeTargetWithSns
|
|
11
20
|
*/
|
|
12
21
|
export class ApiToEventbridgeTargetRestApi implements ApiToEventBridgeTargetRestApiType {
|
|
13
|
-
accessLogGroup:
|
|
14
|
-
api:
|
|
15
|
-
certificate:
|
|
16
|
-
domain:
|
|
17
|
-
errorResponseModel:
|
|
18
|
-
hostedZone:
|
|
19
|
-
integration:
|
|
20
|
-
integrationErrorResponse:
|
|
22
|
+
accessLogGroup: LogGroup
|
|
23
|
+
api: RestApi
|
|
24
|
+
certificate: ICertificate
|
|
25
|
+
domain: DomainName
|
|
26
|
+
errorResponseModel: Model
|
|
27
|
+
hostedZone: IHostedZone
|
|
28
|
+
integration: Integration
|
|
29
|
+
integrationErrorResponse: IntegrationResponse
|
|
21
30
|
integrationRequestParameters: { [p: string]: string }
|
|
22
31
|
integrationRequestTemplates: { [p: string]: string }
|
|
23
|
-
integrationResponse:
|
|
24
|
-
method:
|
|
25
|
-
methodErrorResponse:
|
|
26
|
-
methodResponse:
|
|
27
|
-
resource:
|
|
28
|
-
responseModel:
|
|
29
|
-
topic:
|
|
30
|
-
role:
|
|
32
|
+
integrationResponse: IntegrationResponse
|
|
33
|
+
method: Method
|
|
34
|
+
methodErrorResponse: MethodResponse
|
|
35
|
+
methodResponse: MethodResponse
|
|
36
|
+
resource: Resource
|
|
37
|
+
responseModel: Model
|
|
38
|
+
topic: Topic
|
|
39
|
+
role: Role
|
|
31
40
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { IEventBus, Rule } from 'aws-cdk-lib/aws-events'
|
|
2
|
+
import { LogGroup } from 'aws-cdk-lib/aws-logs'
|
|
3
3
|
import { ApiToEventBridgeTargetEventType } from './types'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @classdesc Provides a construct to contain event resources for ApiToEventBridgeTargetWithSns
|
|
7
7
|
*/
|
|
8
8
|
export class ApiToEventbridgeTargetEvent implements ApiToEventBridgeTargetEventType {
|
|
9
|
-
eventBus:
|
|
10
|
-
logGroup:
|
|
11
|
-
logGroupFailure:
|
|
12
|
-
logGroupSuccess:
|
|
13
|
-
rule:
|
|
14
|
-
ruleFailure:
|
|
15
|
-
ruleSuccess:
|
|
9
|
+
eventBus: IEventBus
|
|
10
|
+
logGroup: LogGroup
|
|
11
|
+
logGroupFailure: LogGroup
|
|
12
|
+
logGroupSuccess: LogGroup
|
|
13
|
+
rule: Rule
|
|
14
|
+
ruleFailure: Rule
|
|
15
|
+
ruleSuccess: Rule
|
|
16
16
|
}
|