@gradientedge/cdk-utils 8.91.0 → 8.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +40 -0
- package/app/api-destined-function/src/lib/lambda.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
- package/dist/lib/lambda.d.ts +6 -6
- package/dist/lib/lambda.js +6 -6
- package/dist/lib/lambda.js.map +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -7
- package/dist/src/lib/common/construct.js +4 -7
- package/dist/src/lib/common/stack.d.ts +9 -13
- package/dist/src/lib/common/stack.js +9 -13
- package/dist/src/lib/common/types.d.ts +0 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
- package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
- package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
- package/dist/src/lib/construct/static-site/main.d.ts +0 -17
- package/dist/src/lib/construct/static-site/main.js +1 -18
- package/dist/src/lib/construct/static-site/types.d.ts +9 -11
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
- package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
- package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
- package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
- package/dist/src/lib/services/aws/appconfig/main.js +19 -22
- package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
- package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
- package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
- package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
- package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
- package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
- package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
- package/dist/src/lib/services/aws/codebuild/main.js +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
- package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
- package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
- package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
- package/dist/src/lib/services/aws/elasticache/main.js +35 -39
- package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
- package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
- package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
- package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
- package/dist/src/lib/services/aws/evidently/main.js +19 -23
- package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
- package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
- package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
- package/dist/src/lib/services/aws/lambda/main.js +64 -69
- package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
- package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
- package/dist/src/lib/services/aws/route53/main.js +19 -23
- package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
- package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
- package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
- package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
- package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
- package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
- package/dist/src/lib/services/aws/step-function/main.js +91 -95
- package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
- package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
- package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
- package/dist/src/lib/types/aws/index.d.ts +0 -2
- package/dist/src/lib/utils/aws/index.d.ts +6 -9
- package/dist/src/lib/utils/aws/index.js +7 -10
- package/dist/src/lib/utils/index.d.ts +6 -13
- package/dist/src/lib/utils/index.js +4 -12
- package/package.json +1 -1
- package/src/lib/common/construct.ts +4 -7
- package/src/lib/common/stack.ts +9 -13
- package/src/lib/common/types.ts +0 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
- package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
- package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
- package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
- package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
- package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
- package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
- package/src/lib/construct/rest-api-lambda/main.ts +1 -19
- package/src/lib/construct/rest-api-lambda/types.ts +6 -10
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
- package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
- package/src/lib/construct/static-asset-deployment/main.ts +0 -8
- package/src/lib/construct/static-asset-deployment/types.ts +1 -1
- package/src/lib/construct/static-site/main.ts +1 -18
- package/src/lib/construct/static-site/types.ts +9 -11
- package/src/lib/services/aws/api-gateway/main.ts +43 -47
- package/src/lib/services/aws/api-gateway/types.ts +0 -2
- package/src/lib/services/aws/appconfig/constants.ts +26 -32
- package/src/lib/services/aws/appconfig/main.ts +19 -22
- package/src/lib/services/aws/appconfig/types.ts +1 -3
- package/src/lib/services/aws/certificate-manager/main.ts +5 -10
- package/src/lib/services/aws/certificate-manager/types.ts +3 -5
- package/src/lib/services/aws/cloudfront/main.ts +56 -62
- package/src/lib/services/aws/cloudfront/types.ts +1 -7
- package/src/lib/services/aws/cloudtrail/main.ts +8 -12
- package/src/lib/services/aws/cloudtrail/types.ts +0 -2
- package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
- package/src/lib/services/aws/cloudwatch/main.ts +116 -122
- package/src/lib/services/aws/cloudwatch/types.ts +20 -42
- package/src/lib/services/aws/codebuild/main.ts +3 -7
- package/src/lib/services/aws/dynamodb/main.ts +13 -17
- package/src/lib/services/aws/dynamodb/types.ts +0 -2
- package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
- package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
- package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
- package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
- package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
- package/src/lib/services/aws/elasticache/main.ts +35 -39
- package/src/lib/services/aws/elasticache/types.ts +0 -4
- package/src/lib/services/aws/eventbridge/main.ts +34 -38
- package/src/lib/services/aws/eventbridge/target.ts +8 -11
- package/src/lib/services/aws/eventbridge/types.ts +2 -10
- package/src/lib/services/aws/evidently/main.ts +19 -23
- package/src/lib/services/aws/evidently/types.ts +0 -10
- package/src/lib/services/aws/identity-access-management/main.ts +97 -101
- package/src/lib/services/aws/key-management-service/main.ts +6 -10
- package/src/lib/services/aws/key-management-service/types.ts +0 -2
- package/src/lib/services/aws/lambda/main.ts +64 -69
- package/src/lib/services/aws/lambda/types.ts +6 -16
- package/src/lib/services/aws/route53/main.ts +19 -23
- package/src/lib/services/aws/route53/types.ts +0 -2
- package/src/lib/services/aws/secrets-manager/main.ts +6 -28
- package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
- package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
- package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
- package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
- package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
- package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
- package/src/lib/services/aws/step-function/main.ts +91 -95
- package/src/lib/services/aws/step-function/types.ts +0 -32
- package/src/lib/services/aws/systems-manager/main.ts +13 -19
- package/src/lib/services/aws/systems-manager/types.ts +0 -2
- package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
- package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
- package/src/lib/types/aws/index.ts +0 -2
- package/src/lib/utils/aws/index.ts +7 -10
- package/src/lib/utils/index.ts +4 -12
|
@@ -4,9 +4,6 @@ import * as eks from 'aws-cdk-lib/aws-eks';
|
|
|
4
4
|
import { CommonConstruct } from '../../../common';
|
|
5
5
|
import { EksClusterProps } from './types';
|
|
6
6
|
/**
|
|
7
|
-
* @stability stable
|
|
8
|
-
* @category cdk-utils.eks-manager
|
|
9
|
-
* @subcategory Construct
|
|
10
7
|
* @classdesc Provides operations on AWS Elastic Kubernetes Service.
|
|
11
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
12
9
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -20,17 +17,16 @@ import { EksClusterProps } from './types';
|
|
|
20
17
|
* this.eksManager.createEksDeployment('MyEksDeployment', this, image, vpc)
|
|
21
18
|
* }
|
|
22
19
|
* }
|
|
23
|
-
*
|
|
24
20
|
* @see [CDK EKS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html}
|
|
25
21
|
*/
|
|
26
22
|
export declare class EksManager {
|
|
27
23
|
/**
|
|
28
24
|
* @summary Method to create an eks deployment
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
25
|
+
* @param id scoped id of the resource
|
|
26
|
+
* @param scope scope in which this resource is defined
|
|
27
|
+
* @param props
|
|
28
|
+
* @param image
|
|
29
|
+
* @param vpc
|
|
34
30
|
*/
|
|
35
31
|
createEksDeployment(id: string, scope: CommonConstruct, props: EksClusterProps, image: ecr.DockerImageAsset, vpc: ec2.IVpc): eks.Cluster;
|
|
36
32
|
}
|
|
@@ -28,9 +28,6 @@ const ec2 = __importStar(require("aws-cdk-lib/aws-ec2"));
|
|
|
28
28
|
const eks = __importStar(require("aws-cdk-lib/aws-eks"));
|
|
29
29
|
const utils = __importStar(require("../../../utils"));
|
|
30
30
|
/**
|
|
31
|
-
* @stability stable
|
|
32
|
-
* @category cdk-utils.eks-manager
|
|
33
|
-
* @subcategory Construct
|
|
34
31
|
* @classdesc Provides operations on AWS Elastic Kubernetes Service.
|
|
35
32
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
36
33
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -44,17 +41,16 @@ const utils = __importStar(require("../../../utils"));
|
|
|
44
41
|
* this.eksManager.createEksDeployment('MyEksDeployment', this, image, vpc)
|
|
45
42
|
* }
|
|
46
43
|
* }
|
|
47
|
-
*
|
|
48
44
|
* @see [CDK EKS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html}
|
|
49
45
|
*/
|
|
50
46
|
class EksManager {
|
|
51
47
|
/**
|
|
52
48
|
* @summary Method to create an eks deployment
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which this resource is defined
|
|
51
|
+
* @param props
|
|
52
|
+
* @param image
|
|
53
|
+
* @param vpc
|
|
58
54
|
*/
|
|
59
55
|
createEksDeployment(id, scope, props, image, vpc) {
|
|
60
56
|
if (!props)
|
|
@@ -71,8 +67,8 @@ class EksManager {
|
|
|
71
67
|
spec: {
|
|
72
68
|
containers: [
|
|
73
69
|
{
|
|
74
|
-
name: `${id}`.toLowerCase(),
|
|
75
70
|
image: image.imageUri,
|
|
71
|
+
name: `${id}`.toLowerCase(),
|
|
76
72
|
ports: [{ containerPort: props.appContainerPort }],
|
|
77
73
|
},
|
|
78
74
|
],
|
|
@@ -85,16 +81,16 @@ class EksManager {
|
|
|
85
81
|
kind: 'Service',
|
|
86
82
|
metadata: { name: `${id}`.toLowerCase() },
|
|
87
83
|
spec: {
|
|
88
|
-
type: 'LoadBalancer',
|
|
89
84
|
ports: [
|
|
90
85
|
{
|
|
91
86
|
name: 'http-port',
|
|
92
|
-
protocol: 'TCP',
|
|
93
87
|
port: 80,
|
|
88
|
+
protocol: 'TCP',
|
|
94
89
|
targetPort: props.appContainerPort,
|
|
95
90
|
},
|
|
96
91
|
],
|
|
97
92
|
selector: appLabel,
|
|
93
|
+
type: 'LoadBalancer',
|
|
98
94
|
},
|
|
99
95
|
};
|
|
100
96
|
const cluster = new eks.Cluster(scope, `${id}Cluster`, {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ClusterProps } from 'aws-cdk-lib/aws-eks';
|
|
2
2
|
/**
|
|
3
|
-
* @category cdk-utils.eks-manager
|
|
4
|
-
* @subcategory Properties
|
|
5
3
|
*/
|
|
6
4
|
export interface EksClusterProps extends ClusterProps {
|
|
7
|
-
appContainerPort: number;
|
|
8
5
|
appCapacity: number;
|
|
6
|
+
appContainerPort: number;
|
|
9
7
|
}
|
|
@@ -2,9 +2,6 @@ import * as elasticache from 'aws-cdk-lib/aws-elasticache';
|
|
|
2
2
|
import { CommonConstruct } from '../../../common';
|
|
3
3
|
import { ElastiCacheProps, ReplicatedElastiCacheProps } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* @stability stable
|
|
6
|
-
* @category cdk-utils.elasticache-manager
|
|
7
|
-
* @subcategory Construct
|
|
8
5
|
* @summary Provides operations on AWS ElastiCache Service.
|
|
9
6
|
* - A new instance of scope class is injected into {@link CommonConstruct} constructor.
|
|
10
7
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -18,34 +15,33 @@ import { ElastiCacheProps, ReplicatedElastiCacheProps } from './types';
|
|
|
18
15
|
* this.elasticacheManager.createElastiCache('MyElastiCache', scope, props)
|
|
19
16
|
* }
|
|
20
17
|
* }
|
|
21
|
-
*
|
|
22
18
|
* @see [CDK ElastiCache Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache-readme.html}
|
|
23
19
|
*/
|
|
24
20
|
export declare class ElastiCacheManager {
|
|
25
21
|
/**
|
|
26
22
|
* @summary Method to create an elasticache resource
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
23
|
+
* @param id scoped id of the resource
|
|
24
|
+
* @param scope scope in which scope resource is defined
|
|
25
|
+
* @param subnetIds
|
|
30
26
|
*/
|
|
31
27
|
createElastiCacheSubnetGroup(id: string, scope: CommonConstruct, subnetIds: string[]): elasticache.CfnSubnetGroup;
|
|
32
28
|
/**
|
|
33
29
|
* @summary Method to create an elasticache resource
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
30
|
+
* @param id scoped id of the resource
|
|
31
|
+
* @param scope scope in which scope resource is defined
|
|
32
|
+
* @param props
|
|
33
|
+
* @param subnetIds
|
|
34
|
+
* @param securityGroupIds
|
|
35
|
+
* @param logDeliveryConfigurations
|
|
40
36
|
*/
|
|
41
37
|
createElastiCache(id: string, scope: CommonConstruct, props: ElastiCacheProps, subnetIds: string[], securityGroupIds: string[], logDeliveryConfigurations?: any): elasticache.CfnCacheCluster;
|
|
42
38
|
/**
|
|
43
39
|
* @summary Method to create an replicated elasticache resource
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
40
|
+
* @param id scoped id of the resource
|
|
41
|
+
* @param scope scope in which scope resource is defined
|
|
42
|
+
* @param props
|
|
43
|
+
* @param subnetIds
|
|
44
|
+
* @param securityGroupIds
|
|
49
45
|
*/
|
|
50
46
|
createReplicatedElastiCache(id: string, scope: CommonConstruct, props: ReplicatedElastiCacheProps, subnetIds: string[], securityGroupIds: string[]): elasticache.CfnReplicationGroup;
|
|
51
47
|
}
|
|
@@ -28,9 +28,6 @@ const elasticache = __importStar(require("aws-cdk-lib/aws-elasticache"));
|
|
|
28
28
|
const utils = __importStar(require("../../../utils"));
|
|
29
29
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
30
30
|
/**
|
|
31
|
-
* @stability stable
|
|
32
|
-
* @category cdk-utils.elasticache-manager
|
|
33
|
-
* @subcategory Construct
|
|
34
31
|
* @summary Provides operations on AWS ElastiCache Service.
|
|
35
32
|
* - A new instance of scope class is injected into {@link CommonConstruct} constructor.
|
|
36
33
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -44,56 +41,55 @@ const cdk = __importStar(require("aws-cdk-lib"));
|
|
|
44
41
|
* this.elasticacheManager.createElastiCache('MyElastiCache', scope, props)
|
|
45
42
|
* }
|
|
46
43
|
* }
|
|
47
|
-
*
|
|
48
44
|
* @see [CDK ElastiCache Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticache-readme.html}
|
|
49
45
|
*/
|
|
50
46
|
class ElastiCacheManager {
|
|
51
47
|
/**
|
|
52
48
|
* @summary Method to create an elasticache resource
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which scope resource is defined
|
|
51
|
+
* @param subnetIds
|
|
56
52
|
*/
|
|
57
53
|
createElastiCacheSubnetGroup(id, scope, subnetIds) {
|
|
58
54
|
return new elasticache.CfnSubnetGroup(scope, `${id}`, {
|
|
59
55
|
cacheSubnetGroupName: `${id}-subnet-group-${scope.props.stage}`,
|
|
60
|
-
subnetIds: subnetIds,
|
|
61
56
|
description: `${id}-subnet-group-${scope.props.stage}`,
|
|
57
|
+
subnetIds: subnetIds,
|
|
62
58
|
});
|
|
63
59
|
}
|
|
64
60
|
/**
|
|
65
61
|
* @summary Method to create an elasticache resource
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
62
|
+
* @param id scoped id of the resource
|
|
63
|
+
* @param scope scope in which scope resource is defined
|
|
64
|
+
* @param props
|
|
65
|
+
* @param subnetIds
|
|
66
|
+
* @param securityGroupIds
|
|
67
|
+
* @param logDeliveryConfigurations
|
|
72
68
|
*/
|
|
73
69
|
createElastiCache(id, scope, props, subnetIds, securityGroupIds, logDeliveryConfigurations) {
|
|
74
70
|
if (!props)
|
|
75
71
|
throw `ElastiCache props undefined for ${id}`;
|
|
76
72
|
const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
|
|
77
73
|
const elasticacheCluster = new elasticache.CfnCacheCluster(scope, `${id}`, {
|
|
74
|
+
autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
|
|
75
|
+
azMode: props.azMode,
|
|
76
|
+
cacheNodeType: props.cacheNodeType,
|
|
77
|
+
cacheParameterGroupName: props.cacheParameterGroupName,
|
|
78
|
+
cacheSecurityGroupNames: props.cacheSecurityGroupNames,
|
|
79
|
+
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
80
|
+
clusterName: `${id}-${scope.props.stage}`,
|
|
78
81
|
engine: props.engine,
|
|
79
82
|
engineVersion: props.engineVersion,
|
|
80
|
-
|
|
83
|
+
logDeliveryConfigurations: logDeliveryConfigurations,
|
|
81
84
|
numCacheNodes: props.numCacheNodes,
|
|
82
|
-
|
|
83
|
-
vpcSecurityGroupIds: securityGroupIds,
|
|
84
|
-
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
85
|
-
azMode: props.azMode,
|
|
85
|
+
port: props.port,
|
|
86
86
|
preferredAvailabilityZones: props.preferredAvailabilityZones,
|
|
87
87
|
preferredMaintenanceWindow: props.preferredMaintenanceWindow,
|
|
88
|
-
autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
|
|
89
|
-
cacheParameterGroupName: props.cacheParameterGroupName,
|
|
90
|
-
cacheSecurityGroupNames: props.cacheSecurityGroupNames,
|
|
91
|
-
port: props.port,
|
|
92
88
|
snapshotArns: props.snapshotArns,
|
|
93
89
|
snapshotName: props.snapshotName,
|
|
94
90
|
snapshotRetentionLimit: props.snapshotRetentionLimit,
|
|
95
91
|
snapshotWindow: props.snapshotWindow,
|
|
96
|
-
|
|
92
|
+
vpcSecurityGroupIds: securityGroupIds,
|
|
97
93
|
});
|
|
98
94
|
elasticacheCluster.addDependency(subnetGroup);
|
|
99
95
|
if (props.tags && props.tags.length > 0) {
|
|
@@ -108,38 +104,38 @@ class ElastiCacheManager {
|
|
|
108
104
|
}
|
|
109
105
|
/**
|
|
110
106
|
* @summary Method to create an replicated elasticache resource
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
107
|
+
* @param id scoped id of the resource
|
|
108
|
+
* @param scope scope in which scope resource is defined
|
|
109
|
+
* @param props
|
|
110
|
+
* @param subnetIds
|
|
111
|
+
* @param securityGroupIds
|
|
116
112
|
*/
|
|
117
113
|
createReplicatedElastiCache(id, scope, props, subnetIds, securityGroupIds) {
|
|
118
114
|
if (!props)
|
|
119
115
|
throw `ElastiCache props undefined for ${id}`;
|
|
120
116
|
const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
|
|
121
117
|
const elasticacheCluster = new elasticache.CfnReplicationGroup(scope, `${id}`, {
|
|
122
|
-
|
|
123
|
-
replicationGroupId: `${id}-${scope.props.stage}`,
|
|
124
|
-
cacheNodeType: props.cacheNodeType,
|
|
125
|
-
engine: props.engine,
|
|
126
|
-
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
127
|
-
securityGroupIds: securityGroupIds,
|
|
128
|
-
numNodeGroups: props.numNodeGroups,
|
|
129
|
-
replicasPerNodeGroup: props.replicasPerNodeGroup,
|
|
118
|
+
autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
|
|
130
119
|
automaticFailoverEnabled: props.automaticFailoverEnabled,
|
|
131
|
-
|
|
120
|
+
cacheNodeType: props.cacheNodeType,
|
|
132
121
|
cacheParameterGroupName: props.cacheParameterGroupName,
|
|
133
122
|
cacheSecurityGroupNames: props.cacheSecurityGroupNames,
|
|
123
|
+
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
124
|
+
engine: props.engine,
|
|
134
125
|
engineVersion: props.engineVersion,
|
|
135
126
|
globalReplicationGroupId: props.globalReplicationGroupId,
|
|
136
127
|
logDeliveryConfigurations: props.logDeliveryConfigurations,
|
|
128
|
+
multiAzEnabled: props.multiAzEnabled,
|
|
137
129
|
numCacheClusters: props.numCacheClusters,
|
|
130
|
+
numNodeGroups: props.numNodeGroups,
|
|
138
131
|
port: props.port,
|
|
139
132
|
preferredCacheClusterAZs: props.preferredCacheClusterAZs,
|
|
140
133
|
preferredMaintenanceWindow: props.preferredMaintenanceWindow,
|
|
141
134
|
primaryClusterId: props.primaryClusterId,
|
|
142
|
-
|
|
135
|
+
replicasPerNodeGroup: props.replicasPerNodeGroup,
|
|
136
|
+
replicationGroupDescription: `${id} Redis Replication Cluster`,
|
|
137
|
+
replicationGroupId: `${id}-${scope.props.stage}`,
|
|
138
|
+
securityGroupIds: securityGroupIds,
|
|
143
139
|
});
|
|
144
140
|
elasticacheCluster.addDependency(subnetGroup);
|
|
145
141
|
return elasticacheCluster;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { CfnCacheClusterProps, CfnReplicationGroupProps } from 'aws-cdk-lib/aws-elasticache';
|
|
2
2
|
/**
|
|
3
|
-
* @category cdk-utils.elasticache-manager
|
|
4
|
-
* @category Compute
|
|
5
3
|
*/
|
|
6
4
|
export interface ElastiCacheProps extends CfnCacheClusterProps {
|
|
7
5
|
}
|
|
8
6
|
/**
|
|
9
|
-
* @category cdk-utils.elasticache-manager
|
|
10
|
-
* @category Compute
|
|
11
7
|
*/
|
|
12
8
|
export interface ReplicatedElastiCacheProps extends CfnReplicationGroupProps {
|
|
13
9
|
}
|
|
@@ -8,9 +8,6 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
|
8
8
|
import { CommonConstruct } from '../../../common';
|
|
9
9
|
import { EventBusProps, EventRuleProps, RuleProps, SqsToSfnPipeProps } from './types';
|
|
10
10
|
/**
|
|
11
|
-
* @stability stable
|
|
12
|
-
* @category cdk-utils.event-manager
|
|
13
|
-
* @subcategory Construct
|
|
14
11
|
* @classdesc Provides operations on AWS EventBridge.
|
|
15
12
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
16
13
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -24,53 +21,52 @@ import { EventBusProps, EventRuleProps, RuleProps, SqsToSfnPipeProps } from './t
|
|
|
24
21
|
* this.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
|
|
25
22
|
* }
|
|
26
23
|
* }
|
|
27
|
-
*
|
|
28
24
|
* @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
|
|
29
25
|
*/
|
|
30
26
|
export declare class EventManager {
|
|
31
27
|
/**
|
|
32
28
|
* Method to create an event bus
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
29
|
+
* @param id scoped id of the resource
|
|
30
|
+
* @param scope scope in which this resource is defined
|
|
31
|
+
* @param props event bus properties
|
|
36
32
|
*/
|
|
37
33
|
createEventBus(id: string, scope: CommonConstruct, props: EventBusProps): events.EventBus;
|
|
38
34
|
/**
|
|
39
35
|
* Method to create an event rule
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
36
|
+
* @param id scoped id of the resource
|
|
37
|
+
* @param scope scope in which this resource is defined
|
|
38
|
+
* @param props event rule properties
|
|
39
|
+
* @param eventBus optional custom event bus
|
|
40
|
+
* @param targets optional event targets
|
|
45
41
|
*/
|
|
46
42
|
createRule(id: string, scope: CommonConstruct, props: EventRuleProps, eventBus?: events.IEventBus, targets?: events.IRuleTarget[]): events.Rule;
|
|
47
43
|
/**
|
|
48
44
|
* @summary Method to create an eventbridge rule with lambda target
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
45
|
+
* @param id scoped id of the resource
|
|
46
|
+
* @param scope scope in which this resource is defined
|
|
47
|
+
* @param props
|
|
48
|
+
* @param lambdaFunction
|
|
49
|
+
* @param eventBusName
|
|
50
|
+
* @param eventPattern
|
|
51
|
+
* @param scheduleExpression
|
|
56
52
|
*/
|
|
57
53
|
createLambdaRule(id: string, scope: CommonConstruct, props: RuleProps, lambdaFunction: lambda.Function, eventBusName?: string, eventPattern?: any, scheduleExpression?: string): events.CfnRule;
|
|
58
54
|
/**
|
|
59
55
|
* @summary Method to create an eventbridge rule with fargate task target
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
56
|
+
* @param id scoped id of the resource
|
|
57
|
+
* @param scope scope in which this resource is defined
|
|
58
|
+
* @param props
|
|
59
|
+
* @param cluster
|
|
60
|
+
* @param task
|
|
61
|
+
* @param subnetIds
|
|
62
|
+
* @param role
|
|
63
|
+
* @param eventPattern
|
|
68
64
|
*/
|
|
69
65
|
createFargateTaskRule(id: string, scope: CommonConstruct, props: RuleProps, cluster: ecs.ICluster, task: ecs.ITaskDefinition, subnetIds: string[], role: iam.Role | iam.CfnRole, eventPattern?: any): events.CfnRule;
|
|
70
66
|
/**
|
|
71
67
|
* @summary Method to create an eventbridge pipe with sqs queue as source and step function as target
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
68
|
+
* @param id scoped id of the resource
|
|
69
|
+
* @param scope scope in which this resource is defined
|
|
74
70
|
* @param props the props for the pipe
|
|
75
71
|
* @param sourceQueue the source sqs queue
|
|
76
72
|
* @param targetStepFunction the target step function
|
|
@@ -31,9 +31,6 @@ const utils = __importStar(require("../../../utils"));
|
|
|
31
31
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
32
32
|
const pipes = __importStar(require("aws-cdk-lib/aws-pipes"));
|
|
33
33
|
/**
|
|
34
|
-
* @stability stable
|
|
35
|
-
* @category cdk-utils.event-manager
|
|
36
|
-
* @subcategory Construct
|
|
37
34
|
* @classdesc Provides operations on AWS EventBridge.
|
|
38
35
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
39
36
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -47,15 +44,14 @@ const pipes = __importStar(require("aws-cdk-lib/aws-pipes"));
|
|
|
47
44
|
* this.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
|
|
48
45
|
* }
|
|
49
46
|
* }
|
|
50
|
-
*
|
|
51
47
|
* @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
|
|
52
48
|
*/
|
|
53
49
|
class EventManager {
|
|
54
50
|
/**
|
|
55
51
|
* Method to create an event bus
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
52
|
+
* @param id scoped id of the resource
|
|
53
|
+
* @param scope scope in which this resource is defined
|
|
54
|
+
* @param props event bus properties
|
|
59
55
|
*/
|
|
60
56
|
createEventBus(id, scope, props) {
|
|
61
57
|
if (!props)
|
|
@@ -69,21 +65,21 @@ class EventManager {
|
|
|
69
65
|
}
|
|
70
66
|
/**
|
|
71
67
|
* Method to create an event rule
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
68
|
+
* @param id scoped id of the resource
|
|
69
|
+
* @param scope scope in which this resource is defined
|
|
70
|
+
* @param props event rule properties
|
|
71
|
+
* @param eventBus optional custom event bus
|
|
72
|
+
* @param targets optional event targets
|
|
77
73
|
*/
|
|
78
74
|
createRule(id, scope, props, eventBus, targets) {
|
|
79
75
|
if (!props)
|
|
80
76
|
throw `EventRule props undefined for ${id}`;
|
|
81
77
|
const rule = new events.Rule(scope, `${id}`, {
|
|
82
|
-
eventBus: eventBus,
|
|
83
78
|
description: props.description,
|
|
84
|
-
ruleName: `${props.ruleName}-${scope.props.stage}`,
|
|
85
|
-
eventPattern: props.eventPattern,
|
|
86
79
|
enabled: props.enabled,
|
|
80
|
+
eventBus: eventBus,
|
|
81
|
+
eventPattern: props.eventPattern,
|
|
82
|
+
ruleName: `${props.ruleName}-${scope.props.stage}`,
|
|
87
83
|
schedule: props.schedule,
|
|
88
84
|
});
|
|
89
85
|
if (targets && targets.length > 0) {
|
|
@@ -102,13 +98,13 @@ class EventManager {
|
|
|
102
98
|
}
|
|
103
99
|
/**
|
|
104
100
|
* @summary Method to create an eventbridge rule with lambda target
|
|
105
|
-
* @param
|
|
106
|
-
* @param
|
|
107
|
-
* @param
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
101
|
+
* @param id scoped id of the resource
|
|
102
|
+
* @param scope scope in which this resource is defined
|
|
103
|
+
* @param props
|
|
104
|
+
* @param lambdaFunction
|
|
105
|
+
* @param eventBusName
|
|
106
|
+
* @param eventPattern
|
|
107
|
+
* @param scheduleExpression
|
|
112
108
|
*/
|
|
113
109
|
createLambdaRule(id, scope, props, lambdaFunction, eventBusName, eventPattern, scheduleExpression) {
|
|
114
110
|
if (!props)
|
|
@@ -117,8 +113,8 @@ class EventManager {
|
|
|
117
113
|
description: 'Rule to send notification to lambda function target',
|
|
118
114
|
eventBusName: eventBusName,
|
|
119
115
|
eventPattern: eventPattern,
|
|
120
|
-
scheduleExpression: scheduleExpression,
|
|
121
116
|
name: `${props.name}-${scope.props.stage}`,
|
|
117
|
+
scheduleExpression: scheduleExpression,
|
|
122
118
|
state: props.state,
|
|
123
119
|
targets: [
|
|
124
120
|
{
|
|
@@ -140,14 +136,14 @@ class EventManager {
|
|
|
140
136
|
}
|
|
141
137
|
/**
|
|
142
138
|
* @summary Method to create an eventbridge rule with fargate task target
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
145
|
-
* @param
|
|
146
|
-
* @param
|
|
147
|
-
* @param
|
|
148
|
-
* @param
|
|
149
|
-
* @param
|
|
150
|
-
* @param
|
|
139
|
+
* @param id scoped id of the resource
|
|
140
|
+
* @param scope scope in which this resource is defined
|
|
141
|
+
* @param props
|
|
142
|
+
* @param cluster
|
|
143
|
+
* @param task
|
|
144
|
+
* @param subnetIds
|
|
145
|
+
* @param role
|
|
146
|
+
* @param eventPattern
|
|
151
147
|
*/
|
|
152
148
|
createFargateTaskRule(id, scope, props, cluster, task, subnetIds, role, eventPattern) {
|
|
153
149
|
if (!props)
|
|
@@ -160,7 +156,6 @@ class EventManager {
|
|
|
160
156
|
targets: [
|
|
161
157
|
{
|
|
162
158
|
arn: cluster.clusterArn,
|
|
163
|
-
id: `${id}-${scope.props.stage}`,
|
|
164
159
|
ecsParameters: {
|
|
165
160
|
launchType: 'FARGATE',
|
|
166
161
|
networkConfiguration: {
|
|
@@ -169,6 +164,7 @@ class EventManager {
|
|
|
169
164
|
taskCount: 1,
|
|
170
165
|
taskDefinitionArn: task.taskDefinitionArn,
|
|
171
166
|
},
|
|
167
|
+
id: `${id}-${scope.props.stage}`,
|
|
172
168
|
roleArn: role instanceof iam.Role ? role.roleArn : role.attrArn,
|
|
173
169
|
},
|
|
174
170
|
],
|
|
@@ -179,8 +175,8 @@ class EventManager {
|
|
|
179
175
|
}
|
|
180
176
|
/**
|
|
181
177
|
* @summary Method to create an eventbridge pipe with sqs queue as source and step function as target
|
|
182
|
-
* @param
|
|
183
|
-
* @param
|
|
178
|
+
* @param id scoped id of the resource
|
|
179
|
+
* @param scope scope in which this resource is defined
|
|
184
180
|
* @param props the props for the pipe
|
|
185
181
|
* @param sourceQueue the source sqs queue
|
|
186
182
|
* @param targetStepFunction the target step function
|
|
@@ -189,8 +185,11 @@ class EventManager {
|
|
|
189
185
|
const pipeRole = scope.iamManager.createRoleForSqsToSfnPipe(`${id}-role`, scope, sourceQueue.queueArn, targetStepFunction.stateMachineArn);
|
|
190
186
|
const pipe = new pipes.CfnPipe(scope, `${id}`, {
|
|
191
187
|
...props,
|
|
192
|
-
name: `${props.name}-${scope.props.stage}`,
|
|
193
188
|
description: props.description,
|
|
189
|
+
enrichment: props.enrichment,
|
|
190
|
+
enrichmentParameters: props.enrichmentParameters,
|
|
191
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
192
|
+
roleArn: pipeRole.roleArn,
|
|
194
193
|
source: sourceQueue.queueArn,
|
|
195
194
|
sourceParameters: {
|
|
196
195
|
filterCriteria: props.pipeFilterPattern
|
|
@@ -214,9 +213,6 @@ class EventManager {
|
|
|
214
213
|
invocationType: props.sfnInvocationType ?? 'FIRE_AND_FORGET',
|
|
215
214
|
},
|
|
216
215
|
},
|
|
217
|
-
enrichment: props.enrichment,
|
|
218
|
-
enrichmentParameters: props.enrichmentParameters,
|
|
219
|
-
roleArn: pipeRole.roleArn,
|
|
220
216
|
});
|
|
221
217
|
utils.createCfnOutput(`${id}-pipeArn`, scope, pipe.attrArn);
|
|
222
218
|
utils.createCfnOutput(`${id}-pipeName`, scope, pipe.name);
|
|
@@ -3,9 +3,6 @@ import * as targets from 'aws-cdk-lib/aws-events-targets';
|
|
|
3
3
|
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
4
4
|
import { CommonConstruct } from '../../../common';
|
|
5
5
|
/**
|
|
6
|
-
* @stability stable
|
|
7
|
-
* @category cdk-utils.event-taeget-manager
|
|
8
|
-
* @subcategory Construct
|
|
9
6
|
* @classdesc Provides operations on AWS EventBridge Targets.
|
|
10
7
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
11
8
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -19,17 +16,16 @@ import { CommonConstruct } from '../../../common';
|
|
|
19
16
|
* this.eventTargetManager.createCloudWatchLogGroupNoPolicy('MyLogGrouptarget', this, myLogGroup)
|
|
20
17
|
* }
|
|
21
18
|
* }
|
|
22
|
-
*
|
|
23
19
|
* @see [CDK EventBridge Target Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets-readme.html}
|
|
24
20
|
*/
|
|
25
21
|
export declare class EventTargetManager {
|
|
26
22
|
/**
|
|
27
23
|
* @summary Method to create a cloud watch log group target without a policy.
|
|
28
24
|
* - This method is created as a workaround for cdk issue - https://github.com/aws/aws-cdk/issues/17002
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
25
|
+
* @param id scoped id of the resource
|
|
26
|
+
* @param scope scope in which this resource is defined
|
|
27
|
+
* @param logGroup the log group
|
|
28
|
+
* @param props the log group target properties
|
|
33
29
|
*/
|
|
34
30
|
createCloudWatchLogGroupNoPolicy(id: string, scope: CommonConstruct, logGroup: logs.ILogGroup, props?: LogGroupNoPolicyProps): CloudWatchLogGroupNoPolicy;
|
|
35
31
|
}
|
|
@@ -41,7 +37,6 @@ export interface LogGroupNoPolicyProps extends targets.TargetBaseProps {
|
|
|
41
37
|
* The event to send to the CloudWatch LogGroup
|
|
42
38
|
*
|
|
43
39
|
* This will be the event logged into the CloudWatch LogGroup
|
|
44
|
-
*
|
|
45
40
|
* @default - the entire EventBridge event
|
|
46
41
|
*/
|
|
47
42
|
readonly event?: events.RuleTargetInput;
|
|
@@ -55,6 +50,8 @@ export declare class CloudWatchLogGroupNoPolicy implements events.IRuleTarget {
|
|
|
55
50
|
constructor(logGroup: logs.ILogGroup, props?: LogGroupNoPolicyProps);
|
|
56
51
|
/**
|
|
57
52
|
* Returns a RuleTarget that can be used to log an event into a CloudWatch LogGroup
|
|
53
|
+
* @param _rule
|
|
54
|
+
* @param _id
|
|
58
55
|
*/
|
|
59
56
|
bind(_rule: events.IRule, _id?: string): events.RuleTargetConfig;
|
|
60
57
|
}
|