@gradientedge/cdk-utils 7.21.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/lib/manager/aws/acm-manager.js +1 -1
- package/dist/src/lib/manager/aws/api-manager.js +2 -0
- package/dist/src/lib/manager/aws/app-config-manager.js +3 -3
- package/dist/src/lib/manager/aws/cloudfront-manager.js +4 -4
- package/dist/src/lib/manager/aws/cloudtrail-manager.js +4 -4
- package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +83 -1
- package/dist/src/lib/manager/aws/cloudwatch-manager.js +293 -7
- package/dist/src/lib/manager/aws/dynamodb-manager.js +1 -1
- package/dist/src/lib/manager/aws/ecs-manager.js +4 -4
- package/dist/src/lib/manager/aws/eks-manager.js +1 -1
- package/dist/src/lib/manager/aws/elasticache-manager.js +5 -6
- package/dist/src/lib/manager/aws/event-manager.js +4 -4
- package/dist/src/lib/manager/aws/kms-manager.js +1 -1
- package/dist/src/lib/manager/aws/log-manager.js +3 -3
- package/dist/src/lib/manager/aws/route53-manager.js +5 -5
- package/dist/src/lib/manager/aws/s3-manager.js +1 -1
- package/dist/src/lib/manager/aws/sfn-manager.js +11 -11
- package/dist/src/lib/manager/aws/sns-manager.js +2 -2
- package/dist/src/lib/manager/aws/sqs-manager.js +1 -1
- package/dist/src/lib/manager/aws/ssm-manager.js +3 -3
- package/dist/src/lib/manager/aws/vpc-manager.js +1 -1
- package/dist/src/lib/manager/aws/waf-manager.js +2 -2
- package/dist/src/lib/types/aws/index.d.ts +27 -3
- package/package.json +13 -13
- package/src/lib/manager/aws/acm-manager.ts +1 -1
- package/src/lib/manager/aws/api-manager.ts +1 -0
- package/src/lib/manager/aws/app-config-manager.ts +3 -3
- package/src/lib/manager/aws/cloudfront-manager.ts +4 -4
- package/src/lib/manager/aws/cloudtrail-manager.ts +4 -4
- package/src/lib/manager/aws/cloudwatch-manager.ts +312 -7
- package/src/lib/manager/aws/dynamodb-manager.ts +1 -1
- package/src/lib/manager/aws/ecs-manager.ts +4 -4
- package/src/lib/manager/aws/eks-manager.ts +1 -1
- package/src/lib/manager/aws/elasticache-manager.ts +5 -7
- package/src/lib/manager/aws/event-manager.ts +4 -4
- package/src/lib/manager/aws/kms-manager.ts +1 -1
- package/src/lib/manager/aws/log-manager.ts +3 -3
- package/src/lib/manager/aws/route53-manager.ts +5 -5
- package/src/lib/manager/aws/s3-manager.ts +1 -1
- package/src/lib/manager/aws/sfn-manager.ts +11 -11
- package/src/lib/manager/aws/sns-manager.ts +2 -2
- package/src/lib/manager/aws/sqs-manager.ts +1 -1
- package/src/lib/manager/aws/ssm-manager.ts +3 -3
- package/src/lib/manager/aws/vpc-manager.ts +1 -1
- package/src/lib/manager/aws/waf-manager.ts +2 -2
- package/src/lib/types/aws/index.ts +28 -3
|
@@ -54,12 +54,11 @@ class ElastiCacheManager {
|
|
|
54
54
|
* @param {string[]} subnetIds
|
|
55
55
|
*/
|
|
56
56
|
createElastiCacheSubnetGroup(id, scope, subnetIds) {
|
|
57
|
-
|
|
57
|
+
return new elasticache.CfnSubnetGroup(scope, `${id}`, {
|
|
58
58
|
cacheSubnetGroupName: `${id}-subnet-group-${scope.props.stage}`,
|
|
59
59
|
subnetIds: subnetIds,
|
|
60
60
|
description: `${id}-subnet-group-${scope.props.stage}`,
|
|
61
61
|
});
|
|
62
|
-
return elasticacheSubnetGroup;
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* @summary Method to create an elasticache resource
|
|
@@ -72,7 +71,7 @@ class ElastiCacheManager {
|
|
|
72
71
|
*/
|
|
73
72
|
createElastiCache(id, scope, props, subnetIds, securityGroupIds, logDeliveryConfigurations) {
|
|
74
73
|
if (!props)
|
|
75
|
-
throw `ElastiCache props undefined`;
|
|
74
|
+
throw `ElastiCache props undefined for ${id}`;
|
|
76
75
|
const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
|
|
77
76
|
const elasticacheCluster = new elasticache.CfnCacheCluster(scope, `${id}`, {
|
|
78
77
|
engine: props.engine,
|
|
@@ -95,7 +94,7 @@ class ElastiCacheManager {
|
|
|
95
94
|
snapshotWindow: props.snapshotWindow,
|
|
96
95
|
logDeliveryConfigurations: logDeliveryConfigurations,
|
|
97
96
|
});
|
|
98
|
-
elasticacheCluster.
|
|
97
|
+
elasticacheCluster.addDependency(subnetGroup);
|
|
99
98
|
utils.createCfnOutput(`${id}-clusterName`, scope, elasticacheCluster.clusterName);
|
|
100
99
|
utils.createCfnOutput(`${id}-redisEndpointPort`, scope, elasticacheCluster.attrRedisEndpointPort);
|
|
101
100
|
utils.createCfnOutput(`${id}-redisEndpointAddress`, scope, elasticacheCluster.attrRedisEndpointAddress);
|
|
@@ -112,7 +111,7 @@ class ElastiCacheManager {
|
|
|
112
111
|
*/
|
|
113
112
|
createReplicatedElastiCache(id, scope, props, subnetIds, securityGroupIds, logDeliveryConfigurations) {
|
|
114
113
|
if (!props)
|
|
115
|
-
throw `ElastiCache props undefined`;
|
|
114
|
+
throw `ElastiCache props undefined for ${id}`;
|
|
116
115
|
const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
|
|
117
116
|
const elasticacheCluster = new elasticache.CfnReplicationGroup(scope, `${id}`, {
|
|
118
117
|
replicationGroupDescription: `${id} Redis Replication Cluster`,
|
|
@@ -137,7 +136,7 @@ class ElastiCacheManager {
|
|
|
137
136
|
primaryClusterId: props.primaryClusterId,
|
|
138
137
|
autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
|
|
139
138
|
});
|
|
140
|
-
elasticacheCluster.
|
|
139
|
+
elasticacheCluster.addDependency(subnetGroup);
|
|
141
140
|
utils.createCfnOutput(`${id}-primaryEndPointPort`, scope, elasticacheCluster.attrPrimaryEndPointPort);
|
|
142
141
|
utils.createCfnOutput(`${id}-primaryEndPointAddress`, scope, elasticacheCluster.attrPrimaryEndPointAddress);
|
|
143
142
|
return elasticacheCluster;
|
|
@@ -57,7 +57,7 @@ class EventManager {
|
|
|
57
57
|
*/
|
|
58
58
|
createEventBus(id, scope, props) {
|
|
59
59
|
if (!props)
|
|
60
|
-
throw
|
|
60
|
+
throw `EventBus props undefined for ${id}`;
|
|
61
61
|
const eventBus = new events.EventBus(scope, `${id}`, {
|
|
62
62
|
eventBusName: `${props.eventBusName}-${scope.props.stage}`,
|
|
63
63
|
});
|
|
@@ -75,7 +75,7 @@ class EventManager {
|
|
|
75
75
|
*/
|
|
76
76
|
createRule(id, scope, props, eventBus, targets) {
|
|
77
77
|
if (!props)
|
|
78
|
-
throw `EventRule props undefined`;
|
|
78
|
+
throw `EventRule props undefined for ${id}`;
|
|
79
79
|
const rule = new events.Rule(scope, `${id}`, {
|
|
80
80
|
eventBus: eventBus,
|
|
81
81
|
description: props.description,
|
|
@@ -105,7 +105,7 @@ class EventManager {
|
|
|
105
105
|
*/
|
|
106
106
|
createLambdaRule(id, scope, props, lambdaFunction, eventBusName, eventPattern, scheduleExpression) {
|
|
107
107
|
if (!props)
|
|
108
|
-
throw `EventRule props undefined`;
|
|
108
|
+
throw `EventRule props undefined for ${id}`;
|
|
109
109
|
const eventRule = new events.CfnRule(scope, `${id}`, {
|
|
110
110
|
description: 'Rule to send notification to lambda function target',
|
|
111
111
|
eventBusName: eventBusName,
|
|
@@ -138,7 +138,7 @@ class EventManager {
|
|
|
138
138
|
*/
|
|
139
139
|
createFargateTaskRule(id, scope, props, cluster, task, subnetIds, role, eventPattern) {
|
|
140
140
|
if (!props)
|
|
141
|
-
throw `EventRule props undefined`;
|
|
141
|
+
throw `EventRule props undefined for ${id}`;
|
|
142
142
|
const eventRule = new events.CfnRule(scope, `${id}`, {
|
|
143
143
|
description: 'Rule to send notification on new objects in data bucket to ecs task target',
|
|
144
144
|
eventPattern: eventPattern,
|
|
@@ -55,7 +55,7 @@ class KmsManager {
|
|
|
55
55
|
*/
|
|
56
56
|
createKey(id, scope, props) {
|
|
57
57
|
if (!props)
|
|
58
|
-
throw `KMS Key props undefined`;
|
|
58
|
+
throw `KMS Key props undefined for ${id}`;
|
|
59
59
|
const key = new kms.Key(scope, `${id}`, {
|
|
60
60
|
description: props.description,
|
|
61
61
|
alias: `${props.alias}-${scope.props.stage}`,
|
|
@@ -57,7 +57,7 @@ class LogManager {
|
|
|
57
57
|
*/
|
|
58
58
|
createMetricFilter(id, scope, props, logGroup) {
|
|
59
59
|
if (!props)
|
|
60
|
-
throw `MetricFilter props undefined`;
|
|
60
|
+
throw `MetricFilter props undefined for ${id}`;
|
|
61
61
|
const metricFilter = new logs.MetricFilter(scope, `${id}`, {
|
|
62
62
|
logGroup: logGroup,
|
|
63
63
|
metricName: props.metricName,
|
|
@@ -83,7 +83,7 @@ class LogManager {
|
|
|
83
83
|
*/
|
|
84
84
|
createCfnLogGroup(id, scope, props) {
|
|
85
85
|
if (!props)
|
|
86
|
-
throw `Logs props undefined`;
|
|
86
|
+
throw `Logs props undefined for ${id}`;
|
|
87
87
|
const logGroup = new logs.CfnLogGroup(scope, `${id}`, {
|
|
88
88
|
logGroupName: `${props.logGroupName}-${scope.props.stage}`,
|
|
89
89
|
retentionInDays: props.retention,
|
|
@@ -99,7 +99,7 @@ class LogManager {
|
|
|
99
99
|
*/
|
|
100
100
|
createLogGroup(id, scope, props) {
|
|
101
101
|
if (!props)
|
|
102
|
-
throw `Logs props undefined`;
|
|
102
|
+
throw `Logs props undefined for ${id}`;
|
|
103
103
|
const logGroup = new logs.LogGroup(scope, `${id}`, {
|
|
104
104
|
logGroupName: `${props.logGroupName}-${scope.props.stage}`,
|
|
105
105
|
retention: props.retention,
|
|
@@ -57,7 +57,7 @@ class Route53Manager {
|
|
|
57
57
|
createHostedZone(id, scope, props) {
|
|
58
58
|
let hostedZone;
|
|
59
59
|
if (!props)
|
|
60
|
-
throw `Route53 props undefined`;
|
|
60
|
+
throw `Route53 props undefined for ${id}`;
|
|
61
61
|
if (props.useExistingHostedZone) {
|
|
62
62
|
hostedZone = route53.HostedZone.fromLookup(scope, `${id}`, {
|
|
63
63
|
domainName: scope.props.domainName,
|
|
@@ -107,9 +107,9 @@ class Route53Manager {
|
|
|
107
107
|
*/
|
|
108
108
|
createCloudFrontTargetARecord(id, scope, distribution, hostedZone, recordName, skipStageFromRecord) {
|
|
109
109
|
if (!distribution)
|
|
110
|
-
throw `Distribution undefined`;
|
|
110
|
+
throw `Distribution undefined for ${id}`;
|
|
111
111
|
if (!hostedZone)
|
|
112
|
-
throw `HostedZone undefined`;
|
|
112
|
+
throw `HostedZone undefined for ${id}`;
|
|
113
113
|
const aRecord = new route53.ARecord(scope, `${id}`, {
|
|
114
114
|
recordName: (recordName && scope.isProductionStage()) || skipStageFromRecord
|
|
115
115
|
? `${recordName}`
|
|
@@ -130,9 +130,9 @@ class Route53Manager {
|
|
|
130
130
|
*/
|
|
131
131
|
createCloudFrontTargetARecordV2(id, scope, distribution, hostedZone, recordName) {
|
|
132
132
|
if (!distribution)
|
|
133
|
-
throw `Distribution undefined`;
|
|
133
|
+
throw `Distribution undefined for ${id}`;
|
|
134
134
|
if (!hostedZone)
|
|
135
|
-
throw `HostedZone undefined`;
|
|
135
|
+
throw `HostedZone undefined for ${id}`;
|
|
136
136
|
const aRecord = new route53.ARecord(scope, `${id}`, {
|
|
137
137
|
recordName: recordName,
|
|
138
138
|
target: route53.RecordTarget.fromAlias(new route53Targets.CloudFrontTarget(distribution)),
|
|
@@ -108,7 +108,7 @@ class S3Manager {
|
|
|
108
108
|
*/
|
|
109
109
|
createS3Bucket(id, scope, props) {
|
|
110
110
|
if (!props)
|
|
111
|
-
throw `S3 props undefined`;
|
|
111
|
+
throw `S3 props undefined for ${id}`;
|
|
112
112
|
let bucket;
|
|
113
113
|
const bucketName = S3Manager.determineBucketName(scope, props);
|
|
114
114
|
if (props.existingBucket && props.bucketName) {
|
|
@@ -57,7 +57,7 @@ class SfnManager {
|
|
|
57
57
|
*/
|
|
58
58
|
createSuccessStep(id, scope, props) {
|
|
59
59
|
if (!props)
|
|
60
|
-
throw
|
|
60
|
+
throw `Step props undefined for ${id}`;
|
|
61
61
|
return new sfn.Succeed(scope, `${props.name}`, {
|
|
62
62
|
...props,
|
|
63
63
|
...{
|
|
@@ -73,7 +73,7 @@ class SfnManager {
|
|
|
73
73
|
*/
|
|
74
74
|
createFailStep(id, scope, props) {
|
|
75
75
|
if (!props)
|
|
76
|
-
throw
|
|
76
|
+
throw `Step props undefined for ${id}`;
|
|
77
77
|
return new sfn.Fail(scope, `${props.name}`, {
|
|
78
78
|
...props,
|
|
79
79
|
...{
|
|
@@ -89,7 +89,7 @@ class SfnManager {
|
|
|
89
89
|
*/
|
|
90
90
|
createPassStep(id, scope, props) {
|
|
91
91
|
if (!props)
|
|
92
|
-
throw
|
|
92
|
+
throw `Step props undefined for ${id}`;
|
|
93
93
|
return new sfn.Pass(scope, `${props.name}`, {
|
|
94
94
|
...props,
|
|
95
95
|
...{
|
|
@@ -105,7 +105,7 @@ class SfnManager {
|
|
|
105
105
|
*/
|
|
106
106
|
createParallelStep(id, scope, props) {
|
|
107
107
|
if (!props)
|
|
108
|
-
throw
|
|
108
|
+
throw `Step props undefined for ${id}`;
|
|
109
109
|
return new sfn.Parallel(scope, `${props.name}`, {
|
|
110
110
|
...props,
|
|
111
111
|
...{
|
|
@@ -121,7 +121,7 @@ class SfnManager {
|
|
|
121
121
|
*/
|
|
122
122
|
createChoiceStep(id, scope, props) {
|
|
123
123
|
if (!props)
|
|
124
|
-
throw
|
|
124
|
+
throw `Step props undefined for ${id}`;
|
|
125
125
|
return new sfn.Choice(scope, `${props.name}`, {
|
|
126
126
|
...props,
|
|
127
127
|
...{
|
|
@@ -154,7 +154,7 @@ class SfnManager {
|
|
|
154
154
|
*/
|
|
155
155
|
createDynamoDbGetItemStep(id, scope, props, table, tableKey) {
|
|
156
156
|
if (!props)
|
|
157
|
-
throw
|
|
157
|
+
throw `Step props undefined for ${id}`;
|
|
158
158
|
return new tasks.DynamoGetItem(scope, `${props.name}`, {
|
|
159
159
|
...props,
|
|
160
160
|
...{
|
|
@@ -185,7 +185,7 @@ class SfnManager {
|
|
|
185
185
|
*/
|
|
186
186
|
createDynamoDbPutItemStep(id, scope, props, table, tableItem) {
|
|
187
187
|
if (!props)
|
|
188
|
-
throw
|
|
188
|
+
throw `Step props undefined for ${id}`;
|
|
189
189
|
return new tasks.DynamoPutItem(scope, `${props.name}`, {
|
|
190
190
|
...props,
|
|
191
191
|
...{
|
|
@@ -217,7 +217,7 @@ class SfnManager {
|
|
|
217
217
|
*/
|
|
218
218
|
createSendSqsMessageStep(id, scope, props, queue) {
|
|
219
219
|
if (!props)
|
|
220
|
-
throw
|
|
220
|
+
throw `Step props undefined for ${id}`;
|
|
221
221
|
if (!props.messageBody)
|
|
222
222
|
throw 'Message body undefined';
|
|
223
223
|
return new tasks.SqsSendMessage(scope, `${props.name}`, {
|
|
@@ -248,7 +248,7 @@ class SfnManager {
|
|
|
248
248
|
*/
|
|
249
249
|
createLambdaStep(id, scope, props, lambdaFunction) {
|
|
250
250
|
if (!props)
|
|
251
|
-
throw
|
|
251
|
+
throw `Step props undefined for ${id}`;
|
|
252
252
|
return new tasks.LambdaInvoke(scope, `${props.name}`, {
|
|
253
253
|
...props,
|
|
254
254
|
...{
|
|
@@ -266,7 +266,7 @@ class SfnManager {
|
|
|
266
266
|
*/
|
|
267
267
|
createApiStep(id, scope, props, api) {
|
|
268
268
|
if (!props)
|
|
269
|
-
throw
|
|
269
|
+
throw `Step props undefined for ${id}`;
|
|
270
270
|
return new tasks.CallApiGatewayRestApiEndpoint(scope, `${props.name}`, {
|
|
271
271
|
...props,
|
|
272
272
|
...{
|
|
@@ -287,7 +287,7 @@ class SfnManager {
|
|
|
287
287
|
*/
|
|
288
288
|
createStateMachine(id, scope, props, definition, logGroup, role) {
|
|
289
289
|
if (!props)
|
|
290
|
-
throw
|
|
290
|
+
throw `State Machine props undefined for ${id}`;
|
|
291
291
|
const stateMachine = new sfn.StateMachine(scope, `${id}`, {
|
|
292
292
|
stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
|
|
293
293
|
definition,
|
|
@@ -57,7 +57,7 @@ class SnsManager {
|
|
|
57
57
|
*/
|
|
58
58
|
createEmailNotificationService(id, scope, props, emails) {
|
|
59
59
|
if (!props)
|
|
60
|
-
throw `Subscription props undefined`;
|
|
60
|
+
throw `Subscription props undefined for ${id}`;
|
|
61
61
|
const topic = new sns.Topic(scope, id, {
|
|
62
62
|
displayName: `${props.topicName}-${scope.props.stage}`,
|
|
63
63
|
topicName: `${props.topicName}-${scope.props.stage}`,
|
|
@@ -79,7 +79,7 @@ class SnsManager {
|
|
|
79
79
|
*/
|
|
80
80
|
createLambdaNotificationService(id, scope, props, lambdaFunction) {
|
|
81
81
|
if (!props)
|
|
82
|
-
throw `Subscription props undefined`;
|
|
82
|
+
throw `Subscription props undefined for ${id}`;
|
|
83
83
|
const topic = new sns.Topic(scope, id, {
|
|
84
84
|
displayName: `${props.topicName}-${scope.props.stage}`,
|
|
85
85
|
topicName: `${props.topicName}-${scope.props.stage}`,
|
|
@@ -57,7 +57,7 @@ class SqsManager {
|
|
|
57
57
|
*/
|
|
58
58
|
createQueue(id, scope, props, deadLetterQueue) {
|
|
59
59
|
if (!props)
|
|
60
|
-
throw `Queue props undefined`;
|
|
60
|
+
throw `Queue props undefined for ${id}`;
|
|
61
61
|
const queue = new sqs.Queue(scope, id, {
|
|
62
62
|
queueName: props.queueName,
|
|
63
63
|
visibilityTimeout: props.visibilityTimeoutInSecs
|
|
@@ -57,7 +57,7 @@ class SsmManager {
|
|
|
57
57
|
*/
|
|
58
58
|
writeStringToParameters(id, scope, props) {
|
|
59
59
|
if (!props)
|
|
60
|
-
throw `Parameter props undefined`;
|
|
60
|
+
throw `Parameter props undefined for ${id}`;
|
|
61
61
|
const parameter = new ssm.StringParameter(scope, `${id}`, {
|
|
62
62
|
parameterName: `${props.parameterName}-${scope.props.stage}`,
|
|
63
63
|
description: `${props.description} - ${scope.props.stage} stage`,
|
|
@@ -87,9 +87,9 @@ class SsmManager {
|
|
|
87
87
|
*/
|
|
88
88
|
readStringParameterFromRegion(id, scope, parameterName, region) {
|
|
89
89
|
if (!parameterName || parameterName == '')
|
|
90
|
-
throw
|
|
90
|
+
throw `Invalid parameter name for ${id}`;
|
|
91
91
|
if (!region || region == '')
|
|
92
|
-
throw
|
|
92
|
+
throw `Invalid region for ${id}`;
|
|
93
93
|
return new SSMParameterReader(scope, `${id}`, {
|
|
94
94
|
parameterName: parameterName,
|
|
95
95
|
region: region,
|
|
@@ -55,7 +55,7 @@ class WafManager {
|
|
|
55
55
|
*/
|
|
56
56
|
createIpSet(id, scope, props) {
|
|
57
57
|
if (!props)
|
|
58
|
-
throw `WAF Ip Set props undefined`;
|
|
58
|
+
throw `WAF Ip Set props undefined for ${id}`;
|
|
59
59
|
const ipSet = new wafv2.CfnIPSet(scope, `${id}`, {
|
|
60
60
|
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
61
61
|
description: `IP Set for ${id} - ${scope.props.stage} stage`,
|
|
@@ -75,7 +75,7 @@ class WafManager {
|
|
|
75
75
|
*/
|
|
76
76
|
createWebAcl(id, scope, props) {
|
|
77
77
|
if (!props)
|
|
78
|
-
throw `WAF WebACL props undefined`;
|
|
78
|
+
throw `WAF WebACL props undefined for ${id}`;
|
|
79
79
|
const webAcl = new wafv2.CfnWebACL(scope, `${id}`, {
|
|
80
80
|
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
81
81
|
description: `Web Acl for ${id} - ${scope.props.stage} stage`,
|
|
@@ -496,12 +496,22 @@ export interface MetricProps extends watch.MetricProps {
|
|
|
496
496
|
periodInSecs?: number;
|
|
497
497
|
functionName?: string;
|
|
498
498
|
dbClusterIdentifier?: string;
|
|
499
|
+
distributionId?: string;
|
|
500
|
+
loadBalancer?: string;
|
|
501
|
+
serviceName?: string;
|
|
502
|
+
clusterName?: string;
|
|
503
|
+
apiName?: string;
|
|
504
|
+
cacheClusterId?: string;
|
|
505
|
+
stateMachineArn?: string;
|
|
506
|
+
eventBusName?: string;
|
|
507
|
+
ruleName?: string;
|
|
499
508
|
}
|
|
500
509
|
/**
|
|
501
510
|
* @category cdk-utils.cloudwatch-manager
|
|
502
511
|
* @subcategory Properties
|
|
503
512
|
*/
|
|
504
513
|
export interface TextWidgetProps extends watch.TextWidgetProps {
|
|
514
|
+
type: string;
|
|
505
515
|
positionX: number;
|
|
506
516
|
positionY: number;
|
|
507
517
|
}
|
|
@@ -510,33 +520,47 @@ export interface TextWidgetProps extends watch.TextWidgetProps {
|
|
|
510
520
|
* @subcategory Properties
|
|
511
521
|
*/
|
|
512
522
|
export interface NumericWidgetProps extends watch.SingleValueWidgetProps {
|
|
523
|
+
type: string;
|
|
513
524
|
positionX: number;
|
|
514
525
|
positionY: number;
|
|
515
|
-
metricProps
|
|
526
|
+
metricProps: watch.MetricProps[];
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* @category cdk-utils.cloudwatch-manager
|
|
530
|
+
* @subcategory Properties
|
|
531
|
+
*/
|
|
532
|
+
export interface GuageWidgetProps extends watch.GaugeWidgetProps {
|
|
533
|
+
type: string;
|
|
534
|
+
positionX: number;
|
|
535
|
+
positionY: number;
|
|
536
|
+
metricProps: watch.MetricProps[];
|
|
516
537
|
}
|
|
517
538
|
/**
|
|
518
539
|
* @category cdk-utils.cloudwatch-manager
|
|
519
540
|
* @subcategory Properties
|
|
520
541
|
*/
|
|
521
542
|
export interface GraphWidgetProps extends watch.GraphWidgetProps {
|
|
543
|
+
type: string;
|
|
522
544
|
positionX: number;
|
|
523
545
|
positionY: number;
|
|
524
|
-
metricProps
|
|
546
|
+
metricProps: MetricProps[];
|
|
525
547
|
}
|
|
526
548
|
/**
|
|
527
549
|
* @category cdk-utils.cloudwatch-manager
|
|
528
550
|
* @subcategory Properties
|
|
529
551
|
*/
|
|
530
552
|
export interface AlarmStatusWidgetProps extends watch.AlarmStatusWidgetProps {
|
|
553
|
+
type: string;
|
|
531
554
|
positionX: number;
|
|
532
555
|
positionY: number;
|
|
533
|
-
alarmProps
|
|
556
|
+
alarmProps: watch.AlarmProps[];
|
|
534
557
|
}
|
|
535
558
|
/**
|
|
536
559
|
* @category cdk-utils.cloudwatch-manager
|
|
537
560
|
* @subcategory Properties
|
|
538
561
|
*/
|
|
539
562
|
export interface LogQueryWidgetProps extends watch.LogQueryWidgetProps {
|
|
563
|
+
type: string;
|
|
540
564
|
positionX: number;
|
|
541
565
|
positionY: number;
|
|
542
566
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@types/lodash": "^4.14.191",
|
|
51
|
-
"@types/node": "^18.11.
|
|
51
|
+
"@types/node": "^18.11.18",
|
|
52
52
|
"app-root-path": "^3.1.0",
|
|
53
|
-
"aws-cdk-lib": "^2.
|
|
54
|
-
"aws-sdk": "^2.
|
|
55
|
-
"constructs": "^10.1.
|
|
53
|
+
"aws-cdk-lib": "^2.59.0",
|
|
54
|
+
"aws-sdk": "^2.1287.0",
|
|
55
|
+
"constructs": "^10.1.209",
|
|
56
56
|
"lodash": "^4.17.21",
|
|
57
57
|
"moment": "^2.29.4",
|
|
58
58
|
"nconf": "^0.12.0",
|
|
@@ -61,21 +61,21 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
|
-
"@types/jest": "^29.2.
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
66
|
-
"@typescript-eslint/parser": "^5.
|
|
64
|
+
"@types/jest": "^29.2.5",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
66
|
+
"@typescript-eslint/parser": "^5.48.0",
|
|
67
67
|
"aws-cdk": "*",
|
|
68
68
|
"babel-eslint": "^10.1.0",
|
|
69
69
|
"better-docs": "^2.7.2",
|
|
70
70
|
"codecov": "^3.8.3",
|
|
71
71
|
"commitizen": "^4.2.6",
|
|
72
72
|
"dotenv": "^16.0.3",
|
|
73
|
-
"eslint": "^8.
|
|
74
|
-
"eslint-config-prettier": "^8.
|
|
73
|
+
"eslint": "^8.31.0",
|
|
74
|
+
"eslint-config-prettier": "^8.6.0",
|
|
75
75
|
"eslint-plugin-import": "^2.26.0",
|
|
76
|
-
"husky": "^8.0.
|
|
76
|
+
"husky": "^8.0.3",
|
|
77
77
|
"jest": "^29.3.1",
|
|
78
|
-
"jest-extended": "^3.2.
|
|
78
|
+
"jest-extended": "^3.2.1",
|
|
79
79
|
"jest-junit": "^15.0.0",
|
|
80
80
|
"jsdoc": "^4.0.0",
|
|
81
81
|
"jsdoc-babel": "^0.5.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"typescript": "4.9.4"
|
|
92
92
|
},
|
|
93
93
|
"optionalDependencies": {
|
|
94
|
-
"@babel/core": "^7.20.
|
|
94
|
+
"@babel/core": "^7.20.7",
|
|
95
95
|
"prop-types": "^15.8.1",
|
|
96
96
|
"react": "^18.2.0",
|
|
97
97
|
"react-dom": "^18.2.0"
|
|
@@ -39,6 +39,7 @@ export class ApiManager {
|
|
|
39
39
|
props: apig.LambdaRestApiProps,
|
|
40
40
|
lambdaFunction: lambda.IFunction
|
|
41
41
|
) {
|
|
42
|
+
if (!props) throw `Api props undefined for ${id}`
|
|
42
43
|
const api = new apig.LambdaRestApi(scope, `${id}`, {
|
|
43
44
|
binaryMediaTypes: props.binaryMediaTypes,
|
|
44
45
|
minimumCompressionSize: props.minimumCompressionSize,
|
|
@@ -73,7 +73,7 @@ export class AppConfigManager {
|
|
|
73
73
|
scope: common.CommonConstruct,
|
|
74
74
|
props: types.AppConfigProps
|
|
75
75
|
): appconfig.CfnApplication {
|
|
76
|
-
if (!props) throw `AppConfig props undefined`
|
|
76
|
+
if (!props) throw `AppConfig props undefined for ${id}`
|
|
77
77
|
|
|
78
78
|
const application = new appconfig.CfnApplication(scope, `${id}`, {
|
|
79
79
|
name: `${props.application.name}-${scope.props.stage}`,
|
|
@@ -101,7 +101,7 @@ export class AppConfigManager {
|
|
|
101
101
|
applicationId: string,
|
|
102
102
|
props: types.AppConfigProps
|
|
103
103
|
): appconfig.CfnEnvironment {
|
|
104
|
-
if (!props) throw `AppConfig props undefined`
|
|
104
|
+
if (!props) throw `AppConfig props undefined for ${id}`
|
|
105
105
|
|
|
106
106
|
const environment = new appconfig.CfnEnvironment(scope, `${id}`, {
|
|
107
107
|
applicationId: applicationId,
|
|
@@ -132,7 +132,7 @@ export class AppConfigManager {
|
|
|
132
132
|
applicationId: string,
|
|
133
133
|
props: types.AppConfigProps
|
|
134
134
|
): appconfig.CfnConfigurationProfile {
|
|
135
|
-
if (!props) throw `AppConfig props undefined`
|
|
135
|
+
if (!props) throw `AppConfig props undefined for ${id}`
|
|
136
136
|
|
|
137
137
|
const profile = new appconfig.CfnConfigurationProfile(scope, `${id}`, {
|
|
138
138
|
applicationId: applicationId,
|
|
@@ -70,9 +70,9 @@ export class CloudFrontManager {
|
|
|
70
70
|
certificate?: acm.ICertificate,
|
|
71
71
|
aliases?: string[]
|
|
72
72
|
) {
|
|
73
|
-
if (!siteBucket) throw `SiteBucket not defined`
|
|
74
|
-
if (!certificate) throw `Certificate not defined`
|
|
75
|
-
if (!props) throw `CloudFront props undefined`
|
|
73
|
+
if (!siteBucket) throw `SiteBucket not defined for ${id}`
|
|
74
|
+
if (!certificate) throw `Certificate not defined for ${id}`
|
|
75
|
+
if (!props) throw `CloudFront props undefined for ${id}`
|
|
76
76
|
|
|
77
77
|
const distribution = new cloudfront.CloudFrontWebDistribution(scope, `${id}`, {
|
|
78
78
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
@@ -253,7 +253,7 @@ export class CloudFrontManager {
|
|
|
253
253
|
accessPoint?: efs.IAccessPoint,
|
|
254
254
|
mountPath?: string
|
|
255
255
|
) {
|
|
256
|
-
if (!props) throw
|
|
256
|
+
if (!props) throw `EdgeFunction props undefined for ${id}`
|
|
257
257
|
|
|
258
258
|
const edgeFunction = new cloudfront.experimental.EdgeFunction(scope, `${id}`, {
|
|
259
259
|
code: code,
|
|
@@ -52,7 +52,7 @@ export class CloudTrailManager {
|
|
|
52
52
|
logBucket: s3.IBucket,
|
|
53
53
|
logBucketPolicy: s3.CfnBucketPolicy
|
|
54
54
|
) {
|
|
55
|
-
if (!props) throw `CloudTrail props undefined`
|
|
55
|
+
if (!props) throw `CloudTrail props undefined for ${id}`
|
|
56
56
|
|
|
57
57
|
const role = scope.iamManager.createRoleForCloudTrail(`${id}Role`, scope, logGroup)
|
|
58
58
|
|
|
@@ -81,9 +81,9 @@ export class CloudTrailManager {
|
|
|
81
81
|
trailName: `${props.trailName}-${scope.props.stage}`,
|
|
82
82
|
})
|
|
83
83
|
|
|
84
|
-
cloudTrail.
|
|
85
|
-
cloudTrail.
|
|
86
|
-
cloudTrail.
|
|
84
|
+
cloudTrail.addDependency(logBucketPolicy)
|
|
85
|
+
cloudTrail.addDependency(logGroup)
|
|
86
|
+
cloudTrail.addDependency(role)
|
|
87
87
|
|
|
88
88
|
utils.createCfnOutput(`${id}-trailName`, scope, cloudTrail.trailName)
|
|
89
89
|
utils.createCfnOutput(`${id}-trailArn`, scope, cloudTrail.attrArn)
|