@gradientedge/cdk-utils 8.90.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 +7 -12
- 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/index.d.ts +1 -0
- package/dist/src/lib/services/aws/web-application-firewall/index.js +1 -0
- 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 +5 -5
- 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 +7 -12
- 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/index.ts +1 -0
- 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
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { CfnCacheClusterProps, CfnReplicationGroupProps } from 'aws-cdk-lib/aws-elasticache'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @category cdk-utils.elasticache-manager
|
|
5
|
-
* @category Compute
|
|
6
4
|
*/
|
|
7
5
|
export interface ElastiCacheProps extends CfnCacheClusterProps {}
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
|
-
* @category cdk-utils.elasticache-manager
|
|
11
|
-
* @category Compute
|
|
12
8
|
*/
|
|
13
9
|
export interface ReplicatedElastiCacheProps extends CfnReplicationGroupProps {}
|
|
@@ -11,9 +11,6 @@ import { CommonConstruct } from '../../../common'
|
|
|
11
11
|
import { EventBusProps, EventRuleProps, RuleProps, SqsToSfnPipeProps } from './types'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @stability stable
|
|
15
|
-
* @category cdk-utils.event-manager
|
|
16
|
-
* @subcategory Construct
|
|
17
14
|
* @classdesc Provides operations on AWS EventBridge.
|
|
18
15
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
19
16
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -27,15 +24,14 @@ import { EventBusProps, EventRuleProps, RuleProps, SqsToSfnPipeProps } from './t
|
|
|
27
24
|
* this.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
|
|
28
25
|
* }
|
|
29
26
|
* }
|
|
30
|
-
*
|
|
31
27
|
* @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
|
|
32
28
|
*/
|
|
33
29
|
export class EventManager {
|
|
34
30
|
/**
|
|
35
31
|
* Method to create an event bus
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
32
|
+
* @param id scoped id of the resource
|
|
33
|
+
* @param scope scope in which this resource is defined
|
|
34
|
+
* @param props event bus properties
|
|
39
35
|
*/
|
|
40
36
|
public createEventBus(id: string, scope: CommonConstruct, props: EventBusProps) {
|
|
41
37
|
if (!props) throw `EventBus props undefined for ${id}`
|
|
@@ -52,11 +48,11 @@ export class EventManager {
|
|
|
52
48
|
|
|
53
49
|
/**
|
|
54
50
|
* Method to create an event rule
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
51
|
+
* @param id scoped id of the resource
|
|
52
|
+
* @param scope scope in which this resource is defined
|
|
53
|
+
* @param props event rule properties
|
|
54
|
+
* @param eventBus optional custom event bus
|
|
55
|
+
* @param targets optional event targets
|
|
60
56
|
*/
|
|
61
57
|
public createRule(
|
|
62
58
|
id: string,
|
|
@@ -68,11 +64,11 @@ export class EventManager {
|
|
|
68
64
|
if (!props) throw `EventRule props undefined for ${id}`
|
|
69
65
|
|
|
70
66
|
const rule = new events.Rule(scope, `${id}`, {
|
|
71
|
-
eventBus: eventBus,
|
|
72
67
|
description: props.description,
|
|
73
|
-
ruleName: `${props.ruleName}-${scope.props.stage}`,
|
|
74
|
-
eventPattern: props.eventPattern,
|
|
75
68
|
enabled: props.enabled,
|
|
69
|
+
eventBus: eventBus,
|
|
70
|
+
eventPattern: props.eventPattern,
|
|
71
|
+
ruleName: `${props.ruleName}-${scope.props.stage}`,
|
|
76
72
|
schedule: props.schedule,
|
|
77
73
|
})
|
|
78
74
|
|
|
@@ -96,13 +92,13 @@ export class EventManager {
|
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
* @summary Method to create an eventbridge rule with lambda target
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
105
|
-
* @param
|
|
95
|
+
* @param id scoped id of the resource
|
|
96
|
+
* @param scope scope in which this resource is defined
|
|
97
|
+
* @param props
|
|
98
|
+
* @param lambdaFunction
|
|
99
|
+
* @param eventBusName
|
|
100
|
+
* @param eventPattern
|
|
101
|
+
* @param scheduleExpression
|
|
106
102
|
*/
|
|
107
103
|
public createLambdaRule(
|
|
108
104
|
id: string,
|
|
@@ -119,8 +115,8 @@ export class EventManager {
|
|
|
119
115
|
description: 'Rule to send notification to lambda function target',
|
|
120
116
|
eventBusName: eventBusName,
|
|
121
117
|
eventPattern: eventPattern,
|
|
122
|
-
scheduleExpression: scheduleExpression,
|
|
123
118
|
name: `${props.name}-${scope.props.stage}`,
|
|
119
|
+
scheduleExpression: scheduleExpression,
|
|
124
120
|
state: props.state,
|
|
125
121
|
targets: [
|
|
126
122
|
{
|
|
@@ -146,14 +142,14 @@ export class EventManager {
|
|
|
146
142
|
|
|
147
143
|
/**
|
|
148
144
|
* @summary Method to create an eventbridge rule with fargate task target
|
|
149
|
-
* @param
|
|
150
|
-
* @param
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
153
|
-
* @param
|
|
154
|
-
* @param
|
|
155
|
-
* @param
|
|
156
|
-
* @param
|
|
145
|
+
* @param id scoped id of the resource
|
|
146
|
+
* @param scope scope in which this resource is defined
|
|
147
|
+
* @param props
|
|
148
|
+
* @param cluster
|
|
149
|
+
* @param task
|
|
150
|
+
* @param subnetIds
|
|
151
|
+
* @param role
|
|
152
|
+
* @param eventPattern
|
|
157
153
|
*/
|
|
158
154
|
public createFargateTaskRule(
|
|
159
155
|
id: string,
|
|
@@ -175,7 +171,6 @@ export class EventManager {
|
|
|
175
171
|
targets: [
|
|
176
172
|
{
|
|
177
173
|
arn: cluster.clusterArn,
|
|
178
|
-
id: `${id}-${scope.props.stage}`,
|
|
179
174
|
ecsParameters: {
|
|
180
175
|
launchType: 'FARGATE',
|
|
181
176
|
networkConfiguration: {
|
|
@@ -184,6 +179,7 @@ export class EventManager {
|
|
|
184
179
|
taskCount: 1,
|
|
185
180
|
taskDefinitionArn: task.taskDefinitionArn,
|
|
186
181
|
},
|
|
182
|
+
id: `${id}-${scope.props.stage}`,
|
|
187
183
|
roleArn: role instanceof iam.Role ? role.roleArn : role.attrArn,
|
|
188
184
|
},
|
|
189
185
|
],
|
|
@@ -197,8 +193,8 @@ export class EventManager {
|
|
|
197
193
|
|
|
198
194
|
/**
|
|
199
195
|
* @summary Method to create an eventbridge pipe with sqs queue as source and step function as target
|
|
200
|
-
* @param
|
|
201
|
-
* @param
|
|
196
|
+
* @param id scoped id of the resource
|
|
197
|
+
* @param scope scope in which this resource is defined
|
|
202
198
|
* @param props the props for the pipe
|
|
203
199
|
* @param sourceQueue the source sqs queue
|
|
204
200
|
* @param targetStepFunction the target step function
|
|
@@ -219,8 +215,11 @@ export class EventManager {
|
|
|
219
215
|
|
|
220
216
|
const pipe = new pipes.CfnPipe(scope, `${id}`, {
|
|
221
217
|
...props,
|
|
222
|
-
name: `${props.name}-${scope.props.stage}`,
|
|
223
218
|
description: props.description,
|
|
219
|
+
enrichment: props.enrichment,
|
|
220
|
+
enrichmentParameters: props.enrichmentParameters,
|
|
221
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
222
|
+
roleArn: pipeRole.roleArn,
|
|
224
223
|
source: sourceQueue.queueArn,
|
|
225
224
|
sourceParameters: {
|
|
226
225
|
filterCriteria: props.pipeFilterPattern
|
|
@@ -244,9 +243,6 @@ export class EventManager {
|
|
|
244
243
|
invocationType: props.sfnInvocationType ?? 'FIRE_AND_FORGET',
|
|
245
244
|
},
|
|
246
245
|
},
|
|
247
|
-
enrichment: props.enrichment,
|
|
248
|
-
enrichmentParameters: props.enrichmentParameters,
|
|
249
|
-
roleArn: pipeRole.roleArn,
|
|
250
246
|
})
|
|
251
247
|
|
|
252
248
|
utils.createCfnOutput(`${id}-pipeArn`, scope, pipe.attrArn)
|
|
@@ -5,9 +5,6 @@ import * as logs from 'aws-cdk-lib/aws-logs'
|
|
|
5
5
|
import { CommonConstruct } from '../../../common'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @stability stable
|
|
9
|
-
* @category cdk-utils.event-taeget-manager
|
|
10
|
-
* @subcategory Construct
|
|
11
8
|
* @classdesc Provides operations on AWS EventBridge Targets.
|
|
12
9
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
13
10
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -21,17 +18,16 @@ import { CommonConstruct } from '../../../common'
|
|
|
21
18
|
* this.eventTargetManager.createCloudWatchLogGroupNoPolicy('MyLogGrouptarget', this, myLogGroup)
|
|
22
19
|
* }
|
|
23
20
|
* }
|
|
24
|
-
*
|
|
25
21
|
* @see [CDK EventBridge Target Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets-readme.html}
|
|
26
22
|
*/
|
|
27
23
|
export class EventTargetManager {
|
|
28
24
|
/**
|
|
29
25
|
* @summary Method to create a cloud watch log group target without a policy.
|
|
30
26
|
* - This method is created as a workaround for cdk issue - https://github.com/aws/aws-cdk/issues/17002
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
27
|
+
* @param id scoped id of the resource
|
|
28
|
+
* @param scope scope in which this resource is defined
|
|
29
|
+
* @param logGroup the log group
|
|
30
|
+
* @param props the log group target properties
|
|
35
31
|
*/
|
|
36
32
|
public createCloudWatchLogGroupNoPolicy(
|
|
37
33
|
id: string,
|
|
@@ -51,7 +47,6 @@ export interface LogGroupNoPolicyProps extends targets.TargetBaseProps {
|
|
|
51
47
|
* The event to send to the CloudWatch LogGroup
|
|
52
48
|
*
|
|
53
49
|
* This will be the event logged into the CloudWatch LogGroup
|
|
54
|
-
*
|
|
55
50
|
* @default - the entire EventBridge event
|
|
56
51
|
*/
|
|
57
52
|
readonly event?: events.RuleTargetInput
|
|
@@ -65,6 +60,8 @@ export class CloudWatchLogGroupNoPolicy implements events.IRuleTarget {
|
|
|
65
60
|
|
|
66
61
|
/**
|
|
67
62
|
* Returns a RuleTarget that can be used to log an event into a CloudWatch LogGroup
|
|
63
|
+
* @param _rule
|
|
64
|
+
* @param _id
|
|
68
65
|
*/
|
|
69
66
|
public bind(_rule: events.IRule, _id?: string): events.RuleTargetConfig {
|
|
70
67
|
const logGroupStack = cdk.Stack.of(this.logGroup)
|
|
@@ -72,10 +69,10 @@ export class CloudWatchLogGroupNoPolicy implements events.IRuleTarget {
|
|
|
72
69
|
return {
|
|
73
70
|
...targets.bindBaseTargetConfig(this.props),
|
|
74
71
|
arn: logGroupStack.formatArn({
|
|
75
|
-
service: 'logs',
|
|
76
|
-
resource: 'log-group',
|
|
77
72
|
arnFormat: cdk.ArnFormat.COLON_RESOURCE_NAME,
|
|
73
|
+
resource: 'log-group',
|
|
78
74
|
resourceName: this.logGroup.logGroupName,
|
|
75
|
+
service: 'logs',
|
|
79
76
|
}),
|
|
80
77
|
input: this.props.event,
|
|
81
78
|
targetResource: this.logGroup,
|
|
@@ -4,35 +4,27 @@ import { TagProps } from '../../../types'
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
}
|
|
7
|
-
* @category cdk-utils.event-manager
|
|
8
|
-
* @subcategory Properties
|
|
9
7
|
*/
|
|
10
8
|
export interface SqsToSfnPipeProps extends CfnPipeProps {
|
|
11
9
|
pipeFilterPattern?: any
|
|
10
|
+
sfnInputTemplate?: string
|
|
11
|
+
sfnInvocationType?: string
|
|
12
12
|
sqsBatchSize?: number
|
|
13
13
|
sqsMaximumBatchingWindowInSeconds?: number
|
|
14
|
-
sfnInvocationType?: string
|
|
15
|
-
sfnInputTemplate?: string
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
|
-
* @category cdk-utils.event-manager
|
|
20
|
-
* @subcategory Properties
|
|
21
17
|
*/
|
|
22
18
|
export interface EventRuleProps extends EBRuleProps {
|
|
23
19
|
tags?: TagProps[]
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
/**
|
|
27
|
-
* @category cdk-utils.event-manager
|
|
28
|
-
* @subcategory Properties
|
|
29
23
|
*/
|
|
30
24
|
export interface RuleProps extends CfnRuleProps {
|
|
31
25
|
input?: string
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
/**
|
|
35
|
-
* @category cdk-utils.event-manager
|
|
36
|
-
* @subcategory Properties
|
|
37
29
|
*/
|
|
38
30
|
export interface EventBusProps extends EBProps {}
|
|
@@ -10,9 +10,6 @@ import {
|
|
|
10
10
|
} from './types'
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @stability stable
|
|
14
|
-
* @category cdk-utils.evidently-manager
|
|
15
|
-
* @subcategory Construct
|
|
16
13
|
* @classdesc Provides operations on AWS Evidently.
|
|
17
14
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
18
15
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -26,21 +23,20 @@ import {
|
|
|
26
23
|
* this.evidentlyManager.createProject('MyNewProhect', this, props)
|
|
27
24
|
* }
|
|
28
25
|
* }
|
|
29
|
-
*
|
|
30
26
|
* @see [CDK Evidently Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_evidently-readme.html}
|
|
31
27
|
*/
|
|
32
28
|
export class EvidentlyManager {
|
|
33
29
|
/**
|
|
34
30
|
* @summary Method to create a project
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
31
|
+
* @param id scoped id of the resource
|
|
32
|
+
* @param scope scope in which this resource is defined
|
|
33
|
+
* @param props the project properties
|
|
38
34
|
*/
|
|
39
35
|
public createProject(id: string, scope: CommonConstruct, props: EvidentlyProjectProps) {
|
|
40
36
|
const project = new evidently.CfnProject(scope, `${id}`, {
|
|
41
37
|
...props,
|
|
42
|
-
name: `${props.name}-${scope.props.stage}`,
|
|
43
38
|
description: `${props.description} ${scope.props.stage}`,
|
|
39
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
44
40
|
})
|
|
45
41
|
utils.createCfnOutput(`${id}-projectArn`, scope, project.attrArn)
|
|
46
42
|
utils.createCfnOutput(`${id}-projectName`, scope, project.name)
|
|
@@ -49,9 +45,9 @@ export class EvidentlyManager {
|
|
|
49
45
|
|
|
50
46
|
/**
|
|
51
47
|
* @summary Method to create a feature
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
48
|
+
* @param id scoped id of the resource
|
|
49
|
+
* @param scope scope in which this resource is defined
|
|
50
|
+
* @param props the feature properties
|
|
55
51
|
*/
|
|
56
52
|
public createFeature(id: string, scope: CommonConstruct, props: EvidentlyFeatureProps) {
|
|
57
53
|
const feature = new evidently.CfnFeature(scope, `${id}`, props)
|
|
@@ -62,15 +58,15 @@ export class EvidentlyManager {
|
|
|
62
58
|
|
|
63
59
|
/**
|
|
64
60
|
* @summary Method to create a launch
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
61
|
+
* @param id scoped id of the resource
|
|
62
|
+
* @param scope scope in which this resource is defined
|
|
63
|
+
* @param props the launch properties
|
|
68
64
|
*/
|
|
69
65
|
public createLaunch(id: string, scope: CommonConstruct, props: EvidentlyLaunchProps) {
|
|
70
66
|
const launch = new evidently.CfnLaunch(scope, `${id}`, {
|
|
71
67
|
...props,
|
|
72
|
-
name: `${props.name}-${scope.props.stage}`,
|
|
73
68
|
description: `${props.description} ${scope.props.stage}`,
|
|
69
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
74
70
|
})
|
|
75
71
|
utils.createCfnOutput(`${id}-launchArn`, scope, launch.attrArn)
|
|
76
72
|
utils.createCfnOutput(`${id}-launchName`, scope, launch.name)
|
|
@@ -79,15 +75,15 @@ export class EvidentlyManager {
|
|
|
79
75
|
|
|
80
76
|
/**
|
|
81
77
|
* @summary Method to create an experiment
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
78
|
+
* @param id scoped id of the resource
|
|
79
|
+
* @param scope scope in which this resource is defined
|
|
80
|
+
* @param props the experiment properties
|
|
85
81
|
*/
|
|
86
82
|
public createExperiment(id: string, scope: CommonConstruct, props: EvidentlyExperimentProps) {
|
|
87
83
|
const experiment = new evidently.CfnExperiment(scope, `${id}`, {
|
|
88
84
|
...props,
|
|
89
|
-
name: `${props.name}-${scope.props.stage}`,
|
|
90
85
|
description: `${props.description} ${scope.props.stage}`,
|
|
86
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
91
87
|
})
|
|
92
88
|
utils.createCfnOutput(`${id}-experimentArn`, scope, experiment.attrArn)
|
|
93
89
|
utils.createCfnOutput(`${id}-experimentName`, scope, experiment.name)
|
|
@@ -96,15 +92,15 @@ export class EvidentlyManager {
|
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
* @summary Method to create a segment
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
95
|
+
* @param id scoped id of the resource
|
|
96
|
+
* @param scope scope in which this resource is defined
|
|
97
|
+
* @param props the segment properties
|
|
102
98
|
*/
|
|
103
99
|
public createSegment(id: string, scope: CommonConstruct, props: EvidentlySegmentProps) {
|
|
104
100
|
const segment = new evidently.CfnSegment(scope, `${id}`, {
|
|
105
101
|
...props,
|
|
106
|
-
name: `${props.name}-${scope.props.stage}`,
|
|
107
102
|
description: `${props.description} ${scope.props.stage}`,
|
|
103
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
108
104
|
})
|
|
109
105
|
utils.createCfnOutput(`${id}-segmentArn`, scope, segment.attrArn)
|
|
110
106
|
utils.createCfnOutput(`${id}-segmentName`, scope, segment.name)
|
|
@@ -7,31 +7,21 @@ import {
|
|
|
7
7
|
} from 'aws-cdk-lib/aws-evidently'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @category cdk-utils.evidently-manager
|
|
11
|
-
* @subcategory Properties
|
|
12
10
|
*/
|
|
13
11
|
export interface EvidentlyProjectProps extends CfnProjectProps {}
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
|
-
* @category cdk-utils.evidently-manager
|
|
17
|
-
* @subcategory Properties
|
|
18
14
|
*/
|
|
19
15
|
export interface EvidentlyFeatureProps extends CfnFeatureProps {}
|
|
20
16
|
|
|
21
17
|
/**
|
|
22
|
-
* @category cdk-utils.evidently-manager
|
|
23
|
-
* @subcategory Properties
|
|
24
18
|
*/
|
|
25
19
|
export interface EvidentlyLaunchProps extends CfnLaunchProps {}
|
|
26
20
|
|
|
27
21
|
/**
|
|
28
|
-
* @category cdk-utils.evidently-manager
|
|
29
|
-
* @subcategory Properties
|
|
30
22
|
*/
|
|
31
23
|
export interface EvidentlyExperimentProps extends CfnExperimentProps {}
|
|
32
24
|
|
|
33
25
|
/**
|
|
34
|
-
* @category cdk-utils.evidently-manager
|
|
35
|
-
* @subcategory Properties
|
|
36
26
|
*/
|
|
37
27
|
export interface EvidentlySegmentProps extends CfnSegmentProps {}
|