@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.
Files changed (46) hide show
  1. package/dist/src/lib/manager/aws/acm-manager.js +1 -1
  2. package/dist/src/lib/manager/aws/api-manager.js +2 -0
  3. package/dist/src/lib/manager/aws/app-config-manager.js +3 -3
  4. package/dist/src/lib/manager/aws/cloudfront-manager.js +4 -4
  5. package/dist/src/lib/manager/aws/cloudtrail-manager.js +4 -4
  6. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +83 -1
  7. package/dist/src/lib/manager/aws/cloudwatch-manager.js +293 -7
  8. package/dist/src/lib/manager/aws/dynamodb-manager.js +1 -1
  9. package/dist/src/lib/manager/aws/ecs-manager.js +4 -4
  10. package/dist/src/lib/manager/aws/eks-manager.js +1 -1
  11. package/dist/src/lib/manager/aws/elasticache-manager.js +5 -6
  12. package/dist/src/lib/manager/aws/event-manager.js +4 -4
  13. package/dist/src/lib/manager/aws/kms-manager.js +1 -1
  14. package/dist/src/lib/manager/aws/log-manager.js +3 -3
  15. package/dist/src/lib/manager/aws/route53-manager.js +5 -5
  16. package/dist/src/lib/manager/aws/s3-manager.js +1 -1
  17. package/dist/src/lib/manager/aws/sfn-manager.js +11 -11
  18. package/dist/src/lib/manager/aws/sns-manager.js +2 -2
  19. package/dist/src/lib/manager/aws/sqs-manager.js +1 -1
  20. package/dist/src/lib/manager/aws/ssm-manager.js +3 -3
  21. package/dist/src/lib/manager/aws/vpc-manager.js +1 -1
  22. package/dist/src/lib/manager/aws/waf-manager.js +2 -2
  23. package/dist/src/lib/types/aws/index.d.ts +27 -3
  24. package/package.json +13 -13
  25. package/src/lib/manager/aws/acm-manager.ts +1 -1
  26. package/src/lib/manager/aws/api-manager.ts +1 -0
  27. package/src/lib/manager/aws/app-config-manager.ts +3 -3
  28. package/src/lib/manager/aws/cloudfront-manager.ts +4 -4
  29. package/src/lib/manager/aws/cloudtrail-manager.ts +4 -4
  30. package/src/lib/manager/aws/cloudwatch-manager.ts +312 -7
  31. package/src/lib/manager/aws/dynamodb-manager.ts +1 -1
  32. package/src/lib/manager/aws/ecs-manager.ts +4 -4
  33. package/src/lib/manager/aws/eks-manager.ts +1 -1
  34. package/src/lib/manager/aws/elasticache-manager.ts +5 -7
  35. package/src/lib/manager/aws/event-manager.ts +4 -4
  36. package/src/lib/manager/aws/kms-manager.ts +1 -1
  37. package/src/lib/manager/aws/log-manager.ts +3 -3
  38. package/src/lib/manager/aws/route53-manager.ts +5 -5
  39. package/src/lib/manager/aws/s3-manager.ts +1 -1
  40. package/src/lib/manager/aws/sfn-manager.ts +11 -11
  41. package/src/lib/manager/aws/sns-manager.ts +2 -2
  42. package/src/lib/manager/aws/sqs-manager.ts +1 -1
  43. package/src/lib/manager/aws/ssm-manager.ts +3 -3
  44. package/src/lib/manager/aws/vpc-manager.ts +1 -1
  45. package/src/lib/manager/aws/waf-manager.ts +2 -2
  46. package/src/lib/types/aws/index.ts +28 -3
