@gradientedge/cdk-utils 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +25 -45
- package/dist/src/lib/common/commonConstruct.d.ts.map +1 -1
- package/dist/src/lib/common/commonConstruct.js +48 -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} +10 -10
- 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/{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 +22 -0
- package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/index.js +34 -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} +16 -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 +53 -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} +14 -14
- 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/{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 +21 -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} +15 -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
|
@@ -20,22 +20,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.LambdaManager = void 0;
|
|
23
|
+
const pylambda = __importStar(require("@aws-cdk/aws-lambda-python-alpha"));
|
|
23
24
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
24
25
|
const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
25
26
|
const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
26
|
-
const
|
|
27
|
-
const utils_1 = require("../utils");
|
|
27
|
+
const utils = __importStar(require("../../utils"));
|
|
28
28
|
const cloudFrontManager_1 = require("./cloudFrontManager");
|
|
29
29
|
/**
|
|
30
30
|
* @stability stable
|
|
31
31
|
* @category Compute
|
|
32
32
|
* @summary Provides operations on AWS Lambda.
|
|
33
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
34
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
33
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
34
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
35
35
|
* @example
|
|
36
36
|
* import * as common from '@gradientedge/cdk-utils'
|
|
37
37
|
*
|
|
38
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
38
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
39
39
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
40
40
|
* super(parent, id, props)
|
|
41
41
|
* this.props = props
|
|
@@ -49,7 +49,7 @@ class LambdaManager {
|
|
|
49
49
|
/**
|
|
50
50
|
* @summary Method to create a lambda layer (nodejs)
|
|
51
51
|
* @param {string} id scoped id of the resource
|
|
52
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
52
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
53
53
|
* @param {lambda.AssetCode} code
|
|
54
54
|
*/
|
|
55
55
|
createLambdaLayer(id, scope, code) {
|
|
@@ -59,13 +59,13 @@ class LambdaManager {
|
|
|
59
59
|
description: `${id}`,
|
|
60
60
|
layerVersionName: `${id}-${scope.props.stage}`,
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
utils.createCfnOutput(`${id}-lambdaLayerArn`, scope, lambdaLayer.layerVersionArn);
|
|
63
63
|
return lambdaLayer;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* @summary Method to create a lambda layer (python)
|
|
67
67
|
* @param {string} id scoped id of the resource
|
|
68
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
68
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
69
69
|
* @param {string} entry path to layer source
|
|
70
70
|
*/
|
|
71
71
|
createPythonLambdaLayer(id, scope, entry) {
|
|
@@ -75,14 +75,14 @@ class LambdaManager {
|
|
|
75
75
|
entry: entry,
|
|
76
76
|
layerVersionName: `${id}-${scope.props.stage}`,
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
utils.createCfnOutput(`${id}-lambdaLayerArn`, scope, lambdaLayer.layerVersionArn);
|
|
79
79
|
return lambdaLayer;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* @summary Method to create a lambda function (nodejs)
|
|
83
83
|
* @param {string} id scoped id of the resource
|
|
84
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
85
|
-
* @param {LambdaProps} props
|
|
84
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
85
|
+
* @param {types.LambdaProps} props
|
|
86
86
|
* @param {iam.Role | iam.CfnRole} role
|
|
87
87
|
* @param {lambda.ILayerVersion[]} layers
|
|
88
88
|
* @param {lambda.AssetCode} code
|
|
@@ -117,15 +117,15 @@ class LambdaManager {
|
|
|
117
117
|
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
118
118
|
vpc: vpc,
|
|
119
119
|
});
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
121
|
+
utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
|
|
122
122
|
return lambdaFunction;
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* @summary Method to create a lambda function (python)
|
|
126
126
|
* @param {string} id scoped id of the resource
|
|
127
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
128
|
-
* @param {LambdaProps} props
|
|
127
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
128
|
+
* @param {types.LambdaProps} props
|
|
129
129
|
* @param {iam.Role | iam.CfnRole} role
|
|
130
130
|
* @param {lambda.ILayerVersion[]} layers
|
|
131
131
|
* @param {string} entry path to lambda source
|
|
@@ -162,16 +162,16 @@ class LambdaManager {
|
|
|
162
162
|
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
163
163
|
vpc: vpc,
|
|
164
164
|
});
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
166
|
+
utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
|
|
167
167
|
return lambdaFunction;
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* @summary Method to provision a Lambda@Edge function
|
|
171
171
|
*
|
|
172
172
|
* @param {string} id scoped id of the resource
|
|
173
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
174
|
-
* @param {LambdaEdgeProps} props lambda@edge properties
|
|
173
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
174
|
+
* @param {types.LambdaEdgeProps} props lambda@edge properties
|
|
175
175
|
* @param {lambda.ILayerVersion[]} layers
|
|
176
176
|
* @param {lambda.AssetCode} code
|
|
177
177
|
* @param {Map<string, string>} environment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambdaManager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/lambdaManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2EAA4D;AAC5D,iDAAkC;AAGlC,yDAA0C;AAC1C,+DAAgD;AAGhD,mDAAoC;AACpC,2DAAuD;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,aAAa;IACxB;;;;;OAKG;IACI,iBAAiB,CAAC,EAAU,EAAE,KAA6B,EAAE,IAAsB;QACxF,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YAC1D,kBAAkB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;YAChD,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,GAAG,EAAE,EAAE;YACpB,gBAAgB,EAAE,GAAG,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;SAC/C,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;QAEjF,OAAO,WAAW,CAAA;IACpB,CAAC;IAED;;;;;OAKG;IACI,uBAA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A4B,EAC5B,MAA8B,EAC9B,IAAsB,EACtB,WAAiB,EACjB,GAAc,EACd,cAAqC,EACrC,WAA8B,EAC9B,SAAkB;QAElB,OAAO,IAAI,qCAAiB,EAAE,CAAC,kBAAkB,CAC/C,EAAE,EACF,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,GAAG,EACH,cAAc,EACd,WAAW,EACX,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAxMD,sCAwMC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib';
|
|
2
2
|
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import * as common from '../../common';
|
|
4
|
+
import * as types from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* @stability stable
|
|
7
7
|
* @category Management & Governance
|
|
8
8
|
* @summary Provides operations on AWS CloudWatch.
|
|
9
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
10
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
9
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
10
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
11
11
|
* @example
|
|
12
12
|
* import * as common from '@gradientedge/cdk-utils'
|
|
13
13
|
*
|
|
14
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
14
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
15
15
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
16
16
|
* super(parent, id, props)
|
|
17
17
|
* this.props = props
|
|
@@ -25,27 +25,27 @@ export declare class LogManager {
|
|
|
25
25
|
/**
|
|
26
26
|
* @summary Method to create a cloudwatch metric filter
|
|
27
27
|
* @param {string} id scoped id of the resource
|
|
28
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
29
|
-
* @param {MetricFilterProps} props
|
|
28
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
29
|
+
* @param {types.MetricFilterProps} props
|
|
30
30
|
* @param {logs.ILogGroup} logGroup
|
|
31
31
|
*/
|
|
32
|
-
createMetricFilter(id: string, scope: CommonConstruct, props: MetricFilterProps, logGroup: logs.ILogGroup): {
|
|
32
|
+
createMetricFilter(id: string, scope: common.CommonConstruct, props: types.MetricFilterProps, logGroup: logs.ILogGroup): {
|
|
33
33
|
metricFilter: cdk.aws_logs.MetricFilter;
|
|
34
34
|
metric: cdk.aws_cloudwatch.Metric;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* @summary Method to create a cloudwatch log group (cfn)
|
|
38
38
|
* @param {string} id scoped id of the resource
|
|
39
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
40
|
-
* @param {LogProps} props
|
|
39
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
40
|
+
* @param {types.LogProps} props
|
|
41
41
|
*/
|
|
42
|
-
createCfnLogGroup(id: string, scope: CommonConstruct, props: LogProps): cdk.aws_logs.CfnLogGroup;
|
|
42
|
+
createCfnLogGroup(id: string, scope: common.CommonConstruct, props: types.LogProps): cdk.aws_logs.CfnLogGroup;
|
|
43
43
|
/**
|
|
44
44
|
* @summary Method to create a cloudwatch log group
|
|
45
45
|
* @param {string} id scoped id of the resource
|
|
46
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
47
|
-
* @param {LogProps} props
|
|
46
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
47
|
+
* @param {types.LogProps} props
|
|
48
48
|
*/
|
|
49
|
-
createLogGroup(id: string, scope: CommonConstruct, props: LogProps): cdk.aws_logs.LogGroup;
|
|
49
|
+
createLogGroup(id: string, scope: common.CommonConstruct, props: types.LogProps): cdk.aws_logs.LogGroup;
|
|
50
50
|
}
|
|
51
51
|
//# sourceMappingURL=logManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logManager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/logManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,UAAU;IACrB;;;;;;OAMG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS;;;;IAwB1B;;;;;OAKG;IACI,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ;IAazF;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ;CAavF"}
|
|
@@ -22,17 +22,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.LogManager = void 0;
|
|
23
23
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
24
24
|
const logs = __importStar(require("aws-cdk-lib/aws-logs"));
|
|
25
|
-
const
|
|
25
|
+
const utils = __importStar(require("../../utils"));
|
|
26
26
|
/**
|
|
27
27
|
* @stability stable
|
|
28
28
|
* @category Management & Governance
|
|
29
29
|
* @summary Provides operations on AWS CloudWatch.
|
|
30
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
31
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
30
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
31
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
32
32
|
* @example
|
|
33
33
|
* import * as common from '@gradientedge/cdk-utils'
|
|
34
34
|
*
|
|
35
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
35
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
36
36
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
37
37
|
* super(parent, id, props)
|
|
38
38
|
* this.props = props
|
|
@@ -46,8 +46,8 @@ class LogManager {
|
|
|
46
46
|
/**
|
|
47
47
|
* @summary Method to create a cloudwatch metric filter
|
|
48
48
|
* @param {string} id scoped id of the resource
|
|
49
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
50
|
-
* @param {MetricFilterProps} props
|
|
49
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
50
|
+
* @param {types.MetricFilterProps} props
|
|
51
51
|
* @param {logs.ILogGroup} logGroup
|
|
52
52
|
*/
|
|
53
53
|
createMetricFilter(id, scope, props, logGroup) {
|
|
@@ -73,8 +73,8 @@ class LogManager {
|
|
|
73
73
|
/**
|
|
74
74
|
* @summary Method to create a cloudwatch log group (cfn)
|
|
75
75
|
* @param {string} id scoped id of the resource
|
|
76
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
77
|
-
* @param {LogProps} props
|
|
76
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
77
|
+
* @param {types.LogProps} props
|
|
78
78
|
*/
|
|
79
79
|
createCfnLogGroup(id, scope, props) {
|
|
80
80
|
if (!props)
|
|
@@ -83,14 +83,14 @@ class LogManager {
|
|
|
83
83
|
logGroupName: `${props.logGroupName}-${scope.props.stage}`,
|
|
84
84
|
retentionInDays: props.retention,
|
|
85
85
|
});
|
|
86
|
-
|
|
86
|
+
utils.createCfnOutput(`${id}-logGroupArn`, scope, logGroup.attrArn);
|
|
87
87
|
return logGroup;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* @summary Method to create a cloudwatch log group
|
|
91
91
|
* @param {string} id scoped id of the resource
|
|
92
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
93
|
-
* @param {LogProps} props
|
|
92
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
93
|
+
* @param {types.LogProps} props
|
|
94
94
|
*/
|
|
95
95
|
createLogGroup(id, scope, props) {
|
|
96
96
|
if (!props)
|
|
@@ -100,7 +100,7 @@ class LogManager {
|
|
|
100
100
|
retention: props.retention,
|
|
101
101
|
removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
|
|
102
102
|
});
|
|
103
|
-
|
|
103
|
+
utils.createCfnOutput(`${id}-logGroupArn`, scope, logGroup.logGroupArn);
|
|
104
104
|
return logGroup;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logManager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/logManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAClC,2DAA4C;AAG5C,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,UAAU;IACrB;;;;;;OAMG;IACI,kBAAkB,CACvB,EAAU,EACV,KAA6B,EAC7B,KAA8B,EAC9B,QAAwB;QAExB,IAAI,CAAC,KAAK;YAAE,MAAM,8BAA8B,CAAA;QAEhD,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACzD,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,aAAa,EAAE,KAAK,CAAC,aAAa;SACnC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO;YAC1B,CAAC,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KAAK,CAAC,SAAS;YAC1B,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,GAAG,CAAC,aAAa,CAAC,OAAO;SAChE,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;QAEvE,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AA1ED,gCA0EC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as apig from 'aws-cdk-lib/aws-apigateway';
|
|
2
2
|
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
3
3
|
import * as route53 from 'aws-cdk-lib/aws-route53';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import * as common from '../../common';
|
|
5
|
+
import * as types from '../../types';
|
|
6
6
|
/**
|
|
7
7
|
* @stability stable
|
|
8
8
|
* @category Networking & Content Delivery
|
|
9
9
|
* @summary Provides operations on AWS Route53.
|
|
10
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
11
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
10
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
11
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
12
12
|
* @example
|
|
13
13
|
* import * as common from '@gradientedge/cdk-utils'
|
|
14
14
|
*
|
|
15
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
15
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
16
16
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
17
17
|
* super(parent, id, props)
|
|
18
18
|
* this.props = props
|
|
@@ -26,43 +26,43 @@ export declare class Route53Manager {
|
|
|
26
26
|
/**
|
|
27
27
|
* @summary Method to create a hosted zone
|
|
28
28
|
* @param {string} id scoped id of the resource
|
|
29
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
30
|
-
* @param {Route53Props} props
|
|
29
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
30
|
+
* @param {types.Route53Props} props
|
|
31
31
|
*/
|
|
32
|
-
createHostedZone(id: string, scope: CommonConstruct, props: Route53Props): route53.IHostedZone;
|
|
32
|
+
createHostedZone(id: string, scope: common.CommonConstruct, props: types.Route53Props): route53.IHostedZone;
|
|
33
33
|
/**
|
|
34
34
|
* @summary Method to create/lookup a hosted zone
|
|
35
35
|
* @param {string} id scoped id of the resource
|
|
36
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
36
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
37
37
|
* @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
|
|
38
38
|
*/
|
|
39
|
-
withHostedZoneFromFullyQualifiedDomainName(id: string, scope: CommonConstruct, useExistingHostedZone: boolean): route53.IHostedZone;
|
|
39
|
+
withHostedZoneFromFullyQualifiedDomainName(id: string, scope: common.CommonConstruct, useExistingHostedZone: boolean): route53.IHostedZone;
|
|
40
40
|
/**
|
|
41
41
|
* @summary Method to create a-record for cloudfront target
|
|
42
42
|
* @param {string} id scoped id of the resource
|
|
43
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
43
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
44
44
|
* @param {cloudfront.IDistribution} distribution
|
|
45
45
|
* @param {route53.IHostedZone} hostedZone
|
|
46
46
|
* @param {string} recordName
|
|
47
47
|
*/
|
|
48
|
-
createCloudFrontTargetARecord(id: string, scope: CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
48
|
+
createCloudFrontTargetARecord(id: string, scope: common.CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
49
49
|
/**
|
|
50
50
|
* @summary Method to create a-record for cloudfront target
|
|
51
51
|
* @param {string} id scoped id of the resource
|
|
52
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
52
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
53
53
|
* @param {cloudfront.IDistribution} distribution
|
|
54
54
|
* @param {route53.IHostedZone} hostedZone
|
|
55
55
|
* @param {string} recordName
|
|
56
56
|
*/
|
|
57
|
-
createCloudFrontTargetARecordV2(id: string, scope: CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
57
|
+
createCloudFrontTargetARecordV2(id: string, scope: common.CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
58
58
|
/**
|
|
59
59
|
* @summary Method to create a-record for api gateway target
|
|
60
60
|
* @param {string} id scoped id of the resource
|
|
61
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
61
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
62
62
|
* @param recordName
|
|
63
63
|
* @param apiDomain
|
|
64
64
|
* @param hostedZone
|
|
65
65
|
*/
|
|
66
|
-
createApiGatewayARecord(id: string, scope: CommonConstruct, recordName: string, apiDomain: apig.DomainName, hostedZone: route53.IHostedZone): route53.ARecord;
|
|
66
|
+
createApiGatewayARecord(id: string, scope: common.CommonConstruct, recordName: string, apiDomain: apig.DomainName, hostedZone: route53.IHostedZone): route53.ARecord;
|
|
67
67
|
}
|
|
68
68
|
//# sourceMappingURL=route53Manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route53Manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/route53Manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAA;AAClD,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAA;AAElD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,cAAc;IACzB;;;;;OAKG;IACI,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY;IAsB5F;;;;;OAKG;IACI,0CAA0C,CAC/C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,qBAAqB,EAAE,OAAO;IAqBhC;;;;;;;OAOG;IACI,6BAA6B,CAClC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,YAAY,CAAC,EAAE,UAAU,CAAC,aAAa,EACvC,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,EAChC,UAAU,CAAC,EAAE,MAAM;IAgBrB;;;;;;;OAOG;IACI,+BAA+B,CACpC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,YAAY,CAAC,EAAE,UAAU,CAAC,aAAa,EACvC,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,EAChC,UAAU,CAAC,EAAE,MAAM;IAgBrB;;;;;;;OAOG;IACI,uBAAuB,CAC5B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,UAAU,EAAE,OAAO,CAAC,WAAW;CAgBlC"}
|
|
@@ -22,17 +22,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.Route53Manager = void 0;
|
|
23
23
|
const route53 = __importStar(require("aws-cdk-lib/aws-route53"));
|
|
24
24
|
const route53Targets = __importStar(require("aws-cdk-lib/aws-route53-targets"));
|
|
25
|
-
const
|
|
25
|
+
const utils = __importStar(require("../../utils"));
|
|
26
26
|
/**
|
|
27
27
|
* @stability stable
|
|
28
28
|
* @category Networking & Content Delivery
|
|
29
29
|
* @summary Provides operations on AWS Route53.
|
|
30
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
31
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
30
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
31
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
32
32
|
* @example
|
|
33
33
|
* import * as common from '@gradientedge/cdk-utils'
|
|
34
34
|
*
|
|
35
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
35
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
36
36
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
37
37
|
* super(parent, id, props)
|
|
38
38
|
* this.props = props
|
|
@@ -46,8 +46,8 @@ class Route53Manager {
|
|
|
46
46
|
/**
|
|
47
47
|
* @summary Method to create a hosted zone
|
|
48
48
|
* @param {string} id scoped id of the resource
|
|
49
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
50
|
-
* @param {Route53Props} props
|
|
49
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
50
|
+
* @param {types.Route53Props} props
|
|
51
51
|
*/
|
|
52
52
|
createHostedZone(id, scope, props) {
|
|
53
53
|
let hostedZone;
|
|
@@ -64,14 +64,14 @@ class Route53Manager {
|
|
|
64
64
|
comment: `Hosted zone for ${scope.props.domainName}`,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
utils.createCfnOutput(`${id}-hostedZoneId`, scope, hostedZone.hostedZoneId);
|
|
68
|
+
utils.createCfnOutput(`${id}-hostedZoneArn`, scope, hostedZone.hostedZoneArn);
|
|
69
69
|
return hostedZone;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* @summary Method to create/lookup a hosted zone
|
|
73
73
|
* @param {string} id scoped id of the resource
|
|
74
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
74
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
75
75
|
* @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
|
|
76
76
|
*/
|
|
77
77
|
withHostedZoneFromFullyQualifiedDomainName(id, scope, useExistingHostedZone) {
|
|
@@ -87,14 +87,14 @@ class Route53Manager {
|
|
|
87
87
|
comment: `Hosted zone for ${scope.fullyQualifiedDomainName}`,
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
utils.createCfnOutput(`${id}-hostedZoneId`, scope, hostedZone.hostedZoneId);
|
|
91
|
+
utils.createCfnOutput(`${id}-hostedZoneArn`, scope, hostedZone.hostedZoneArn);
|
|
92
92
|
return hostedZone;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* @summary Method to create a-record for cloudfront target
|
|
96
96
|
* @param {string} id scoped id of the resource
|
|
97
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
97
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
98
98
|
* @param {cloudfront.IDistribution} distribution
|
|
99
99
|
* @param {route53.IHostedZone} hostedZone
|
|
100
100
|
* @param {string} recordName
|
|
@@ -109,13 +109,13 @@ class Route53Manager {
|
|
|
109
109
|
target: route53.RecordTarget.fromAlias(new route53Targets.CloudFrontTarget(distribution)),
|
|
110
110
|
zone: hostedZone,
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
utils.createCfnOutput(`${id}-aRecordDomainName`, scope, aRecord.domainName);
|
|
113
113
|
return aRecord;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* @summary Method to create a-record for cloudfront target
|
|
117
117
|
* @param {string} id scoped id of the resource
|
|
118
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
118
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
119
119
|
* @param {cloudfront.IDistribution} distribution
|
|
120
120
|
* @param {route53.IHostedZone} hostedZone
|
|
121
121
|
* @param {string} recordName
|
|
@@ -130,13 +130,13 @@ class Route53Manager {
|
|
|
130
130
|
target: route53.RecordTarget.fromAlias(new route53Targets.CloudFrontTarget(distribution)),
|
|
131
131
|
zone: hostedZone,
|
|
132
132
|
});
|
|
133
|
-
|
|
133
|
+
utils.createCfnOutput(`${id}-aRecordDomainName`, scope, aRecord.domainName);
|
|
134
134
|
return aRecord;
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* @summary Method to create a-record for api gateway target
|
|
138
138
|
* @param {string} id scoped id of the resource
|
|
139
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
139
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
140
140
|
* @param recordName
|
|
141
141
|
* @param apiDomain
|
|
142
142
|
* @param hostedZone
|
|
@@ -150,7 +150,7 @@ class Route53Manager {
|
|
|
150
150
|
target: route53.RecordTarget.fromAlias(new route53Targets.ApiGatewayDomain(apiDomain)),
|
|
151
151
|
zone: hostedZone,
|
|
152
152
|
});
|
|
153
|
-
|
|
153
|
+
utils.createCfnOutput(`${id}-a-record-domain-name`, scope, apiARecord.domainName);
|
|
154
154
|
return apiARecord;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route53Manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/route53Manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,iEAAkD;AAClD,gFAAiE;AAGjE,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,cAAc;IACzB;;;;;OAKG;IACI,gBAAgB,CAAC,EAAU,EAAE,KAA6B,EAAE,KAAyB;QAC1F,IAAI,UAA+B,CAAA;QAEnC,IAAI,CAAC,KAAK;YAAE,MAAM,yBAAyB,CAAA;QAE3C,IAAI,KAAK,CAAC,qBAAqB,EAAE;YAC/B,UAAU,GAAG,OAAO,CAAC,UAAU,CA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IAAI,EAAE,UAAU;SACjB,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;QAE3E,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;;;;;OAOG;IACI,uBAAuB,CAC5B,EAAU,EACV,KAA6B,EAC7B,UAAkB,EAClB,SAA0B,EAC1B,UAA+B;QAE/B,IAAI,aAAa,GAAG,EAAE,CAAA;QACtB,IAAI,UAAU,IAAI,UAAU,KAAK,EAAE;YACjC,aAAa,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAEpG,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACrD,UAAU,EAAE,aAAa;YACzB,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,cAAc,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACtF,IAAI,EAAE,UAAU;SACjB,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;QAEjF,OAAO,UAAU,CAAA;IACnB,CAAC;CACF;AAlJD,wCAkJC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib';
|
|
2
|
+
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
3
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
|
+
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
5
|
+
import * as common from '../../common';
|
|
6
|
+
import * as types from '../../types';
|
|
7
|
+
/**
|
|
8
|
+
* @stability stable
|
|
9
|
+
* @category Storage
|
|
10
|
+
* @summary Provides operations on AWS S3.
|
|
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
|
+
* @example
|
|
14
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
15
|
+
*
|
|
16
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
17
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
18
|
+
* super(parent, id, props)
|
|
19
|
+
* this.props = props
|
|
20
|
+
* this.s3Manager.createS3Bucket('MyBucket', this)
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
|
|
25
|
+
*/
|
|
26
|
+
export declare class S3Manager {
|
|
27
|
+
/**
|
|
28
|
+
* @summary Method to determine S3 Bucket lifecycle properties
|
|
29
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
protected determineBucketLifecycleRules(props: types.S3BucketProps): types.LifecycleRule[] | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* @summary Method to determine the bucket name
|
|
35
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
36
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
protected static determineBucketName(scope: common.CommonConstruct, props: types.S3BucketProps): string;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Method to determine the log bucket name
|
|
42
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
43
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
protected static determineLogBucketName(scope: common.CommonConstruct, props: types.S3BucketProps): string;
|
|
47
|
+
/**
|
|
48
|
+
* @summary Method to create a s3 bucket
|
|
49
|
+
* @param {string} id scoped id of the resource
|
|
50
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
51
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
52
|
+
*/
|
|
53
|
+
createS3Bucket(id: string, scope: common.CommonConstruct, props: types.S3BucketProps): cdk.aws_s3.IBucket;
|
|
54
|
+
/**
|
|
55
|
+
* @summary Method to create an iam bucket policy for cloudtrail
|
|
56
|
+
* @param {string} id scoped id of the resource
|
|
57
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
58
|
+
* @param {s3.IBucket} bucket
|
|
59
|
+
*/
|
|
60
|
+
createBucketPolicyForCloudTrail(id: string, scope: common.CommonConstruct, bucket: s3.IBucket): cdk.aws_s3.CfnBucketPolicy;
|
|
61
|
+
/**
|
|
62
|
+
* @summary Method to create a s3 bucket deployment
|
|
63
|
+
* @param {string} id scoped id of the resource
|
|
64
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
65
|
+
* @param {s3.IBucket} siteBucket
|
|
66
|
+
* @param {cloudfront.IDistribution} distribution
|
|
67
|
+
* @param {s3deploy.ISource[]} sources
|
|
68
|
+
* @param {string} prefix
|
|
69
|
+
* @param {boolean} prune
|
|
70
|
+
*/
|
|
71
|
+
doBucketDeployment(id: string, scope: common.CommonConstruct, siteBucket: s3.IBucket, distribution: cloudfront.IDistribution, sources: s3deploy.ISource[], prefix: string, prune?: boolean): void;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=s3Manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3Manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/s3Manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAA;AACzD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,SAAS,CAAC,6BAA6B,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAyBlE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAM9F;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAMjG;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAkD3F;;;;;OAKG;IACI,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO;IA0BpG;;;;;;;;;OASG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,UAAU,EAAE,EAAE,CAAC,OAAO,EACtB,YAAY,EAAE,UAAU,CAAC,aAAa,EACtC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,OAAO;CAalB"}
|
|
@@ -24,17 +24,17 @@ const cdk = __importStar(require("aws-cdk-lib"));
|
|
|
24
24
|
const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
25
25
|
const s3 = __importStar(require("aws-cdk-lib/aws-s3"));
|
|
26
26
|
const s3deploy = __importStar(require("aws-cdk-lib/aws-s3-deployment"));
|
|
27
|
-
const
|
|
27
|
+
const utils = __importStar(require("../../utils"));
|
|
28
28
|
/**
|
|
29
29
|
* @stability stable
|
|
30
30
|
* @category Storage
|
|
31
31
|
* @summary Provides operations on AWS S3.
|
|
32
|
-
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
33
|
-
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
32
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
33
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
34
34
|
* @example
|
|
35
35
|
* import * as common from '@gradientedge/cdk-utils'
|
|
36
36
|
*
|
|
37
|
-
* class CustomConstruct extends common.CommonConstruct {
|
|
37
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
38
38
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
39
39
|
* super(parent, id, props)
|
|
40
40
|
* this.props = props
|
|
@@ -47,7 +47,7 @@ const utils_1 = require("../utils");
|
|
|
47
47
|
class S3Manager {
|
|
48
48
|
/**
|
|
49
49
|
* @summary Method to determine S3 Bucket lifecycle properties
|
|
50
|
-
* @param {S3BucketProps} props bucket properties
|
|
50
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
51
51
|
* @private
|
|
52
52
|
*/
|
|
53
53
|
determineBucketLifecycleRules(props) {
|
|
@@ -75,8 +75,8 @@ class S3Manager {
|
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* @summary Method to determine the bucket name
|
|
78
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
79
|
-
* @param {S3BucketProps} props bucket properties
|
|
78
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
79
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
80
80
|
* @private
|
|
81
81
|
*/
|
|
82
82
|
static determineBucketName(scope, props) {
|
|
@@ -86,8 +86,8 @@ class S3Manager {
|
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* @summary Method to determine the log bucket name
|
|
89
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
90
|
-
* @param {S3BucketProps} props bucket properties
|
|
89
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
90
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
91
91
|
* @private
|
|
92
92
|
*/
|
|
93
93
|
static determineLogBucketName(scope, props) {
|
|
@@ -98,8 +98,8 @@ class S3Manager {
|
|
|
98
98
|
/**
|
|
99
99
|
* @summary Method to create a s3 bucket
|
|
100
100
|
* @param {string} id scoped id of the resource
|
|
101
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
102
|
-
* @param {S3BucketProps} props bucket properties
|
|
101
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
102
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
103
103
|
*/
|
|
104
104
|
createS3Bucket(id, scope, props) {
|
|
105
105
|
if (!props)
|
|
@@ -141,14 +141,14 @@ class S3Manager {
|
|
|
141
141
|
},
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
utils.createCfnOutput(`${id}-bucketName`, scope, bucket.bucketName);
|
|
145
|
+
utils.createCfnOutput(`${id}-bucketArn`, scope, bucket.bucketArn);
|
|
146
146
|
return bucket;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* @summary Method to create an iam bucket policy for cloudtrail
|
|
150
150
|
* @param {string} id scoped id of the resource
|
|
151
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
151
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
152
152
|
* @param {s3.IBucket} bucket
|
|
153
153
|
*/
|
|
154
154
|
createBucketPolicyForCloudTrail(id, scope, bucket) {
|
|
@@ -178,7 +178,7 @@ class S3Manager {
|
|
|
178
178
|
/**
|
|
179
179
|
* @summary Method to create a s3 bucket deployment
|
|
180
180
|
* @param {string} id scoped id of the resource
|
|
181
|
-
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
181
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
182
182
|
* @param {s3.IBucket} siteBucket
|
|
183
183
|
* @param {cloudfront.IDistribution} distribution
|
|
184
184
|
* @param {s3deploy.ISource[]} sources
|