@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
|
@@ -20,40 +20,30 @@ import {
|
|
|
20
20
|
} from 'aws-cdk-lib/aws-stepfunctions-tasks'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* @category cdk-utils.step-functions-manager
|
|
24
|
-
* @subcategory Properties
|
|
25
23
|
*/
|
|
26
24
|
export interface SfnSucceedProps extends SucceedProps {
|
|
27
25
|
name: string
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
/**
|
|
31
|
-
* @category cdk-utils.step-functions-manager
|
|
32
|
-
* @subcategory Properties
|
|
33
29
|
*/
|
|
34
30
|
export interface SfnRetryProps extends RetryProps {
|
|
35
31
|
intervalInSecs: number
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
/**
|
|
39
|
-
* @category cdk-utils.step-functions-manager
|
|
40
|
-
* @subcategory Properties
|
|
41
35
|
*/
|
|
42
36
|
export interface SfnFailProps extends FailProps {
|
|
43
37
|
name: string
|
|
44
38
|
}
|
|
45
39
|
|
|
46
40
|
/**
|
|
47
|
-
* @category cdk-utils.step-functions-manager
|
|
48
|
-
* @subcategory Properties
|
|
49
41
|
*/
|
|
50
42
|
export interface SfnPassProps extends PassProps {
|
|
51
43
|
name: string
|
|
52
44
|
}
|
|
53
45
|
|
|
54
46
|
/**
|
|
55
|
-
* @category cdk-utils.step-functions-manager
|
|
56
|
-
* @subcategory Properties
|
|
57
47
|
*/
|
|
58
48
|
export interface SfnDynamoGetItemProps extends DynamoGetItemProps {
|
|
59
49
|
name: string
|
|
@@ -61,8 +51,6 @@ export interface SfnDynamoGetItemProps extends DynamoGetItemProps {
|
|
|
61
51
|
}
|
|
62
52
|
|
|
63
53
|
/**
|
|
64
|
-
* @category cdk-utils.step-functions-manager
|
|
65
|
-
* @subcategory Properties
|
|
66
54
|
*/
|
|
67
55
|
export interface SfnDynamoPutItemProps extends DynamoPutItemProps {
|
|
68
56
|
name: string
|
|
@@ -70,8 +58,6 @@ export interface SfnDynamoPutItemProps extends DynamoPutItemProps {
|
|
|
70
58
|
}
|
|
71
59
|
|
|
72
60
|
/**
|
|
73
|
-
* @category cdk-utils.step-functions-manager
|
|
74
|
-
* @subcategory Properties
|
|
75
61
|
*/
|
|
76
62
|
export interface SfnDynamoDeleteItemProps extends DynamoDeleteItemProps {
|
|
77
63
|
name: string
|
|
@@ -79,8 +65,6 @@ export interface SfnDynamoDeleteItemProps extends DynamoDeleteItemProps {
|
|
|
79
65
|
}
|
|
80
66
|
|
|
81
67
|
/**
|
|
82
|
-
* @category cdk-utils.step-functions-manager
|
|
83
|
-
* @subcategory Properties
|
|
84
68
|
*/
|
|
85
69
|
export interface SfnSqsSendMessageProps extends SqsSendMessageProps {
|
|
86
70
|
name: string
|
|
@@ -88,8 +72,6 @@ export interface SfnSqsSendMessageProps extends SqsSendMessageProps {
|
|
|
88
72
|
}
|
|
89
73
|
|
|
90
74
|
/**
|
|
91
|
-
* @category cdk-utils.step-functions-manager
|
|
92
|
-
* @subcategory Properties
|
|
93
75
|
*/
|
|
94
76
|
export interface SfnParallelProps extends ParallelProps {
|
|
95
77
|
name: string
|
|
@@ -97,16 +79,12 @@ export interface SfnParallelProps extends ParallelProps {
|
|
|
97
79
|
}
|
|
98
80
|
|
|
99
81
|
/**
|
|
100
|
-
* @category cdk-utils.step-functions-manager
|
|
101
|
-
* @subcategory Properties
|
|
102
82
|
*/
|
|
103
83
|
export interface SfnChoiceProps extends ChoiceProps {
|
|
104
84
|
name: string
|
|
105
85
|
}
|
|
106
86
|
|
|
107
87
|
/**
|
|
108
|
-
* @category cdk-utils.step-functions-manager
|
|
109
|
-
* @subcategory Properties
|
|
110
88
|
*/
|
|
111
89
|
export interface SfnWaitProps extends WaitProps {
|
|
112
90
|
name: string
|
|
@@ -114,8 +92,6 @@ export interface SfnWaitProps extends WaitProps {
|
|
|
114
92
|
}
|
|
115
93
|
|
|
116
94
|
/**
|
|
117
|
-
* @category cdk-utils.step-functions-manager
|
|
118
|
-
* @subcategory Properties
|
|
119
95
|
*/
|
|
120
96
|
export interface SfnLambdaInvokeProps extends LambdaInvokeProps {
|
|
121
97
|
name: string
|
|
@@ -123,8 +99,6 @@ export interface SfnLambdaInvokeProps extends LambdaInvokeProps {
|
|
|
123
99
|
}
|
|
124
100
|
|
|
125
101
|
/**
|
|
126
|
-
* @category cdk-utils.step-functions-manager
|
|
127
|
-
* @subcategory Properties
|
|
128
102
|
*/
|
|
129
103
|
export interface SfnCallApiGatewayRestApiEndpointProps extends CallApiGatewayRestApiEndpointProps {
|
|
130
104
|
name: string
|
|
@@ -132,20 +106,14 @@ export interface SfnCallApiGatewayRestApiEndpointProps extends CallApiGatewayRes
|
|
|
132
106
|
}
|
|
133
107
|
|
|
134
108
|
/**
|
|
135
|
-
* @category cdk-utils.step-functions-manager
|
|
136
|
-
* @subcategory Properties
|
|
137
109
|
*/
|
|
138
110
|
export interface SfnStateMachineProps extends StateMachineProps {}
|
|
139
111
|
|
|
140
112
|
/**
|
|
141
|
-
* @category cdk-utils.sfn-manager
|
|
142
|
-
* @subcategory Properties
|
|
143
113
|
*/
|
|
144
114
|
export interface SfnMapProps extends MapProps {}
|
|
145
115
|
|
|
146
116
|
/**
|
|
147
|
-
* @category cdk-utils.sfn-manager
|
|
148
|
-
* @subcategory Properties
|
|
149
117
|
*/
|
|
150
118
|
export interface SfnStartExecutionProps extends StepFunctionsStartExecutionProps {
|
|
151
119
|
retries?: SfnRetryProps[]
|
|
@@ -5,9 +5,6 @@ import { CommonConstruct } from '../../../common'
|
|
|
5
5
|
import { SSMParameterReaderProps } from './types'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @stability stable
|
|
9
|
-
* @category cdk-utils.ssm-manager
|
|
10
|
-
* @subcategory Construct
|
|
11
8
|
* @classdesc Provides operations on AWS Systems Manager.
|
|
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,7 +18,6 @@ import { SSMParameterReaderProps } from './types'
|
|
|
21
18
|
* this.acmManager.writeStringToParameters('MyParameter', this, ...props)
|
|
22
19
|
* }
|
|
23
20
|
* }
|
|
24
|
-
*
|
|
25
21
|
* @see [CDK Systems Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm-readme.html}
|
|
26
22
|
*/
|
|
27
23
|
export class SsmManager {
|
|
@@ -29,16 +25,16 @@ export class SsmManager {
|
|
|
29
25
|
|
|
30
26
|
/**
|
|
31
27
|
* Method to write a string parameter to the parameters store
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
28
|
+
* @param id scoped id of the resource
|
|
29
|
+
* @param scope scope in which this resource is defined
|
|
30
|
+
* @param props parameter props
|
|
35
31
|
*/
|
|
36
32
|
public writeStringToParameters(id: string, scope: CommonConstruct, props: ssm.StringParameterProps) {
|
|
37
33
|
if (!props) throw `Parameter props undefined for ${id}`
|
|
38
34
|
|
|
39
35
|
const parameter = new ssm.StringParameter(scope, `${id}`, {
|
|
40
|
-
parameterName: `${props.parameterName}-${scope.props.stage}`,
|
|
41
36
|
description: `${props.description} - ${scope.props.stage} stage`,
|
|
37
|
+
parameterName: `${props.parameterName}-${scope.props.stage}`,
|
|
42
38
|
stringValue: props.stringValue,
|
|
43
39
|
})
|
|
44
40
|
|
|
@@ -50,9 +46,9 @@ export class SsmManager {
|
|
|
50
46
|
|
|
51
47
|
/**
|
|
52
48
|
* Method to read a string parameter from the parameters store
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which this resource is defined
|
|
51
|
+
* @param parameterName parameter name to lookup
|
|
56
52
|
*/
|
|
57
53
|
public readStringParameter(id: string, scope: CommonConstruct, parameterName: string) {
|
|
58
54
|
if (!parameterName || parameterName == '') throw 'Invalid parameter name'
|
|
@@ -62,10 +58,10 @@ export class SsmManager {
|
|
|
62
58
|
|
|
63
59
|
/**
|
|
64
60
|
* Method to read a string parameter from the parameters store in a given region
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
61
|
+
* @param id scoped id of the resource
|
|
62
|
+
* @param scope scope in which this resource is defined
|
|
63
|
+
* @param parameterName parameter name to lookup
|
|
64
|
+
* @param region region name to lookup parameter
|
|
69
65
|
*/
|
|
70
66
|
public readStringParameterFromRegion(id: string, scope: CommonConstruct, parameterName: string, region: string) {
|
|
71
67
|
if (!parameterName || parameterName == '') throw `Invalid parameter name for ${id}`
|
|
@@ -79,8 +75,6 @@ export class SsmManager {
|
|
|
79
75
|
}
|
|
80
76
|
|
|
81
77
|
/**
|
|
82
|
-
* @category cdk-utils.ssm-manager
|
|
83
|
-
* @subcategory Construct
|
|
84
78
|
* @classdesc Provides utilities to read same/cross region SSM parameters
|
|
85
79
|
*/
|
|
86
80
|
export class SSMParameterReader extends cr.AwsCustomResource {
|
|
@@ -88,13 +82,13 @@ export class SSMParameterReader extends cr.AwsCustomResource {
|
|
|
88
82
|
const { parameterName, region } = props
|
|
89
83
|
|
|
90
84
|
const ssmAwsSdkCall: cr.AwsSdkCall = {
|
|
91
|
-
service: 'SSM',
|
|
92
85
|
action: 'getParameter',
|
|
93
86
|
parameters: {
|
|
94
87
|
Name: `${parameterName}-${scope.props.stage}`,
|
|
95
88
|
},
|
|
96
|
-
region,
|
|
97
89
|
physicalResourceId: cr.PhysicalResourceId.of(Date.now().toString()),
|
|
90
|
+
region,
|
|
91
|
+
service: 'SSM',
|
|
98
92
|
}
|
|
99
93
|
|
|
100
94
|
super(scope, name, {
|
|
@@ -4,15 +4,10 @@ import * as utils from '../../../utils'
|
|
|
4
4
|
import { CommonConstruct } from '../../../common'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @stability stable
|
|
8
|
-
* @category cdk-utils.vpc-manager
|
|
9
|
-
* @subcategory Construct
|
|
10
7
|
*/
|
|
11
8
|
const CommonVpcIdentifier = 'CommonVpc'
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
|
-
* @category cdk-utils.vpc-manager
|
|
15
|
-
* @subcategory Construct
|
|
16
11
|
* @classdesc Provides operations on AWS VPC.
|
|
17
12
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
18
13
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -26,21 +21,20 @@ const CommonVpcIdentifier = 'CommonVpc'
|
|
|
26
21
|
* this.vpcManager.createVpc('MyVPC', this)
|
|
27
22
|
* }
|
|
28
23
|
* }
|
|
29
|
-
*
|
|
30
24
|
* @see [CDK VPC Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.@aws-cdk_aws-ec2.Vpc.html}
|
|
31
25
|
*/
|
|
32
26
|
export class VpcManager {
|
|
33
27
|
/**
|
|
34
28
|
* @summary Method to create a new vpc
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
29
|
+
* @param id scoped id of the resource
|
|
30
|
+
* @param scope scope in which this resource is defined
|
|
31
|
+
* @param props
|
|
38
32
|
*/
|
|
39
33
|
public createVpc(id: string, scope: CommonConstruct, props: ec2.VpcProps) {
|
|
40
34
|
if (!props) throw `Vpc props undefined for ${id}`
|
|
41
35
|
const vpc = new ec2.Vpc(scope, `${id}`, {
|
|
42
|
-
maxAzs: props.maxAzs,
|
|
43
36
|
ipAddresses: props.ipAddresses,
|
|
37
|
+
maxAzs: props.maxAzs,
|
|
44
38
|
})
|
|
45
39
|
|
|
46
40
|
utils.createCfnOutput(`${id}Id`, scope, vpc.vpcId)
|
|
@@ -64,9 +58,9 @@ export class VpcManager {
|
|
|
64
58
|
|
|
65
59
|
/**
|
|
66
60
|
* @summary Method to create a common vpc
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
61
|
+
* @param scope scope in which this resource is defined
|
|
62
|
+
* @param props
|
|
63
|
+
* @param vpcIdentifier optional identifier for VPC
|
|
70
64
|
*/
|
|
71
65
|
public createCommonVpc(scope: CommonConstruct, props: ec2.VpcProps, vpcIdentifier?: string) {
|
|
72
66
|
const vpc = this.createVpc(CommonVpcIdentifier, scope, props)
|
|
@@ -77,9 +71,9 @@ export class VpcManager {
|
|
|
77
71
|
|
|
78
72
|
/**
|
|
79
73
|
* @summary Method to retrieve a common vpc
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
74
|
+
* @param id scoped id of the resource
|
|
75
|
+
* @param scope scope in which this resource is defined
|
|
76
|
+
* @param vpcIdentifier optional identifier for VPC
|
|
83
77
|
*/
|
|
84
78
|
public retrieveCommonVpc(id: string, scope: CommonConstruct, vpcIdentifier?: string) {
|
|
85
79
|
return ec2.Vpc.fromLookup(scope, `${id}`, { vpcName: vpcIdentifier ?? CommonVpcIdentifier })
|
|
@@ -4,9 +4,6 @@ import { CommonConstruct } from '../../../common'
|
|
|
4
4
|
import { WafIPSetProps, WafWebACLProps } from './types'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @stability stable
|
|
8
|
-
* @category cdk-utils.waf-manager
|
|
9
|
-
* @subcategory Construct
|
|
10
7
|
* @classdesc Provides operations on AWS WAF.
|
|
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,24 +17,23 @@ import { WafIPSetProps, WafWebACLProps } from './types'
|
|
|
20
17
|
* this.wafManager.createWebAcl('MyWebAcl', this)
|
|
21
18
|
* }
|
|
22
19
|
* }
|
|
23
|
-
*
|
|
24
20
|
* @see [CDK WAF Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_waf-readme.html}
|
|
25
21
|
*/
|
|
26
22
|
export class WafManager {
|
|
27
23
|
/**
|
|
28
24
|
* @summary Method to create an ip set
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
25
|
+
* @param id scoped id of the resource
|
|
26
|
+
* @param scope scope in which this resource is defined
|
|
27
|
+
* @param props
|
|
32
28
|
*/
|
|
33
29
|
public createIpSet(id: string, scope: CommonConstruct, props: WafIPSetProps) {
|
|
34
30
|
if (!props) throw `WAF Ip Set props undefined for ${id}`
|
|
35
31
|
|
|
36
32
|
const ipSet = new wafv2.CfnIPSet(scope, `${id}`, {
|
|
37
|
-
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
38
|
-
description: `IP Set for ${id} - ${scope.props.stage} stage`,
|
|
39
33
|
addresses: props.addresses,
|
|
34
|
+
description: `IP Set for ${id} - ${scope.props.stage} stage`,
|
|
40
35
|
ipAddressVersion: props.ipAddressVersion,
|
|
36
|
+
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
41
37
|
scope: props.scope,
|
|
42
38
|
})
|
|
43
39
|
|
|
@@ -49,21 +45,21 @@ export class WafManager {
|
|
|
49
45
|
|
|
50
46
|
/**
|
|
51
47
|
* @summary Method to create a web acl
|
|
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
|
|
55
51
|
*/
|
|
56
52
|
public createWebAcl(id: string, scope: CommonConstruct, props: WafWebACLProps) {
|
|
57
53
|
if (!props) throw `WAF WebACL props undefined for ${id}`
|
|
58
54
|
|
|
59
55
|
const webAcl = new wafv2.CfnWebACL(scope, `${id}`, {
|
|
60
|
-
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
61
|
-
description: `Web Acl for ${id} - ${scope.props.stage} stage`,
|
|
62
56
|
defaultAction: props.defaultAction,
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
description: `Web Acl for ${id} - ${scope.props.stage} stage`,
|
|
58
|
+
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
65
59
|
rules: props.rules,
|
|
60
|
+
scope: props.scope,
|
|
66
61
|
tags: [{ key: 'service', value: scope.props.name }],
|
|
62
|
+
visibilityConfig: props.visibilityConfig,
|
|
67
63
|
})
|
|
68
64
|
|
|
69
65
|
utils.createCfnOutput(`${id}-webAclId`, scope, webAcl.attrId)
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { CfnIPSetProps, CfnWebACLProps } from 'aws-cdk-lib/aws-wafv2'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @category cdk-utils.waf-manager
|
|
5
|
-
* @subcategory Properties
|
|
6
4
|
*/
|
|
7
5
|
export interface WafIPSetProps extends CfnIPSetProps {}
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
|
-
* @category cdk-utils.waf-manager
|
|
11
|
-
* @subcategory Properties
|
|
12
8
|
*/
|
|
13
9
|
export interface WafWebACLProps extends CfnWebACLProps {}
|
|
@@ -3,16 +3,13 @@ import * as _ from 'lodash'
|
|
|
3
3
|
import { CommonConstruct } from '../../common'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @category cdk-utils.utils
|
|
7
6
|
* @summary Helper method to add CloudFormation outputs from the construct
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @
|
|
14
|
-
*
|
|
15
|
-
* @return {cdk.CfnOutput} The CloudFormation output
|
|
7
|
+
* @param id scoped id of the resource
|
|
8
|
+
* @param scope scope in which this resource is defined
|
|
9
|
+
* @param value the value of the exported output
|
|
10
|
+
* @param description optional description for the output
|
|
11
|
+
* @param overrideId Flag which indicates whether to override the default logical id of the output
|
|
12
|
+
* @returns The CloudFormation output
|
|
16
13
|
*/
|
|
17
14
|
export function createCfnOutput(
|
|
18
15
|
id: string,
|
|
@@ -23,9 +20,9 @@ export function createCfnOutput(
|
|
|
23
20
|
): cdk.CfnOutput {
|
|
24
21
|
const camelName = _.camelCase(id)
|
|
25
22
|
const output = new cdk.CfnOutput(scope, id, {
|
|
23
|
+
description,
|
|
26
24
|
exportName: `${scope.props.stackName}-${camelName}`,
|
|
27
25
|
value: value ?? '',
|
|
28
|
-
description,
|
|
29
26
|
})
|
|
30
27
|
if (overrideId) {
|
|
31
28
|
output.overrideLogicalId(camelName)
|
package/src/lib/utils/index.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
export * from './aws'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @category cdk-utils.utils
|
|
5
4
|
*/
|
|
6
5
|
const defaultResponseObject = {
|
|
7
|
-
statusCode: 200,
|
|
8
6
|
body: '',
|
|
9
|
-
isBase64Encoded: false,
|
|
10
7
|
headers: {
|
|
11
8
|
'Access-Control-Allow-Origin': '*',
|
|
12
9
|
},
|
|
10
|
+
isBase64Encoded: false,
|
|
11
|
+
statusCode: 200,
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
|
-
* @category cdk-utils.utils
|
|
17
15
|
*/
|
|
18
16
|
export enum LogLevel {
|
|
19
17
|
DEBUG = 'DEBUG',
|
|
@@ -25,45 +23,39 @@ export enum LogLevel {
|
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
|
-
* @category cdk-utils.utils
|
|
29
26
|
* @param stage
|
|
30
27
|
*/
|
|
31
28
|
export const isDevStage = (stage: string) => stage === 'dev'
|
|
32
29
|
/**
|
|
33
|
-
* @category cdk-utils.utils
|
|
34
30
|
* @param stage
|
|
35
31
|
*/
|
|
36
32
|
export const isTestStage = (stage: string) => stage === 'tst'
|
|
37
33
|
/**
|
|
38
|
-
* @category cdk-utils.utils
|
|
39
34
|
* @param stage
|
|
40
35
|
*/
|
|
41
36
|
export const isUatStage = (stage: string) => stage === 'uat'
|
|
42
37
|
/**
|
|
43
|
-
* @category cdk-utils.utils
|
|
44
38
|
* @param stage
|
|
45
39
|
*/
|
|
46
40
|
export const isPrdStage = (stage: string) => stage === 'prd'
|
|
47
41
|
|
|
48
42
|
/**
|
|
49
|
-
* @category cdk-utils.utils
|
|
50
43
|
* @param error
|
|
51
44
|
*/
|
|
52
45
|
export function redirectError(error: any) {
|
|
53
46
|
console.error(error, error.message, error.stack)
|
|
54
47
|
return Object.assign({}, defaultResponseObject, {
|
|
48
|
+
body: JSON.stringify(Object.assign({}, { error: error.message, success: false })),
|
|
55
49
|
statusCode: 500,
|
|
56
|
-
body: JSON.stringify(Object.assign({}, { success: false, error: error.message })),
|
|
57
50
|
})
|
|
58
51
|
}
|
|
59
52
|
|
|
60
53
|
/**
|
|
61
|
-
* @category cdk-utils.utils
|
|
62
54
|
* @param message
|
|
63
55
|
*/
|
|
64
56
|
export function redirectSuccess(message: any) {
|
|
65
57
|
return Object.assign({}, defaultResponseObject, {
|
|
58
|
+
body: JSON.stringify(Object.assign({}, { error: message, success: true })),
|
|
66
59
|
statusCode: 200,
|
|
67
|
-
body: JSON.stringify(Object.assign({}, { success: true, error: message })),
|
|
68
60
|
})
|
|
69
61
|
}
|