@@ -39,7 +39,7 @@ export class SfnManager {
39
39
  * @param {types.SfnSucceedProps} props
40
40
  */
41
41
  public createSuccessStep(id: string, scope: common.CommonConstruct, props: types.SfnSucceedProps) {
42
- if (!props) throw 'Step props undefined'
42
+ if (!props) throw `Step props undefined for ${id}`
43
43
  return new sfn.Succeed(scope, `${props.name}`, {
44
44
  ...props,
45
45
  ...{
@@ -55,7 +55,7 @@ export class SfnManager {
55
55
  * @param {types.SfnFailProps} props
56
56
  */
57
57
  public createFailStep(id: string, scope: common.CommonConstruct, props: types.SfnFailProps) {
58
- if (!props) throw 'Step props undefined'
58
+ if (!props) throw `Step props undefined for ${id}`
59
59
  return new sfn.Fail(scope, `${props.name}`, {
60
60
  ...props,
61
61
  ...{
@@ -71,7 +71,7 @@ export class SfnManager {
71
71
  * @param {types.SfnPassProps} props
72
72
  */
73
73
  public createPassStep(id: string, scope: common.CommonConstruct, props: types.SfnPassProps) {
74
- if (!props) throw 'Step props undefined'
74
+ if (!props) throw `Step props undefined for ${id}`
75
75
  return new sfn.Pass(scope, `${props.name}`, {
76
76
  ...props,
77
77
  ...{
@@ -87,7 +87,7 @@ export class SfnManager {
87
87
  * @param {types.SfnParallelProps} props
88
88
  */
89
89
  public createParallelStep(id: string, scope: common.CommonConstruct, props: types.SfnParallelProps) {
90
- if (!props) throw 'Step props undefined'
90
+ if (!props) throw `Step props undefined for ${id}`
91
91
  return new sfn.Parallel(scope, `${props.name}`, {
92
92
  ...props,
93
93
  ...{
@@ -103,7 +103,7 @@ export class SfnManager {
103
103
  * @param {types.SfnChoiceProps} props
104
104
  */
105
105
  public createChoiceStep(id: string, scope: common.CommonConstruct, props: types.SfnChoiceProps) {
106
- if (!props) throw 'Step props undefined'
106
+ if (!props) throw `Step props undefined for ${id}`
107
107
  return new sfn.Choice(scope, `${props.name}`, {
108
108
  ...props,
109
109
  ...{
@@ -143,7 +143,7 @@ export class SfnManager {
143
143
  table: dynamodb.ITable,
144
144
  tableKey: { [key: string]: tasks.DynamoAttributeValue }
145
145
  ) {
146
- if (!props) throw 'Step props undefined'
146
+ if (!props) throw `Step props undefined for ${id}`
147
147
  return new tasks.DynamoGetItem(scope, `${props.name}`, {
148
148
  ...props,
149
149
  ...{
@@ -180,7 +180,7 @@ export class SfnManager {
180
180
  table: dynamodb.ITable,
181
181
  tableItem: { [key: string]: tasks.DynamoAttributeValue }
182
182
  ) {
183
- if (!props) throw 'Step props undefined'
183
+ if (!props) throw `Step props undefined for ${id}`
184
184
  return new tasks.DynamoPutItem(scope, `${props.name}`, {
185
185
  ...props,
186
186
  ...{
@@ -217,7 +217,7 @@ export class SfnManager {
217
217
  props: types.SfnSqsSendMessageProps,
218
218
  queue: sqs.IQueue
219
219
  ) {
220
- if (!props) throw 'Step props undefined'
220
+ if (!props) throw `Step props undefined for ${id}`
221
221
  if (!props.messageBody) throw 'Message body undefined'
222
222
  return new tasks.SqsSendMessage(scope, `${props.name}`, {
223
223
  ...props,
@@ -252,7 +252,7 @@ export class SfnManager {
252
252
  props: types.SfnLambdaInvokeProps,
253
253
  lambdaFunction: lambda.IFunction
254
254
  ) {
255
- if (!props) throw 'Step props undefined'
255
+ if (!props) throw `Step props undefined for ${id}`
256
256
  return new tasks.LambdaInvoke(scope, `${props.name}`, {
257
257
  ...props,
258
258
  ...{
@@ -275,7 +275,7 @@ export class SfnManager {
275
275
  props: types.SfnCallApiGatewayRestApiEndpointProps,
276
276
  api: apig.IRestApi
277
277
  ) {
278
- if (!props) throw 'Step props undefined'
278
+ if (!props) throw `Step props undefined for ${id}`
279
279
  return new tasks.CallApiGatewayRestApiEndpoint(scope, `${props.name}`, {
280
280
  ...props,
281
281
  ...{
@@ -303,7 +303,7 @@ export class SfnManager {
303
303
  logGroup: logs.ILogGroup,
304
304
  role?: iam.IRole
305
305
  ) {
306
- if (!props) throw 'State Machine props undefined'
306
+ if (!props) throw `State Machine props undefined for ${id}`
307
307
  const stateMachine = new sfn.StateMachine(scope, `${id}`, {
308
308
  stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
309
309
  definition,
@@ -39,7 +39,7 @@ export class SnsManager {
39
39
  props: types.SubscriptionProps,
40
40
  emails: string[]
41
41
  ) {
42
- if (!props) throw `Subscription props undefined`
42
+ if (!props) throw `Subscription props undefined for ${id}`
43
43
 
44
44
  const topic = new sns.Topic(scope, id, {
45
45
  displayName: `${props.topicName}-${scope.props.stage}`,
@@ -70,7 +70,7 @@ export class SnsManager {
70
70
  props: types.SubscriptionProps,
71
71
  lambdaFunction: lambda.IFunction
72
72
  ) {
73
- if (!props) throw `Subscription props undefined`
73
+ if (!props) throw `Subscription props undefined for ${id}`
74
74
 
75
75
  const topic = new sns.Topic(scope, id, {
76
76
  displayName: `${props.topicName}-${scope.props.stage}`,
@@ -33,7 +33,7 @@ export class SqsManager {
33
33
  * @param {sqs.IQueue} deadLetterQueue
34
34
  */
35
35
  public createQueue(id: string, scope: common.CommonConstruct, props: types.QueueProps, deadLetterQueue?: sqs.IQueue) {
36
- if (!props) throw `Queue props undefined`
36
+ if (!props) throw `Queue props undefined for ${id}`
37
37
 
38
38
  const queue = new sqs.Queue(scope, id, {
39
39
  queueName: props.queueName,
@@ -33,7 +33,7 @@ export class SsmManager {
33
33
  * @param {ssm.StringParameterProps} props parameter props
34
34
  */
35
35
  public writeStringToParameters(id: string, scope: common.CommonConstruct, props: ssm.StringParameterProps) {
36
- if (!props) throw `Parameter props undefined`
36
+ if (!props) throw `Parameter props undefined for ${id}`
37
37
 
38
38
  const parameter = new ssm.StringParameter(scope, `${id}`, {
39
39
  parameterName: `${props.parameterName}-${scope.props.stage}`,
@@ -72,8 +72,8 @@ export class SsmManager {
72
72
  parameterName: string,
73
73
  region: string
74
74
  ) {
75
- if (!parameterName || parameterName == '') throw 'Invalid parameter name'
76
- if (!region || region == '') throw 'Invalid region'
75
+ if (!parameterName || parameterName == '') throw `Invalid parameter name for ${id}`
76
+ if (!region || region == '') throw `Invalid region for ${id}`
77
77
 
78
78
  return new SSMParameterReader(scope, `${id}`, {
79
79
  parameterName: parameterName,
@@ -37,7 +37,7 @@ export class VpcManager {
37
37
  * @param {ec2.VpcProps} props
38
38
  */
39
39
  public createVpc(id: string, scope: common.CommonConstruct, props: ec2.VpcProps) {
40
- if (!props) throw 'Vpc props undefined'
40
+ if (!props) throw `Vpc props undefined for ${id}`
41
41
  const vpc = new ec2.Vpc(scope, `${id}`, {
42
42
  maxAzs: props.maxAzs,
43
43
  ipAddresses: props.ipAddresses,
@@ -31,7 +31,7 @@ export class WafManager {
31
31
  * @param {types.WafIPSetProps} props
32
32
  */
33
33
  public createIpSet(id: string, scope: common.CommonConstruct, props: types.WafIPSetProps) {
34
- if (!props) throw `WAF Ip Set props undefined`
34
+ if (!props) throw `WAF Ip Set props undefined for ${id}`
35
35
 
36
36
  const ipSet = new wafv2.CfnIPSet(scope, `${id}`, {
37
37
  name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
@@ -54,7 +54,7 @@ export class WafManager {
54
54
  * @param {types.WafWebACLProps} props
55
55
  */
56
56
  public createWebAcl(id: string, scope: common.CommonConstruct, props: types.WafWebACLProps) {
57
- if (!props) throw `WAF WebACL props undefined`
57
+ if (!props) throw `WAF WebACL props undefined for ${id}`
58
58
 
59
59
  const webAcl = new wafv2.CfnWebACL(scope, `${id}`, {
60
60
  name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
@@ -523,6 +523,15 @@ export interface MetricProps extends watch.MetricProps {
523
523
  periodInSecs?: number
524
524
  functionName?: string
525
525
  dbClusterIdentifier?: string
526
+ distributionId?: string
527
+ loadBalancer?: string
528
+ serviceName?: string
529
+ clusterName?: string
530
+ apiName?: string
531
+ cacheClusterId?: string
532
+ stateMachineArn?: string
533
+ eventBusName?: string
534
+ ruleName?: string
526
535
  }
527
536
 
528
537
  /**
@@ -530,6 +539,7 @@ export interface MetricProps extends watch.MetricProps {
530
539
  * @subcategory Properties
531
540
  */
532
541
  export interface TextWidgetProps extends watch.TextWidgetProps {
542
+ type: string
533
543
  positionX: number
534
544
  positionY: number
535
545
  }
@@ -539,9 +549,21 @@ export interface TextWidgetProps extends watch.TextWidgetProps {
539
549
  * @subcategory Properties
540
550
  */
541
551
  export interface NumericWidgetProps extends watch.SingleValueWidgetProps {
552
+ type: string
553
+ positionX: number
554
+ positionY: number
555
+ metricProps: watch.MetricProps[]
556
+ }
557
+
558
+ /**
559
+ * @category cdk-utils.cloudwatch-manager
560
+ * @subcategory Properties
561
+ */
562
+ export interface GuageWidgetProps extends watch.GaugeWidgetProps {
563
+ type: string
542
564
  positionX: number
543
565
  positionY: number
544
- metricProps?: watch.MetricProps[]
566
+ metricProps: watch.MetricProps[]
545
567
  }
546
568
 
547
569
  /**
@@ -549,9 +571,10 @@ export interface NumericWidgetProps extends watch.SingleValueWidgetProps {
549
571
  * @subcategory Properties
550
572
  */
551
573
  export interface GraphWidgetProps extends watch.GraphWidgetProps {
574
+ type: string
552
575
  positionX: number
553
576
  positionY: number
554
- metricProps?: MetricProps[]
577
+ metricProps: MetricProps[]
555
578
  }
556
579
 
557
580
  /**
@@ -559,9 +582,10 @@ export interface GraphWidgetProps extends watch.GraphWidgetProps {
559
582
  * @subcategory Properties
560
583
  */
561
584
  export interface AlarmStatusWidgetProps extends watch.AlarmStatusWidgetProps {
585
+ type: string
562
586
  positionX: number
563
587
  positionY: number
564
- alarmProps?: watch.AlarmProps[]
588
+ alarmProps: watch.AlarmProps[]
565
589
  }
566
590
 
567
591
  /**
@@ -569,6 +593,7 @@ export interface AlarmStatusWidgetProps extends watch.AlarmStatusWidgetProps {
569
593
  * @subcategory Properties
570
594
  */
571
595
  export interface LogQueryWidgetProps extends watch.LogQueryWidgetProps {
596
+ type: string
572
597
  positionX: number
573
598
  positionY: number
574
599
  }