@gradientedge/cdk-utils 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -25
- package/dist/index.js.map +1 -1
- package/dist/src/lib/common/commonConstruct.d.ts +26 -45
- package/dist/src/lib/common/commonConstruct.d.ts.map +1 -1
- package/dist/src/lib/common/commonConstruct.js +50 -49
- package/dist/src/lib/common/commonConstruct.js.map +1 -1
- package/dist/src/lib/common/commonStack.d.ts +1 -1
- package/dist/src/lib/common/commonStack.d.ts.map +1 -1
- package/dist/src/lib/common/commonStack.js.map +1 -1
- package/dist/src/lib/common/index.d.ts +3 -0
- package/dist/src/lib/common/index.d.ts.map +1 -0
- package/dist/src/lib/common/index.js +15 -0
- package/dist/src/lib/common/index.js.map +1 -0
- package/dist/src/lib/construct/graphQLApiLambda.d.ts +5 -5
- package/dist/src/lib/construct/graphQLApiLambda.d.ts.map +1 -1
- package/dist/src/lib/construct/graphQLApiLambda.js +2 -2
- package/dist/src/lib/construct/graphQLApiLambda.js.map +1 -1
- package/dist/src/lib/construct/index.d.ts +4 -0
- package/dist/src/lib/construct/index.d.ts.map +1 -0
- package/dist/src/lib/construct/index.js +16 -0
- package/dist/src/lib/construct/index.js.map +1 -0
- package/dist/src/lib/construct/siteWithEcsBackend.d.ts +8 -8
- package/dist/src/lib/construct/siteWithEcsBackend.d.ts.map +1 -1
- package/dist/src/lib/construct/siteWithEcsBackend.js +4 -4
- package/dist/src/lib/construct/siteWithEcsBackend.js.map +1 -1
- package/dist/src/lib/construct/staticSite.d.ts +5 -5
- package/dist/src/lib/construct/staticSite.d.ts.map +1 -1
- package/dist/src/lib/construct/staticSite.js +1 -1
- package/dist/src/lib/construct/staticSite.js.map +1 -1
- package/dist/src/lib/manager/{acmManager.d.ts → aws/acmManager.d.ts} +7 -7
- package/dist/src/lib/manager/aws/acmManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{acmManager.js → aws/acmManager.js} +7 -7
- package/dist/src/lib/manager/aws/acmManager.js.map +1 -0
- package/dist/src/lib/manager/{apiManager.d.ts → aws/apiManager.d.ts} +10 -10
- package/dist/src/lib/manager/aws/apiManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{apiManager.js → aws/apiManager.js} +12 -14
- package/dist/src/lib/manager/aws/apiManager.js.map +1 -0
- package/dist/src/lib/manager/{appConfigManager.d.ts → aws/appConfigManager.d.ts} +16 -16
- package/dist/src/lib/manager/aws/appConfigManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{appConfigManager.js → aws/appConfigManager.js} +18 -18
- package/dist/src/lib/manager/aws/appConfigManager.js.map +1 -0
- package/dist/src/lib/manager/{cloudFrontManager.d.ts → aws/cloudFrontManager.d.ts} +26 -25
- package/dist/src/lib/manager/aws/cloudFrontManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{cloudFrontManager.js → aws/cloudFrontManager.js} +26 -26
- package/dist/src/lib/manager/aws/cloudFrontManager.js.map +1 -0
- package/dist/src/lib/manager/{cloudTrailManager.d.ts → aws/cloudTrailManager.d.ts} +8 -8
- package/dist/src/lib/manager/aws/cloudTrailManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{cloudTrailManager.js → aws/cloudTrailManager.js} +8 -8
- package/dist/src/lib/manager/aws/cloudTrailManager.js.map +1 -0
- package/dist/src/lib/manager/aws/cloudWatchManager.d.ts +121 -0
- package/dist/src/lib/manager/aws/cloudWatchManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{cloudWatchManager.js → aws/cloudWatchManager.js} +46 -35
- package/dist/src/lib/manager/aws/cloudWatchManager.js.map +1 -0
- package/dist/src/lib/manager/{codeBuildManager.d.ts → aws/codeBuildManager.d.ts} +7 -8
- package/dist/src/lib/manager/aws/codeBuildManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{codeBuildManager.js → aws/codeBuildManager.js} +5 -5
- package/dist/src/lib/manager/aws/codeBuildManager.js.map +1 -0
- package/dist/src/lib/manager/aws/dynamodbManager.d.ts +32 -0
- package/dist/src/lib/manager/aws/dynamodbManager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/dynamodbManager.js +79 -0
- package/dist/src/lib/manager/aws/dynamodbManager.js.map +1 -0
- package/dist/src/lib/manager/{ecrManager.d.ts → aws/ecrManager.d.ts} +6 -6
- package/dist/src/lib/manager/aws/ecrManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{ecrManager.js → aws/ecrManager.js} +6 -6
- package/dist/src/lib/manager/aws/ecrManager.js.map +1 -0
- package/dist/src/lib/manager/{ecsManager.d.ts → aws/ecsManager.d.ts} +11 -11
- package/dist/src/lib/manager/aws/ecsManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{ecsManager.js → aws/ecsManager.js} +11 -11
- package/dist/src/lib/manager/aws/ecsManager.js.map +1 -0
- package/dist/src/lib/manager/{eksManager.d.ts → aws/eksManager.d.ts} +8 -8
- package/dist/src/lib/manager/aws/eksManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{eksManager.js → aws/eksManager.js} +8 -8
- package/dist/src/lib/manager/aws/eksManager.js.map +1 -0
- package/dist/src/lib/manager/{eventManager.d.ts → aws/eventManager.d.ts} +11 -11
- package/dist/src/lib/manager/aws/eventManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{eventManager.js → aws/eventManager.js} +12 -12
- package/dist/src/lib/manager/aws/eventManager.js.map +1 -0
- package/dist/src/lib/manager/aws/iamManager.d.ts +156 -0
- package/dist/src/lib/manager/aws/iamManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{iamManager.js → aws/iamManager.js} +35 -34
- package/dist/src/lib/manager/aws/iamManager.js.map +1 -0
- package/dist/src/lib/manager/aws/index.d.ts +23 -0
- package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/index.js +35 -0
- package/dist/src/lib/manager/aws/index.js.map +1 -0
- package/dist/src/lib/manager/{lambdaManager.d.ts → aws/lambdaManager.d.ts} +19 -19
- package/dist/src/lib/manager/aws/lambdaManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{lambdaManager.js → aws/lambdaManager.js} +19 -19
- package/dist/src/lib/manager/aws/lambdaManager.js.map +1 -0
- package/dist/src/lib/manager/{logManager.d.ts → aws/logManager.d.ts} +14 -14
- package/dist/src/lib/manager/aws/logManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{logManager.js → aws/logManager.js} +12 -12
- package/dist/src/lib/manager/aws/logManager.js.map +1 -0
- package/dist/src/lib/manager/{route53Manager.d.ts → aws/route53Manager.d.ts} +16 -16
- package/dist/src/lib/manager/aws/route53Manager.d.ts.map +1 -0
- package/dist/src/lib/manager/{route53Manager.js → aws/route53Manager.js} +17 -17
- package/dist/src/lib/manager/aws/route53Manager.js.map +1 -0
- package/dist/src/lib/manager/aws/s3Manager.d.ts +73 -0
- package/dist/src/lib/manager/aws/s3Manager.d.ts.map +1 -0
- package/dist/src/lib/manager/{s3Manager.js → aws/s3Manager.js} +15 -15
- package/dist/src/lib/manager/aws/s3Manager.js.map +1 -0
- package/dist/src/lib/manager/{secretsManager.d.ts → aws/secretsManager.d.ts} +5 -5
- package/dist/src/lib/manager/aws/secretsManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{secretsManager.js → aws/secretsManager.js} +3 -3
- package/dist/src/lib/manager/aws/secretsManager.js.map +1 -0
- package/dist/src/lib/manager/{snsManager.d.ts → aws/snsManager.d.ts} +11 -11
- package/dist/src/lib/manager/aws/snsManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{snsManager.js → aws/snsManager.js} +12 -12
- package/dist/src/lib/manager/aws/snsManager.js.map +1 -0
- package/dist/src/lib/manager/{ssmManager.d.ts → aws/ssmManager.d.ts} +16 -16
- package/dist/src/lib/manager/aws/ssmManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{ssmManager.js → aws/ssmManager.js} +13 -13
- package/dist/src/lib/manager/aws/ssmManager.js.map +1 -0
- package/dist/src/lib/manager/{vpcManager.d.ts → aws/vpcManager.d.ts} +10 -10
- package/dist/src/lib/manager/aws/vpcManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{vpcManager.js → aws/vpcManager.js} +13 -13
- package/dist/src/lib/manager/aws/vpcManager.js.map +1 -0
- package/dist/src/lib/manager/aws/wafManager.d.ts +39 -0
- package/dist/src/lib/manager/aws/wafManager.d.ts.map +1 -0
- package/dist/src/lib/manager/{wafManager.js → aws/wafManager.js} +12 -12
- package/dist/src/lib/manager/aws/wafManager.js.map +1 -0
- package/dist/src/lib/manager/index.d.ts +2 -0
- package/dist/src/lib/manager/index.d.ts.map +1 -0
- package/dist/src/lib/manager/index.js +14 -0
- package/dist/src/lib/manager/index.js.map +1 -0
- package/dist/src/lib/{types.d.ts → types/aws/index.d.ts} +22 -16
- package/dist/src/lib/types/aws/index.d.ts.map +1 -0
- package/dist/src/lib/{types.js → types/aws/index.js} +1 -1
- package/dist/src/lib/types/aws/index.js.map +1 -0
- package/dist/src/lib/types/index.d.ts +2 -0
- package/dist/src/lib/types/index.d.ts.map +1 -0
- package/dist/src/lib/types/index.js +14 -0
- package/dist/src/lib/types/index.js.map +1 -0
- package/dist/src/lib/utils/aws/index.d.ts +16 -0
- package/dist/src/lib/utils/aws/index.d.ts.map +1 -0
- package/dist/src/lib/utils/aws/index.js +50 -0
- package/dist/src/lib/utils/aws/index.js.map +1 -0
- package/dist/src/lib/{utils.d.ts → utils/index.d.ts} +2 -26
- package/dist/src/lib/utils/index.d.ts.map +1 -0
- package/dist/src/lib/utils/index.js +85 -0
- package/dist/src/lib/utils/index.js.map +1 -0
- package/index.ts +3 -25
- package/package.json +19 -16
- package/src/lib/common/commonConstruct.ts +55 -73
- package/src/lib/common/commonStack.ts +1 -1
- package/src/lib/common/index.ts +2 -0
- package/src/lib/construct/graphQLApiLambda.ts +5 -5
- package/src/lib/construct/index.ts +3 -0
- package/src/lib/construct/siteWithEcsBackend.ts +9 -9
- package/src/lib/construct/staticSite.ts +5 -5
- package/src/lib/manager/{acmManager.ts → aws/acmManager.ts} +11 -11
- package/src/lib/manager/{apiManager.ts → aws/apiManager.ts} +16 -18
- package/src/lib/manager/{appConfigManager.ts → aws/appConfigManager.ts} +30 -26
- package/src/lib/manager/{cloudFrontManager.ts → aws/cloudFrontManager.ts} +42 -42
- package/src/lib/manager/{cloudTrailManager.ts → aws/cloudTrailManager.ts} +12 -12
- package/src/lib/manager/{cloudWatchManager.ts → aws/cloudWatchManager.ts} +78 -56
- package/src/lib/manager/{codeBuildManager.ts → aws/codeBuildManager.ts} +8 -8
- package/src/lib/manager/aws/dynamodbManager.ts +60 -0
- package/src/lib/manager/{ecrManager.ts → aws/ecrManager.ts} +8 -8
- package/src/lib/manager/{ecsManager.ts → aws/ecsManager.ts} +16 -16
- package/src/lib/manager/{eksManager.ts → aws/eksManager.ts} +12 -12
- package/src/lib/manager/{eventManager.ts → aws/eventManager.ts} +18 -18
- package/src/lib/manager/{iamManager.ts → aws/iamManager.ts} +65 -54
- package/src/lib/manager/aws/index.ts +22 -0
- package/src/lib/manager/{lambdaManager.ts → aws/lambdaManager.ts} +29 -29
- package/src/lib/manager/{logManager.ts → aws/logManager.ts} +22 -17
- package/src/lib/manager/{route53Manager.ts → aws/route53Manager.ts} +24 -24
- package/src/lib/manager/{s3Manager.ts → aws/s3Manager.ts} +24 -24
- package/src/lib/manager/{secretsManager.ts → aws/secretsManager.ts} +10 -5
- package/src/lib/manager/{snsManager.ts → aws/snsManager.ts} +18 -18
- package/src/lib/manager/{ssmManager.ts → aws/ssmManager.ts} +24 -19
- package/src/lib/manager/{vpcManager.ts → aws/vpcManager.ts} +17 -17
- package/src/lib/manager/{wafManager.ts → aws/wafManager.ts} +16 -16
- package/src/lib/manager/index.ts +1 -0
- package/src/lib/{types.ts → types/aws/index.ts} +21 -15
- package/src/lib/types/index.ts +1 -0
- package/src/lib/utils/aws/index.ts +34 -0
- package/src/lib/{utils.ts → utils/index.ts} +1 -45
- package/dist/src/lib/manager/acmManager.d.ts.map +0 -1
- package/dist/src/lib/manager/acmManager.js.map +0 -1
- package/dist/src/lib/manager/apiManager.d.ts.map +0 -1
- package/dist/src/lib/manager/apiManager.js.map +0 -1
- package/dist/src/lib/manager/appConfigManager.d.ts.map +0 -1
- package/dist/src/lib/manager/appConfigManager.js.map +0 -1
- package/dist/src/lib/manager/cloudFrontManager.d.ts.map +0 -1
- package/dist/src/lib/manager/cloudFrontManager.js.map +0 -1
- package/dist/src/lib/manager/cloudTrailManager.d.ts.map +0 -1
- package/dist/src/lib/manager/cloudTrailManager.js.map +0 -1
- package/dist/src/lib/manager/cloudWatchManager.d.ts +0 -121
- package/dist/src/lib/manager/cloudWatchManager.d.ts.map +0 -1
- package/dist/src/lib/manager/cloudWatchManager.js.map +0 -1
- package/dist/src/lib/manager/codeBuildManager.d.ts.map +0 -1
- package/dist/src/lib/manager/codeBuildManager.js.map +0 -1
- package/dist/src/lib/manager/ecrManager.d.ts.map +0 -1
- package/dist/src/lib/manager/ecrManager.js.map +0 -1
- package/dist/src/lib/manager/ecsManager.d.ts.map +0 -1
- package/dist/src/lib/manager/ecsManager.js.map +0 -1
- package/dist/src/lib/manager/eksManager.d.ts.map +0 -1
- package/dist/src/lib/manager/eksManager.js.map +0 -1
- package/dist/src/lib/manager/eventManager.d.ts.map +0 -1
- package/dist/src/lib/manager/eventManager.js.map +0 -1
- package/dist/src/lib/manager/iamManager.d.ts +0 -155
- package/dist/src/lib/manager/iamManager.d.ts.map +0 -1
- package/dist/src/lib/manager/iamManager.js.map +0 -1
- package/dist/src/lib/manager/lambdaManager.d.ts.map +0 -1
- package/dist/src/lib/manager/lambdaManager.js.map +0 -1
- package/dist/src/lib/manager/logManager.d.ts.map +0 -1
- package/dist/src/lib/manager/logManager.js.map +0 -1
- package/dist/src/lib/manager/route53Manager.d.ts.map +0 -1
- package/dist/src/lib/manager/route53Manager.js.map +0 -1
- package/dist/src/lib/manager/s3Manager.d.ts +0 -73
- package/dist/src/lib/manager/s3Manager.d.ts.map +0 -1
- package/dist/src/lib/manager/s3Manager.js.map +0 -1
- package/dist/src/lib/manager/secretsManager.d.ts.map +0 -1
- package/dist/src/lib/manager/secretsManager.js.map +0 -1
- package/dist/src/lib/manager/snsManager.d.ts.map +0 -1
- package/dist/src/lib/manager/snsManager.js.map +0 -1
- package/dist/src/lib/manager/ssmManager.d.ts.map +0 -1
- package/dist/src/lib/manager/ssmManager.js.map +0 -1
- package/dist/src/lib/manager/vpcManager.d.ts.map +0 -1
- package/dist/src/lib/manager/vpcManager.js.map +0 -1
- package/dist/src/lib/manager/wafManager.d.ts +0 -39
- package/dist/src/lib/manager/wafManager.d.ts.map +0 -1
- package/dist/src/lib/manager/wafManager.js.map +0 -1
- package/dist/src/lib/types.d.ts.map +0 -1
- package/dist/src/lib/types.js.map +0 -1
- package/dist/src/lib/utils.d.ts.map +0 -1
- package/dist/src/lib/utils.js +0 -131
- package/dist/src/lib/utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aws-cdk/aws-lambda-python-alpha": "2.
|
|
46
|
+
"@aws-cdk/aws-lambda-python-alpha": "2.10.0-alpha.0",
|
|
47
47
|
"@types/lodash": "^4.14.178",
|
|
48
|
-
"@types/node": "^17.0.
|
|
48
|
+
"@types/node": "^17.0.13",
|
|
49
49
|
"app-root-path": "^3.0.0",
|
|
50
|
-
"aws-cdk-lib": "^2.
|
|
51
|
-
"aws-sdk": "^2.
|
|
52
|
-
"constructs": "^10.0.
|
|
50
|
+
"aws-cdk-lib": "^2.10.0",
|
|
51
|
+
"aws-sdk": "^2.1066.0",
|
|
52
|
+
"constructs": "^10.0.48",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"moment": "^2.29.1",
|
|
55
55
|
"nconf": "^0.11.3",
|
|
@@ -59,36 +59,39 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
61
61
|
"@types/jest": "^27.4.0",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^5.10.
|
|
63
|
-
"@typescript-eslint/parser": "^5.10.
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
63
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
64
64
|
"aws-cdk": "*",
|
|
65
65
|
"babel-eslint": "^10.1.0",
|
|
66
|
-
"better-docs": "^2.
|
|
66
|
+
"better-docs": "^2.7.1",
|
|
67
67
|
"codecov": "^3.8.3",
|
|
68
68
|
"commitizen": "^4.2.4",
|
|
69
|
-
"dotenv": "^14.2
|
|
70
|
-
"eslint": "^8.
|
|
69
|
+
"dotenv": "^14.3.2",
|
|
70
|
+
"eslint": "^8.8.0",
|
|
71
71
|
"eslint-config-prettier": "^8.3.0",
|
|
72
72
|
"eslint-plugin-import": "^2.25.4",
|
|
73
73
|
"husky": "^7.0.4",
|
|
74
74
|
"jest": "^27.4.7",
|
|
75
|
-
"jest-extended": "^
|
|
75
|
+
"jest-extended": "^2.0.0",
|
|
76
76
|
"jest-junit": "^13.0.0",
|
|
77
|
-
"jsdoc": "^3.6.
|
|
77
|
+
"jsdoc": "^3.6.10",
|
|
78
78
|
"jsdoc-babel": "^0.5.0",
|
|
79
79
|
"jsdoc-mermaid": "^1.0.0",
|
|
80
80
|
"prettier": "^2.5.1",
|
|
81
|
+
"prettier-plugin-organize-imports": "^2.3.4",
|
|
81
82
|
"rimraf": "^3.0.2",
|
|
82
83
|
"semantic-release": "^19.0.2",
|
|
83
84
|
"ts-jest": "^27.1.3",
|
|
84
85
|
"ts-node": "^10.4.0",
|
|
85
86
|
"typedoc": "^0.22.11",
|
|
86
87
|
"typedoc-plugin-mermaid": "^1.6.0",
|
|
87
|
-
"typescript": "4.5.
|
|
88
|
+
"typescript": "4.5.5"
|
|
88
89
|
},
|
|
89
90
|
"optionalDependencies": {
|
|
90
|
-
"@babel/core": "^7.16.
|
|
91
|
-
"prop-types": "^15.8.1"
|
|
91
|
+
"@babel/core": "^7.16.12",
|
|
92
|
+
"prop-types": "^15.8.1",
|
|
93
|
+
"react": "^17.0.2",
|
|
94
|
+
"react-dom": "^17.0.2"
|
|
92
95
|
},
|
|
93
96
|
"config": {
|
|
94
97
|
"commitizen": {
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib'
|
|
2
|
-
import { createCfnOutput, isDevStage, isPrdStage, isTestStage, isUatStage } from '../utils'
|
|
3
|
-
import { CommonStackProps } from '../types'
|
|
4
|
-
import { Route53Manager } from '../manager/route53Manager'
|
|
5
|
-
import { S3Manager } from '../manager/s3Manager'
|
|
6
|
-
import { AcmManager } from '../manager/acmManager'
|
|
7
|
-
import { CloudFrontManager } from '../manager/cloudFrontManager'
|
|
8
|
-
import { LogManager } from '../manager/logManager'
|
|
9
|
-
import { IamManager } from '../manager/iamManager'
|
|
10
|
-
import { CloudTrailManager } from '../manager/cloudTrailManager'
|
|
11
|
-
import { EcsManager } from '../manager/ecsManager'
|
|
12
|
-
import { EventManager } from '../manager/eventManager'
|
|
13
|
-
import { VpcManager } from '../manager/vpcManager'
|
|
14
|
-
import { EksManager } from '../manager/eksManager'
|
|
15
|
-
import { EcrManager } from '../manager/ecrManager'
|
|
16
|
-
import { LambdaManager } from '../manager/lambdaManager'
|
|
17
|
-
import { SnsManager } from '../manager/snsManager'
|
|
18
|
-
import { SecretsManager } from '../manager/secretsManager'
|
|
19
|
-
import { CloudWatchManager } from '../manager/cloudWatchManager'
|
|
20
|
-
import { WafManager } from '../manager/wafManager'
|
|
21
|
-
import { AppConfigManager } from '../manager/appConfigManager'
|
|
22
2
|
import { Construct } from 'constructs'
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
3
|
+
import * as aws from '../manager/aws'
|
|
4
|
+
import * as types from '../types'
|
|
5
|
+
import * as utils from '../utils'
|
|
26
6
|
|
|
27
7
|
/**
|
|
28
8
|
* @stability stable
|
|
@@ -45,28 +25,29 @@ import { CodeBuildManager } from '../manager/codeBuildManager'
|
|
|
45
25
|
* B(Construct)-->|implements|C(IConstruct);
|
|
46
26
|
*/
|
|
47
27
|
export class CommonConstruct extends Construct {
|
|
48
|
-
props: CommonStackProps
|
|
49
|
-
acmManager: AcmManager
|
|
50
|
-
apiManager: ApiManager
|
|
51
|
-
appConfigManager: AppConfigManager
|
|
52
|
-
codeBuildManager: CodeBuildManager
|
|
53
|
-
cloudFrontManager: CloudFrontManager
|
|
54
|
-
cloudTrailManager: CloudTrailManager
|
|
55
|
-
cloudWatchManager: CloudWatchManager
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
28
|
+
props: types.CommonStackProps
|
|
29
|
+
acmManager: aws.AcmManager
|
|
30
|
+
apiManager: aws.ApiManager
|
|
31
|
+
appConfigManager: aws.AppConfigManager
|
|
32
|
+
codeBuildManager: aws.CodeBuildManager
|
|
33
|
+
cloudFrontManager: aws.CloudFrontManager
|
|
34
|
+
cloudTrailManager: aws.CloudTrailManager
|
|
35
|
+
cloudWatchManager: aws.CloudWatchManager
|
|
36
|
+
dynamodbManager: aws.DynamodbManager
|
|
37
|
+
ecrManager: aws.EcrManager
|
|
38
|
+
ecsManager: aws.EcsManager
|
|
39
|
+
eksManager: aws.EksManager
|
|
40
|
+
eventManager: aws.EventManager
|
|
41
|
+
iamManager: aws.IamManager
|
|
42
|
+
lambdaManager: aws.LambdaManager
|
|
43
|
+
logManager: aws.LogManager
|
|
44
|
+
route53Manager: aws.Route53Manager
|
|
45
|
+
s3Manager: aws.S3Manager
|
|
46
|
+
secretsManager: aws.SecretsManager
|
|
47
|
+
snsManager: aws.SnsManager
|
|
48
|
+
ssMManager: aws.SsmManager
|
|
49
|
+
vpcManager: aws.VpcManager
|
|
50
|
+
wafManager: aws.WafManager
|
|
70
51
|
fullyQualifiedDomainName: string
|
|
71
52
|
|
|
72
53
|
/**
|
|
@@ -75,31 +56,32 @@ export class CommonConstruct extends Construct {
|
|
|
75
56
|
* @param {string} id scoped id of the resource
|
|
76
57
|
* @param {CommonStackProps} props
|
|
77
58
|
*/
|
|
78
|
-
constructor(parent: Construct, id: string, props: CommonStackProps) {
|
|
59
|
+
constructor(parent: Construct, id: string, props: types.CommonStackProps) {
|
|
79
60
|
super(parent, id)
|
|
80
61
|
this.props = props
|
|
81
|
-
this.acmManager = new AcmManager()
|
|
82
|
-
this.apiManager = new ApiManager()
|
|
83
|
-
this.appConfigManager = new AppConfigManager()
|
|
84
|
-
this.codeBuildManager = new CodeBuildManager()
|
|
85
|
-
this.cloudFrontManager = new CloudFrontManager()
|
|
86
|
-
this.cloudTrailManager = new CloudTrailManager()
|
|
87
|
-
this.cloudWatchManager = new CloudWatchManager()
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
101
|
-
this.vpcManager = new VpcManager()
|
|
102
|
-
this.
|
|
62
|
+
this.acmManager = new aws.AcmManager()
|
|
63
|
+
this.apiManager = new aws.ApiManager()
|
|
64
|
+
this.appConfigManager = new aws.AppConfigManager()
|
|
65
|
+
this.codeBuildManager = new aws.CodeBuildManager()
|
|
66
|
+
this.cloudFrontManager = new aws.CloudFrontManager()
|
|
67
|
+
this.cloudTrailManager = new aws.CloudTrailManager()
|
|
68
|
+
this.cloudWatchManager = new aws.CloudWatchManager()
|
|
69
|
+
this.dynamodbManager = new aws.DynamodbManager()
|
|
70
|
+
this.ecrManager = new aws.EcrManager()
|
|
71
|
+
this.ecsManager = new aws.EcsManager()
|
|
72
|
+
this.eksManager = new aws.EksManager()
|
|
73
|
+
this.eventManager = new aws.EventManager()
|
|
74
|
+
this.iamManager = new aws.IamManager()
|
|
75
|
+
this.lambdaManager = new aws.LambdaManager()
|
|
76
|
+
this.logManager = new aws.LogManager()
|
|
77
|
+
this.route53Manager = new aws.Route53Manager()
|
|
78
|
+
this.s3Manager = new aws.S3Manager()
|
|
79
|
+
this.secretsManager = new aws.SecretsManager()
|
|
80
|
+
this.snsManager = new aws.SnsManager()
|
|
81
|
+
this.ssMManager = new aws.SsmManager()
|
|
82
|
+
this.vpcManager = new aws.VpcManager()
|
|
83
|
+
this.vpcManager = new aws.VpcManager()
|
|
84
|
+
this.wafManager = new aws.WafManager()
|
|
103
85
|
|
|
104
86
|
this.determineFullyQualifiedDomain()
|
|
105
87
|
}
|
|
@@ -112,7 +94,7 @@ export class CommonConstruct extends Construct {
|
|
|
112
94
|
* @param {boolean} overrideId Flag which indicates whether to override the default logical id of the output
|
|
113
95
|
*/
|
|
114
96
|
protected addCfnOutput(id: string, value: string, description?: string, overrideId = true): cdk.CfnOutput {
|
|
115
|
-
return createCfnOutput(id, this, value, description, overrideId)
|
|
97
|
+
return utils.createCfnOutput(id, this, value, description, overrideId)
|
|
116
98
|
}
|
|
117
99
|
|
|
118
100
|
/**
|
|
@@ -128,23 +110,23 @@ export class CommonConstruct extends Construct {
|
|
|
128
110
|
* @summary Utility method to determine if the initialisation is in development (dev) stage
|
|
129
111
|
* This is determined by the stage property injected via cdk context
|
|
130
112
|
*/
|
|
131
|
-
public isDevelopmentStage = () => isDevStage(this.props.stage)
|
|
113
|
+
public isDevelopmentStage = () => utils.isDevStage(this.props.stage)
|
|
132
114
|
|
|
133
115
|
/**
|
|
134
116
|
* @summary Utility method to determine if the initialisation is in test (tst) stage
|
|
135
117
|
* This is determined by the stage property injected via cdk context
|
|
136
118
|
*/
|
|
137
|
-
public isTestStage = () => isTestStage(this.props.stage)
|
|
119
|
+
public isTestStage = () => utils.isTestStage(this.props.stage)
|
|
138
120
|
|
|
139
121
|
/**
|
|
140
122
|
* @summary Utility method to determine if the initialisation is in uat (uat) stage
|
|
141
123
|
* This is determined by the stage property injected via cdk context
|
|
142
124
|
*/
|
|
143
|
-
public isUatStage = () => isUatStage(this.props.stage)
|
|
125
|
+
public isUatStage = () => utils.isUatStage(this.props.stage)
|
|
144
126
|
|
|
145
127
|
/**
|
|
146
128
|
* @summary Utility method to determine if the initialisation is in production (prd) stage
|
|
147
129
|
* This is determined by the stage property injected via cdk context
|
|
148
130
|
*/
|
|
149
|
-
public isProductionStage = () => isPrdStage(this.props.stage)
|
|
131
|
+
public isProductionStage = () => utils.isPrdStage(this.props.stage)
|
|
150
132
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib'
|
|
2
|
+
import { CommonStackProps } from '../types'
|
|
2
3
|
import { isDevStage } from '../utils'
|
|
3
4
|
import { CommonConstruct } from './commonConstruct'
|
|
4
|
-
import { CommonStackProps } from '../types'
|
|
5
5
|
|
|
6
6
|
const appRoot = require('app-root-path')
|
|
7
7
|
const fs = require('fs')
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as apig from 'aws-cdk-lib/aws-apigateway'
|
|
2
|
+
import * as acm from 'aws-cdk-lib/aws-certificatemanager'
|
|
2
3
|
import * as iam from 'aws-cdk-lib/aws-iam'
|
|
3
|
-
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'
|
|
4
4
|
import * as lambda from 'aws-cdk-lib/aws-lambda'
|
|
5
|
-
import * as apig from 'aws-cdk-lib/aws-apigateway'
|
|
6
5
|
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
7
|
-
import * as
|
|
8
|
-
import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from '../types'
|
|
6
|
+
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'
|
|
9
7
|
import { Construct } from 'constructs'
|
|
8
|
+
import { CommonConstruct } from '../common/commonConstruct'
|
|
9
|
+
import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from '../types'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @stability stable
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Construct } from 'constructs'
|
|
2
|
-
import { CommonConstruct } from '../common/commonConstruct'
|
|
3
|
-
import { SiteWithEcsBackendProps } from '../types'
|
|
4
1
|
import * as cdk from 'aws-cdk-lib'
|
|
5
|
-
import * as iam from 'aws-cdk-lib/aws-iam'
|
|
6
|
-
import * as ec2 from 'aws-cdk-lib/aws-ec2'
|
|
7
|
-
import * as ecs from 'aws-cdk-lib/aws-ecs'
|
|
8
|
-
import * as logs from 'aws-cdk-lib/aws-logs'
|
|
9
|
-
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
10
2
|
import * as certificateManager from 'aws-cdk-lib/aws-certificatemanager'
|
|
11
3
|
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'
|
|
4
|
+
import * as origins from 'aws-cdk-lib/aws-cloudfront-origins'
|
|
5
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2'
|
|
6
|
+
import * as ecs from 'aws-cdk-lib/aws-ecs'
|
|
12
7
|
import * as ecsPatterns from 'aws-cdk-lib/aws-ecs-patterns'
|
|
13
8
|
import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2'
|
|
14
|
-
import * as
|
|
9
|
+
import * as iam from 'aws-cdk-lib/aws-iam'
|
|
10
|
+
import * as logs from 'aws-cdk-lib/aws-logs'
|
|
11
|
+
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
15
12
|
import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
16
13
|
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'
|
|
14
|
+
import { Construct } from 'constructs'
|
|
15
|
+
import { CommonConstruct } from '../common/commonConstruct'
|
|
16
|
+
import { SiteWithEcsBackendProps } from '../types'
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @stability stable
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CommonConstruct } from '../common/commonConstruct'
|
|
2
|
-
import { StaticSiteProps } from '../types'
|
|
3
|
-
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
4
1
|
import * as certificateManager from 'aws-cdk-lib/aws-certificatemanager'
|
|
5
|
-
import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
6
2
|
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'
|
|
7
|
-
import { Construct } from 'constructs'
|
|
8
3
|
import * as origins from 'aws-cdk-lib/aws-cloudfront-origins'
|
|
4
|
+
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
5
|
+
import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
6
|
+
import { Construct } from 'constructs'
|
|
7
|
+
import { CommonConstruct } from '../common/commonConstruct'
|
|
8
|
+
import { StaticSiteProps } from '../types'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @stability stable
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib'
|
|
1
2
|
import * as acm from 'aws-cdk-lib/aws-certificatemanager'
|
|
2
3
|
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { createCfnOutput } from '../utils'
|
|
4
|
+
import * as common from '../../common'
|
|
5
|
+
import * as types from '../../types'
|
|
6
|
+
import * as utils from '../../utils'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @stability stable
|
|
10
10
|
* @category Security, Identity & Compliance
|
|
11
11
|
* @summary Provides operations on AWS Certificates.
|
|
12
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
13
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
12
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
13
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
14
14
|
* @example
|
|
15
15
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
16
16
|
*
|
|
@@ -28,8 +28,8 @@ export class AcmManager {
|
|
|
28
28
|
/**
|
|
29
29
|
* @summary Method to create/import a certificate
|
|
30
30
|
* @param {string} id scoped id of the resource
|
|
31
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
32
|
-
* @param {AcmProps} props certificate props
|
|
31
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
32
|
+
* @param {types.AcmProps} props certificate props
|
|
33
33
|
* @param {route53.HostedZone?} hostedZone optional hosted zone to perform DNS validation
|
|
34
34
|
* @returns {acm.ICertificate}
|
|
35
35
|
*
|
|
@@ -46,8 +46,8 @@ export class AcmManager {
|
|
|
46
46
|
*/
|
|
47
47
|
public resolveCertificate(
|
|
48
48
|
id: string,
|
|
49
|
-
scope: CommonConstruct,
|
|
50
|
-
props: AcmProps,
|
|
49
|
+
scope: common.CommonConstruct,
|
|
50
|
+
props: types.AcmProps,
|
|
51
51
|
hostedZone?: route53.IHostedZone
|
|
52
52
|
): acm.ICertificate {
|
|
53
53
|
if (!props) throw `Certificate props undefined`
|
|
@@ -70,7 +70,7 @@ export class AcmManager {
|
|
|
70
70
|
})
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
createCfnOutput(`${id}-certificateArn`, scope, certificate.certificateArn)
|
|
73
|
+
utils.createCfnOutput(`${id}-certificateArn`, scope, certificate.certificateArn)
|
|
74
74
|
|
|
75
75
|
return certificate
|
|
76
76
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { CommonConstruct } from '../common/commonConstruct'
|
|
2
1
|
import * as apig from 'aws-cdk-lib/aws-apigateway'
|
|
3
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda'
|
|
4
2
|
import * as acm from 'aws-cdk-lib/aws-certificatemanager'
|
|
5
|
-
import
|
|
3
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda'
|
|
4
|
+
import * as common from '../../common'
|
|
5
|
+
import * as utils from '../../utils'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @stability stable
|
|
9
9
|
* @category Networking & Content Delivery
|
|
10
10
|
* @summary Provides operations on AWS API Gateway.
|
|
11
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
12
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
11
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
12
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
13
13
|
* @example
|
|
14
|
-
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
14
|
+
* import { common.CommonConstruct } from '@gradientedge/cdk-utils'
|
|
15
15
|
*
|
|
16
|
-
* class CustomConstruct extends CommonConstruct {
|
|
16
|
+
* class CustomConstruct extends common.CommonConstruct {
|
|
17
17
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
18
18
|
* super(parent, id, props)
|
|
19
19
|
* this.props = props
|
|
@@ -28,19 +28,20 @@ export class ApiManager {
|
|
|
28
28
|
/**
|
|
29
29
|
* @summary Method to create a Rest API with Lambda backend/target
|
|
30
30
|
* @param {string} id scoped id of the resource
|
|
31
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
31
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
32
32
|
* @param {AcmProps} props lambda rest api props
|
|
33
33
|
* @param lambdaFunction
|
|
34
34
|
*/
|
|
35
35
|
public createLambdaRestApi(
|
|
36
36
|
id: string,
|
|
37
|
-
scope: CommonConstruct,
|
|
37
|
+
scope: common.CommonConstruct,
|
|
38
38
|
props: apig.LambdaRestApiProps,
|
|
39
39
|
lambdaFunction: lambda.Function
|
|
40
40
|
) {
|
|
41
41
|
const api = new apig.LambdaRestApi(scope, `${id}`, {
|
|
42
42
|
binaryMediaTypes: props.binaryMediaTypes,
|
|
43
43
|
minimumCompressionSize: props.minimumCompressionSize,
|
|
44
|
+
defaultMethodOptions: props.defaultMethodOptions,
|
|
44
45
|
deploy: props.deploy || true,
|
|
45
46
|
deployOptions: {
|
|
46
47
|
stageName: scope.props.stage,
|
|
@@ -68,15 +69,12 @@ export class ApiManager {
|
|
|
68
69
|
},
|
|
69
70
|
restApiName: `${props.restApiName}-${scope.props.stage}`,
|
|
70
71
|
handler: lambdaFunction,
|
|
71
|
-
defaultCorsPreflightOptions:
|
|
72
|
-
allowOrigins: props.defaultCorsPreflightOptions?.allowOrigins || apig.Cors.ALL_ORIGINS,
|
|
73
|
-
allowMethods: props.defaultCorsPreflightOptions?.allowMethods || apig.Cors.ALL_METHODS,
|
|
74
|
-
},
|
|
72
|
+
defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
|
|
75
73
|
proxy: props.proxy || true,
|
|
76
74
|
})
|
|
77
75
|
|
|
78
|
-
createCfnOutput(`${id}-restApiId`, scope, api.restApiId)
|
|
79
|
-
createCfnOutput(`${id}-restApiName`, scope, api.restApiName)
|
|
76
|
+
utils.createCfnOutput(`${id}-restApiId`, scope, api.restApiId)
|
|
77
|
+
utils.createCfnOutput(`${id}-restApiName`, scope, api.restApiName)
|
|
80
78
|
|
|
81
79
|
return api
|
|
82
80
|
}
|
|
@@ -84,11 +82,11 @@ export class ApiManager {
|
|
|
84
82
|
/**
|
|
85
83
|
* @summary Method to create custom api domain
|
|
86
84
|
* @param {string} id scoped id of the resource
|
|
87
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
85
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
88
86
|
* @param domainName the domain name to use
|
|
89
87
|
* @param certificate the certificate used for custom api domain
|
|
90
88
|
*/
|
|
91
|
-
public createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: acm.ICertificate) {
|
|
89
|
+
public createApiDomain(id: string, scope: common.CommonConstruct, domainName: string, certificate: acm.ICertificate) {
|
|
92
90
|
const apiDomain = new apig.DomainName(scope, `${id}`, {
|
|
93
91
|
domainName: domainName,
|
|
94
92
|
certificate: certificate,
|
|
@@ -96,7 +94,7 @@ export class ApiManager {
|
|
|
96
94
|
securityPolicy: apig.SecurityPolicy.TLS_1_2,
|
|
97
95
|
})
|
|
98
96
|
|
|
99
|
-
createCfnOutput(`${id}-customDomainName`, scope, apiDomain.domainName)
|
|
97
|
+
utils.createCfnOutput(`${id}-customDomainName`, scope, apiDomain.domainName)
|
|
100
98
|
|
|
101
99
|
return apiDomain
|
|
102
100
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as appconfig from 'aws-cdk-lib/aws-appconfig'
|
|
2
1
|
import * as cdk from 'aws-cdk-lib'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import * as appconfig from 'aws-cdk-lib/aws-appconfig'
|
|
3
|
+
import * as common from '../../common'
|
|
4
|
+
import * as types from '../../types'
|
|
5
|
+
import * as utils from '../../utils'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @stability stable
|
|
@@ -35,12 +35,12 @@ export const ArnsByRegion: { [key: string]: string } = {
|
|
|
35
35
|
/**
|
|
36
36
|
* @category Management & Governance
|
|
37
37
|
* @summary Provides operations on AWS AppConfig.
|
|
38
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
39
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
38
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
39
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
40
40
|
* @example
|
|
41
41
|
* import * as common from '@gradientedge/cdk-utils'
|
|
42
42
|
*
|
|
43
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
43
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
44
44
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
45
45
|
* super(parent, id, props)
|
|
46
46
|
* this.props = props
|
|
@@ -53,20 +53,24 @@ export const ArnsByRegion: { [key: string]: string } = {
|
|
|
53
53
|
export class AppConfigManager {
|
|
54
54
|
/**
|
|
55
55
|
* Method to get static ARNs for AppConfig extensions
|
|
56
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
56
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
57
57
|
*/
|
|
58
|
-
public getArnForAppConfigExtension(scope: CommonConstruct) {
|
|
58
|
+
public getArnForAppConfigExtension(scope: common.CommonConstruct) {
|
|
59
59
|
return ArnsByRegion[scope.props.region]
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* @summary Method to create an AppConfig Application
|
|
64
64
|
* @param {string} id scoped id of the resource
|
|
65
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
66
|
-
* @param {AppConfigProps} props
|
|
65
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
66
|
+
* @param {types.AppConfigProps} props
|
|
67
67
|
* @returns {appconfig.CfnApplication}
|
|
68
68
|
*/
|
|
69
|
-
public createApplication(
|
|
69
|
+
public createApplication(
|
|
70
|
+
id: string,
|
|
71
|
+
scope: common.CommonConstruct,
|
|
72
|
+
props: types.AppConfigProps
|
|
73
|
+
): appconfig.CfnApplication {
|
|
70
74
|
if (!props) throw `AppConfig props undefined`
|
|
71
75
|
|
|
72
76
|
const application = new appconfig.CfnApplication(scope, `${id}`, {
|
|
@@ -75,8 +79,8 @@ export class AppConfigManager {
|
|
|
75
79
|
tags: props.application.tags,
|
|
76
80
|
})
|
|
77
81
|
|
|
78
|
-
createCfnOutput(`${id}-ApplicationId`, scope, cdk.Fn.ref(application.logicalId))
|
|
79
|
-
createCfnOutput(`${id}-ApplicationName`, scope, application.name)
|
|
82
|
+
utils.createCfnOutput(`${id}-ApplicationId`, scope, cdk.Fn.ref(application.logicalId))
|
|
83
|
+
utils.createCfnOutput(`${id}-ApplicationName`, scope, application.name)
|
|
80
84
|
|
|
81
85
|
return application
|
|
82
86
|
}
|
|
@@ -84,16 +88,16 @@ export class AppConfigManager {
|
|
|
84
88
|
/**
|
|
85
89
|
* @summary Method to create an AppConfig Environment for a given application
|
|
86
90
|
* @param {string} id scoped id of the resource
|
|
87
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
91
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
88
92
|
* @param {string} applicationId id of the application
|
|
89
|
-
* @param {AppConfigProps} props
|
|
93
|
+
* @param {types.AppConfigProps} props
|
|
90
94
|
* @returns {appconfig.CfnEnvironment}
|
|
91
95
|
*/
|
|
92
96
|
public createEnvironment(
|
|
93
97
|
id: string,
|
|
94
|
-
scope: CommonConstruct,
|
|
98
|
+
scope: common.CommonConstruct,
|
|
95
99
|
applicationId: string,
|
|
96
|
-
props: AppConfigProps
|
|
100
|
+
props: types.AppConfigProps
|
|
97
101
|
): appconfig.CfnEnvironment {
|
|
98
102
|
if (!props) throw `AppConfig props undefined`
|
|
99
103
|
|
|
@@ -105,8 +109,8 @@ export class AppConfigManager {
|
|
|
105
109
|
tags: props.environment.tags,
|
|
106
110
|
})
|
|
107
111
|
|
|
108
|
-
createCfnOutput(`${id}-configurationEnvironmentId`, scope, cdk.Fn.ref(environment.logicalId))
|
|
109
|
-
createCfnOutput(`${id}-configurationEnvironmentName`, scope, environment.name)
|
|
112
|
+
utils.createCfnOutput(`${id}-configurationEnvironmentId`, scope, cdk.Fn.ref(environment.logicalId))
|
|
113
|
+
utils.createCfnOutput(`${id}-configurationEnvironmentName`, scope, environment.name)
|
|
110
114
|
|
|
111
115
|
return environment
|
|
112
116
|
}
|
|
@@ -115,16 +119,16 @@ export class AppConfigManager {
|
|
|
115
119
|
* @summary Method to create an AppConfig Configuration Profile for a given application
|
|
116
120
|
* - <p>⚠ The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
|
|
117
121
|
* @param {string} id scoped id of the resource
|
|
118
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
122
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
119
123
|
* @param {string} applicationId id of the application
|
|
120
|
-
* @param {AppConfigProps} props
|
|
124
|
+
* @param {types.AppConfigProps} props
|
|
121
125
|
* @returns {appconfig.CfnConfigurationProfile}
|
|
122
126
|
*/
|
|
123
127
|
public createConfigurationProfile(
|
|
124
128
|
id: string,
|
|
125
|
-
scope: CommonConstruct,
|
|
129
|
+
scope: common.CommonConstruct,
|
|
126
130
|
applicationId: string,
|
|
127
|
-
props: AppConfigProps
|
|
131
|
+
props: types.AppConfigProps
|
|
128
132
|
): appconfig.CfnConfigurationProfile {
|
|
129
133
|
if (!props) throw `AppConfig props undefined`
|
|
130
134
|
|
|
@@ -138,8 +142,8 @@ export class AppConfigManager {
|
|
|
138
142
|
validators: props.configurationProfile.validators,
|
|
139
143
|
})
|
|
140
144
|
|
|
141
|
-
createCfnOutput(`${id}-configurationProfileId`, scope, cdk.Fn.ref(profile.logicalId))
|
|
142
|
-
createCfnOutput(`${id}-configurationProfileName`, scope, profile.name)
|
|
145
|
+
utils.createCfnOutput(`${id}-configurationProfileId`, scope, cdk.Fn.ref(profile.logicalId))
|
|
146
|
+
utils.createCfnOutput(`${id}-configurationProfileName`, scope, profile.name)
|
|
143
147
|
|
|
144
148
|
return profile
|
|
145
149
|
}
|