diff --git a/cf-macro/index.ts b/cf-macro/index.ts index 0417a62d..50582a69 100644 --- a/cf-macro/index.ts +++ b/cf-macro/index.ts @@ -3,7 +3,7 @@ import _ from 'lodash' import Ajv from 'ajv' -import alarms from '../core/alarms/alarms' +import alarms from 'slic-watch-core/alarms/alarms' import dashboard from 'slic-watch-core/dashboards/dashboard' import CloudFormationTemplate from 'slic-watch-core/cf-template' import defaultConfig from 'slic-watch-core/inputs/default-config' diff --git a/core/alarms/alb-target-group.ts b/core/alarms/alb-target-group.ts index 8c656d17..e939f534 100644 --- a/core/alarms/alb-target-group.ts +++ b/core/alarms/alb-target-group.ts @@ -16,8 +16,8 @@ export type AlbTargetAlarmProperties = AlarmProperties & { } export type AlbTargetAlarm = AlarmProperties & { - targetGroupResourceName: string - loadBalancerLogicalId: string + TargetGroupResourceName: string + LoadBalancerLogicalId: string } /** @@ -38,12 +38,9 @@ export function findLoadBalancersForTargetGroup (targetGroupLogicalId: string, c // First, find Listeners with _default actions_ referencing the target group for (const listener of Object.values(listenerResources)) { - // @ts-ignore for (const action of listener.Properties.DefaultActions || []) { const targetGroupArn = action?.TargetGroupArn - // @ts-ignore if (targetGroupArn?.Ref === targetGroupLogicalId) { - // @ts-ignore const loadBalancerLogicalId = listener.Properties.LoadBalancerArn?.Ref if (loadBalancerLogicalId) { allLoadBalancerLogicalIds.add(loadBalancerLogicalId) @@ -57,10 +54,8 @@ export function findLoadBalancersForTargetGroup (targetGroupLogicalId: string, c // Second, find ListenerRules with actions referncing the target group, then follow to the rules' listeners for (const [listenerRuleLogicalId, listenerRule ] of Object.entries(listenerRuleResources)) { - // @ts-ignore for (const action of listenerRule.Properties.Actions || []) { const targetGroupArn = action.TargetGroupArn - // @ts-ignore if (targetGroupArn.Ref === targetGroupLogicalId) { allListenerRules[listenerRuleLogicalId] = listenerRule break @@ -159,8 +154,8 @@ export default function ALBTargetAlarms (albTargetAlarmProperties: AlbTargetAlar const albTargetAlarmProperties: AlbTargetAlarm = { AlarmName: `LoadBalancerHTTPCodeTarget5XXCountAlarm_${targetGroupResourceName}`, AlarmDescription: `LoadBalancer HTTP Code Target 5XX Count ${getStatisticName(config)} for ${targetGroupResourceName} breaches ${threshold}`, - targetGroupResourceName, - loadBalancerLogicalId, + TargetGroupResourceName: targetGroupResourceName, + LoadBalancerLogicalId:loadBalancerLogicalId, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'HTTPCode_Target_5XX_Count', @@ -186,8 +181,8 @@ export default function ALBTargetAlarms (albTargetAlarmProperties: AlbTargetAlar const albTargetAlarmProperties: AlbTargetAlarm = { AlarmName: `LoadBalancerUnHealthyHostCountAlarm_${targetGroupResourceName}`, AlarmDescription: `LoadBalancer UnHealthy Host Count ${getStatisticName(config)} for ${targetGroupResourceName} breaches ${threshold}`, - targetGroupResourceName, - loadBalancerLogicalId, + TargetGroupResourceName: targetGroupResourceName, + LoadBalancerLogicalId:loadBalancerLogicalId, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'UnHealthyHostCount', @@ -213,8 +208,8 @@ export default function ALBTargetAlarms (albTargetAlarmProperties: AlbTargetAlar const albTargetAlarmProperties: AlbTargetAlarm = { AlarmName: `LoadBalancerLambdaInternalErrorAlarm_${targetGroupResourceName}`, AlarmDescription: `LoadBalancer Lambda Internal Error ${getStatisticName(config)} for ${targetGroupResourceName} breaches ${threshold}`, - targetGroupResourceName, - loadBalancerLogicalId, + TargetGroupResourceName: targetGroupResourceName, + LoadBalancerLogicalId:loadBalancerLogicalId, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'LambdaInternalError', @@ -240,8 +235,8 @@ export default function ALBTargetAlarms (albTargetAlarmProperties: AlbTargetAlar const albTargetAlarmProperties: AlbTargetAlarm = { AlarmName: `LoadBalancerLambdaUserErrorAlarm_${targetGroupResourceName}`, AlarmDescription: `LoadBalancer Lambda User Error ${getStatisticName(config)} for ${targetGroupResourceName} breaches ${threshold}`, - targetGroupResourceName, - loadBalancerLogicalId, + TargetGroupResourceName: targetGroupResourceName, + LoadBalancerLogicalId:loadBalancerLogicalId, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'LambdaUserError', diff --git a/core/alarms/alb.ts b/core/alarms/alb.ts index afed4d40..af440f38 100644 --- a/core/alarms/alb.ts +++ b/core/alarms/alb.ts @@ -13,7 +13,7 @@ export type AlbAlarmProperties = AlarmProperties & { } export type AlbAlarm = AlarmProperties & { - loadBalancerResourceName: string + LoadBalancerResourceName: string } @@ -62,7 +62,7 @@ export default function ALBAlarms (albAlarmProperties: AlbAlarmProperties, conte const albAlarmProperties:AlbAlarm = { AlarmName:`LoadBalancerHTTPCodeELB5XXCountAlarm_${loadBalancerResourceName}` , AlarmDescription: `LoadBalancer HTTP Code ELB 5XX Count ${getStatisticName(config)} for ${loadBalancerResourceName} breaches ${threshold}`, - loadBalancerResourceName, + LoadBalancerResourceName: loadBalancerResourceName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'HTTPCode_ELB_5XX_Count', @@ -87,7 +87,7 @@ export default function ALBAlarms (albAlarmProperties: AlbAlarmProperties, conte const albAlarmProperties: AlbAlarm = { AlarmName:`LoadBalancerRejectedConnectionCountAlarm_${loadBalancerResourceName}` , AlarmDescription: `LoadBalancer Rejected Connection Count ${getStatisticName(config)} for ${loadBalancerResourceName} breaches ${threshold}`, - loadBalancerResourceName, + LoadBalancerResourceName: loadBalancerResourceName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'RejectedConnectionCount', diff --git a/core/alarms/api-gateway.ts b/core/alarms/api-gateway.ts index 052b90b9..93c44311 100644 --- a/core/alarms/api-gateway.ts +++ b/core/alarms/api-gateway.ts @@ -14,7 +14,7 @@ export type ApiGwAlarmProperties = AlarmProperties &{ } export type ApiAlarm= AlarmProperties & { - apiName: string + ApiName: string } /** @@ -126,7 +126,7 @@ export default function ApiGatewayAlarms (apiGwAlarmProperties: ApiGwAlarmProper const apiAlarmProperties:ApiAlarm = { AlarmName: `APIGW_5XXError_${apiNameForSub}` , AlarmDescription: `API Gateway 5XXError ${getStatisticName(config)} for ${apiNameForSub} breaches ${threshold}`, - apiName, + ApiName: apiName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: '5XXError', @@ -151,7 +151,7 @@ export default function ApiGatewayAlarms (apiGwAlarmProperties: ApiGwAlarmProper const apiAlarmProperties:ApiAlarm = { AlarmName: `APIGW_4XXError_${apiNameForSub}` , AlarmDescription: `API Gateway 4XXError ${getStatisticName(config)} for ${apiNameForSub} breaches ${threshold}`, - apiName, + ApiName: apiName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: '4XXError', @@ -176,7 +176,7 @@ export default function ApiGatewayAlarms (apiGwAlarmProperties: ApiGwAlarmProper const apiAlarmProperties:ApiAlarm = { AlarmName: `APIGW_Latency_${apiNameForSub}` , AlarmDescription: `API Gateway Latency ${getStatisticName(config)} for ${apiNameForSub} breaches ${threshold}`, - apiName, + ApiName: apiName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'Latency', diff --git a/core/alarms/appsync.ts b/core/alarms/appsync.ts index 8033afdd..9fbe5a03 100644 --- a/core/alarms/appsync.ts +++ b/core/alarms/appsync.ts @@ -14,7 +14,7 @@ export type AppSyncAlarmProperties = AlarmProperties & { } export type AppSyncAlarm= AlarmProperties & { - appSyncResourceName: string + AppSyncResourceName: string } /** @@ -65,7 +65,7 @@ export default function appSyncAlarms (appSyncAlarmProperties: AppSyncAlarmPrope const appSyncAlarmProperties:AppSyncAlarm = { AlarmName:`AppSync5XXErrorAlarm_${graphQLName}` , AlarmDescription: `AppSync 5XX Error ${getStatisticName(config)} for ${graphQLName} breaches ${threshold}`, - appSyncResourceName, + AppSyncResourceName:appSyncResourceName , ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: '5XXError', @@ -80,7 +80,6 @@ export default function appSyncAlarms (appSyncAlarmProperties: AppSyncAlarmPrope ] } return { - // @ts-ignore resourceName: makeResourceName('AppSync', graphQLName, '5XXError'), resource: createAlarm(appSyncAlarmProperties, context) } @@ -92,7 +91,7 @@ export default function appSyncAlarms (appSyncAlarmProperties: AppSyncAlarmPrope const appSyncAlarmProperties:AppSyncAlarm = { AlarmName:`AppSyncLatencyAlarm_${graphQLName}` , AlarmDescription: `AppSync Latency ${getStatisticName(config)} for ${graphQLName} breaches ${threshold}`, - appSyncResourceName, + AppSyncResourceName: appSyncResourceName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'Latency', @@ -107,7 +106,6 @@ export default function appSyncAlarms (appSyncAlarmProperties: AppSyncAlarmPrope ] } return { - // @ts-ignore resourceName: makeResourceName('AppSync', graphQLName, 'Latency'), resource: createAlarm(appSyncAlarmProperties, context) } diff --git a/core/alarms/ecs.ts b/core/alarms/ecs.ts index d285485a..7ee3ba91 100644 --- a/core/alarms/ecs.ts +++ b/core/alarms/ecs.ts @@ -11,8 +11,8 @@ export type EcsAlarmsConfig = AlarmProperties & { } export type EcsAlarm = AlarmProperties & { - serviceName, - clusterName: string + ServiceName: string, + ClusterName: string } /** @@ -85,8 +85,8 @@ export default function ecsAlarms (ecsAlarmsConfig: EcsAlarmsConfig, context: Co const ecsAlarmProperties: EcsAlarm = { AlarmName: `ECS_MemoryAlarm_\${${logicalId}.Name}`, AlarmDescription: `ECS memory utilization for ${logicalId}.Name breaches ${threshold}`, - serviceName: { 'Fn::GetAtt': [logicalId, 'Name'] }, - clusterName, + ServiceName: `\${${logicalId}.Name}`, + ClusterName:clusterName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'MemoryUtilization', @@ -112,8 +112,8 @@ export default function ecsAlarms (ecsAlarmsConfig: EcsAlarmsConfig, context: Co const ecsAlarmProperties: EcsAlarm = { AlarmName: `ECS_CPUAlarm_\${${logicalId}.Name}`, AlarmDescription: `ECS CPU utilization for ${logicalId}.Name breaches ${threshold}`, - serviceName: { 'Fn::GetAtt': [logicalId, 'Name'] }, - clusterName, + ServiceName: `\${${logicalId}.Name}`, + ClusterName: clusterName, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'CPUUtilization', diff --git a/core/alarms/eventbridge.ts b/core/alarms/eventbridge.ts index adfe4c34..befc3396 100644 --- a/core/alarms/eventbridge.ts +++ b/core/alarms/eventbridge.ts @@ -11,7 +11,7 @@ export type EventsAlarmsConfig = AlarmProperties &{ } export type EventbridgeAlarm = AlarmProperties & { - ruleName: object + RuleName: string } /** @@ -59,7 +59,7 @@ export default function eventsAlarms (eventsAlarmsConfig: EventsAlarmsConfig, co const eventbridgeAlarmProperties:EventbridgeAlarm = { AlarmName: `Events_FailedInvocationsAlarm_\${${logicalId}}` , AlarmDescription: `EventBridge Failed Invocations for \${${logicalId}} breaches ${threshold}`, - ruleName: { Ref: logicalId }, + RuleName: logicalId , ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'FailedInvocations', @@ -82,7 +82,7 @@ export default function eventsAlarms (eventsAlarmsConfig: EventsAlarmsConfig, co const eventbridgeAlarmProperties:EventbridgeAlarm = { AlarmName: `Events_ThrottledRulesAlarm_\${${logicalId}}`, AlarmDescription: `EventBridge Throttled Rules for \${${logicalId}} breaches ${threshold}`, - ruleName: { Ref: logicalId }, + RuleName: logicalId, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'ThrottledRules', diff --git a/core/alarms/lambda.ts b/core/alarms/lambda.ts index 029439de..2b93c55d 100644 --- a/core/alarms/lambda.ts +++ b/core/alarms/lambda.ts @@ -16,7 +16,7 @@ export type LambdaFunctionAlarmPropertiess = AlarmProperties & { } export type LambdaAlarm = AlarmProperties & { - funcName: object + FuncName: string } /** * functionAlarmPropertiess The cascaded Lambda alarm configuration with @@ -123,7 +123,7 @@ export default function LambdaAlarms (functionAlarmPropertiess: FunctionAlarmPro const lambdaAlarmProperties: LambdaAlarm = { AlarmName: `Lambda_IteratorAge_\${${funcLogicalId}}`, AlarmDescription: `Iterator Age for ${funcLogicalId} breaches ${threshold}`, - funcName: { Ref: funcLogicalId }, + FuncName: funcLogicalId, ComparisonOperator: config.ComparisonOperator, Threshold: threshold, Metrics: null, @@ -147,7 +147,7 @@ export default function LambdaAlarms (functionAlarmPropertiess: FunctionAlarmPro const lambdaAlarmProperties: LambdaAlarm = { AlarmName: `Lambda_Errors_\${${funcLogicalId}}`, AlarmDescription: `Error count for \${${funcLogicalId}} breaches ${threshold}`, - funcName: { Ref: funcLogicalId }, + FuncName: `\${${funcLogicalId}}`, ComparisonOperator: config.ComparisonOperator, Threshold: threshold, Metrics: null, @@ -207,7 +207,7 @@ export default function LambdaAlarms (functionAlarmPropertiess: FunctionAlarmPro const lambdaAlarmProperties: LambdaAlarm = { AlarmName: `Lambda_Throttles_\${${funcLogicalId}}` , AlarmDescription: `Throttles % for \${${funcLogicalId}} breaches ${threshold}`, - funcName: { Ref: funcLogicalId }, + FuncName: `\${${funcLogicalId}}`, ComparisonOperator: config.ComparisonOperator, Threshold: threshold, Metrics: metrics, @@ -227,7 +227,7 @@ export default function LambdaAlarms (functionAlarmPropertiess: FunctionAlarmPro const lambdaAlarmProperties: LambdaAlarm = { AlarmName: `Lambda_Duration_\${${funcLogicalId}}`, AlarmDescription: `Max duration for \${${funcLogicalId}} breaches ${threshold}% of timeout (${funcTimeout})`, - funcName: { Ref: funcLogicalId }, + FuncName: funcLogicalId, ComparisonOperator: config.ComparisonOperator, // @ts-ignore Threshold: (threshold * funcTimeout * 1000) / 100, @@ -252,7 +252,7 @@ export default function LambdaAlarms (functionAlarmPropertiess: FunctionAlarmPro const lambdaAlarmProperties: LambdaAlarm = { AlarmName: `Lambda_Invocations_\${${funcLogicalId}}`, AlarmDescription: `Total invocations for \${${funcLogicalId}} breaches ${threshold}`, - funcName: { Ref: funcLogicalId }, + FuncName: `\${${funcLogicalId}}`, ComparisonOperator: config.ComparisonOperator, Threshold: threshold, Metrics: null, diff --git a/core/alarms/sns.ts b/core/alarms/sns.ts index 584ba545..9b57db1e 100644 --- a/core/alarms/sns.ts +++ b/core/alarms/sns.ts @@ -11,7 +11,7 @@ export type SnsAlarmsConfig = AlarmProperties & { } export type SnsAlarm= AlarmProperties & { - topicName: string + TopicName: string } /** @@ -59,7 +59,7 @@ export default function snsAlarms (snsAlarmsConfig: SnsAlarmsConfig, context: Co const snsAlarmProperties: SnsAlarm = { AlarmName: `SNS_NumberOfNotificationsFilteredOutInvalidAttributesAlarm_\${${topicLogicalId}.TopicName}`, AlarmDescription: `Number of SNS Notifications Filtered out Invalid Attributes for \${${topicLogicalId}.TopicName} breaches (${threshold}`, - topicName: `\${${topicLogicalId}.TopicName}`, + TopicName: `\${${topicLogicalId}.TopicName}`, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'NumberOfNotificationsFilteredOut-InvalidAttributes', @@ -82,7 +82,7 @@ export default function snsAlarms (snsAlarmsConfig: SnsAlarmsConfig, context: Co const snsAlarmProperties: SnsAlarm = { AlarmName: `SNS_NumberOfNotificationsFailedAlarm_\${${topicLogicalId}.TopicName}`, AlarmDescription: `Number of Notifications failed for \${${topicLogicalId}.TopicName} breaches (${threshold}`, - topicName: `\${${topicLogicalId}.TopicName}`, + TopicName: `\${${topicLogicalId}.TopicName}`, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'NumberOfNotificationsFailed', diff --git a/core/alarms/sqs.ts b/core/alarms/sqs.ts index 283cf769..29c8d1a3 100644 --- a/core/alarms/sqs.ts +++ b/core/alarms/sqs.ts @@ -11,7 +11,7 @@ export type SqsAlarmsConfig = AlarmProperties& { } export type SqsAlarm= AlarmProperties & { - queueName: object + QueueName: string } /** @@ -74,7 +74,7 @@ export default function sqsAlarms (sqsAlarmsConfig: SqsAlarmsConfig, context: Co const sqsAlarmProperties: SqsAlarm = { AlarmName: `SQS_ApproximateNumberOfMessagesNotVisible_\${${logicalId}.QueueName}`, AlarmDescription: `SQS in-flight messages for \${${logicalId}.QueueName} breaches ${thresholdValue} (${threshold}% of the hard limit of ${hardLimit})`, - queueName: { 'Fn::GetAtt': [logicalId, 'QueueName'] }, + QueueName: `\${${logicalId}.QueueName}`, ComparisonOperator: config.ComparisonOperator, Threshold: thresholdValue, MetricName: 'ApproximateNumberOfMessagesNotVisible', @@ -97,7 +97,7 @@ export default function sqsAlarms (sqsAlarmsConfig: SqsAlarmsConfig, context: Co const sqsAlarmProperties: SqsAlarm = { AlarmName: `SQS_ApproximateAgeOfOldestMessage_\${${logicalId}.QueueName}`, AlarmDescription: `SQS age of oldest message in the queue \${${logicalId}.QueueName} breaches ${threshold}`, - queueName: { 'Fn::GetAtt': [logicalId, 'QueueName'] }, + QueueName: `\${${logicalId}.QueueName}`, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: 'ApproximateAgeOfOldestMessage', diff --git a/core/alarms/step-functions.ts b/core/alarms/step-functions.ts index 4bf1b731..c1faa877 100644 --- a/core/alarms/step-functions.ts +++ b/core/alarms/step-functions.ts @@ -10,7 +10,7 @@ export type SfAlarmsConfig = AlarmProperties& { } export type SmAlarm= AlarmProperties & { - stateMachineArn: object + StateMachineArn: string } /** @@ -45,7 +45,7 @@ export default function StatesAlarms (sfAlarmProperties: SfAlarmsConfig, context const smAlarmProperties: SmAlarm = { AlarmName: `StepFunctions_${metric}_\${${logicalId}.Name}` , AlarmDescription: `StepFunctions_${metric} ${config.Statistic} for \${${logicalId}.Name} breaches ${config.Threshold}`, - stateMachineArn: { Ref: logicalId }, + StateMachineArn: `\${${logicalId}}`, ComparisonOperator: config.ComparisonOperator, Threshold: config.Threshold, MetricName: metric, diff --git a/core/dashboards/default-config-dashboard.ts b/core/dashboards/default-config-dashboard.ts index cfd73517..14cbcb90 100644 --- a/core/dashboards/default-config-dashboard.ts +++ b/core/dashboards/default-config-dashboard.ts @@ -9,7 +9,7 @@ export type DashboardConfig = { widgets?: Widgets } -export type DashProperties = { +export type DashboardBodyProperties = { ActionsEnabled?: boolean metricPeriod?: number width?: number @@ -19,93 +19,93 @@ export type DashProperties = { } export type ServiceDashConfig = { - DashProperties?: DashProperties + DashboardBodyProperties?: DashboardBodyProperties widgets?: Widgets } -export type LambdaDashProperties = { - Errors: DashProperties - Throttles: DashProperties - Duration: DashProperties - Invocations: DashProperties - ConcurrentExecutions: DashProperties - IteratorAge: DashProperties +export type LambdaDashboardBodyProperties = { + Errors: DashboardBodyProperties + Throttles: DashboardBodyProperties + Duration: DashboardBodyProperties + Invocations: DashboardBodyProperties + ConcurrentExecutions: DashboardBodyProperties + IteratorAge: DashboardBodyProperties } -export type ApiGwDashProperties = { - '5XXError': DashProperties - '4XXError': DashProperties - Latency: DashProperties - Count: DashProperties +export type ApiGwDashboardBodyProperties = { + '5XXError': DashboardBodyProperties + '4XXError': DashboardBodyProperties + Latency: DashboardBodyProperties + Count: DashboardBodyProperties } -export type SfDashProperties = { - ExecutionsFailed: DashProperties - ExecutionThrottled: DashProperties - ExecutionsTimedOut: DashProperties +export type SfDashboardBodyProperties = { + ExecutionsFailed: DashboardBodyProperties + ExecutionThrottled: DashboardBodyProperties + ExecutionsTimedOut: DashboardBodyProperties } -export type DynamoDbDashProperties = { - ReadThrottleEvents: DashProperties - WriteThrottleEvents: DashProperties +export type DynamoDbDashboardBodyProperties = { + ReadThrottleEvents: DashboardBodyProperties + WriteThrottleEvents: DashboardBodyProperties } -export type KinesisDashProperties = { - 'GetRecords.IteratorAgeMilliseconds': DashProperties - ReadProvisionedThroughputExceeded: DashProperties - WriteProvisionedThroughputExceeded: DashProperties - 'PutRecord.Success': DashProperties - 'PutRecords.Success': DashProperties - 'GetRecords.Success': DashProperties +export type KinesisDashboardBodyProperties = { + 'GetRecords.IteratorAgeMilliseconds': DashboardBodyProperties + ReadProvisionedThroughputExceeded: DashboardBodyProperties + WriteProvisionedThroughputExceeded: DashboardBodyProperties + 'PutRecord.Success': DashboardBodyProperties + 'PutRecords.Success': DashboardBodyProperties + 'GetRecords.Success': DashboardBodyProperties } -export type SqsDashProperties = { - NumberOfMessagesSent: DashProperties - NumberOfMessagesReceived: DashProperties - NumberOfMessagesDeleted: DashProperties - ApproximateAgeOfOldestMessage: DashProperties - ApproximateNumberOfMessagesVisible: DashProperties +export type SqsDashboardBodyProperties = { + NumberOfMessagesSent: DashboardBodyProperties + NumberOfMessagesReceived: DashboardBodyProperties + NumberOfMessagesDeleted: DashboardBodyProperties + ApproximateAgeOfOldestMessage: DashboardBodyProperties + ApproximateNumberOfMessagesVisible: DashboardBodyProperties } -export type EcsDashProperties = { +export type EcsDashboardBodyProperties = { ActionsEnabled?: boolean - MemoryUtilization: DashProperties - CPUUtilization: DashProperties + MemoryUtilization: DashboardBodyProperties + CPUUtilization: DashboardBodyProperties } -export type SnsDashProperties = { - 'NumberOfNotificationsFilteredOut-InvalidAttributes': DashProperties - NumberOfNotificationsFailed: DashProperties +export type SnsDashboardBodyProperties = { + 'NumberOfNotificationsFilteredOut-InvalidAttributes': DashboardBodyProperties + NumberOfNotificationsFailed: DashboardBodyProperties } -export type RuleDashProperties = { - FailedInvocations: DashProperties - ThrottledRules: DashProperties - Invocations: DashProperties +export type RuleDashboardBodyProperties = { + FailedInvocations: DashboardBodyProperties + ThrottledRules: DashboardBodyProperties + Invocations: DashboardBodyProperties } -export type AlbDashProperties = { - HTTPCode_ELB_5XX_Count: DashProperties - RejectedConnectionCount: DashProperties +export type AlbDashboardBodyProperties = { + HTTPCode_ELB_5XX_Count: DashboardBodyProperties + RejectedConnectionCount: DashboardBodyProperties } -export type AlbTargetDashProperties = { - HTTPCode_Target_5XX_Count: DashProperties - UnHealthyHostCount: DashProperties - LambdaInternalError: DashProperties - LambdaUserError: DashProperties +export type AlbTargetDashboardBodyProperties = { + HTTPCode_Target_5XX_Count: DashboardBodyProperties + UnHealthyHostCount: DashboardBodyProperties + LambdaInternalError: DashboardBodyProperties + LambdaUserError: DashboardBodyProperties } -export type AppSyncDashProperties = { - '5XXError': DashProperties - '4XXError': DashProperties - Latency: DashProperties - Requests: DashProperties - ConnectServerError: DashProperties - DisconnectServerError: DashProperties - SubscribeServerError: DashProperties - UnsubscribeServerError: DashProperties - PublishDataMessageServerError: DashProperties +export type AppSyncDashboardBodyProperties = { + '5XXError': DashboardBodyProperties + '4XXError': DashboardBodyProperties + Latency: DashboardBodyProperties + Requests: DashboardBodyProperties + ConnectServerError: DashboardBodyProperties + DisconnectServerError: DashboardBodyProperties + SubscribeServerError: DashboardBodyProperties + UnsubscribeServerError: DashboardBodyProperties + PublishDataMessageServerError: DashboardBodyProperties } export type FunctionDashboardConfigs = { diff --git a/core/inputs/cascading-config.ts b/core/inputs/cascading-config.ts index 3d645ab8..061f4cda 100644 --- a/core/inputs/cascading-config.ts +++ b/core/inputs/cascading-config.ts @@ -12,8 +12,8 @@ import { SnsAlarmsConfig } from '../alarms/sns' import { SqsAlarmsConfig } from '../alarms/sqs' import { SfAlarmsConfig } from '../alarms/step-functions' import { AllAlarmsConfig } from '../alarms/default-config-alarms' -import { DashboardConfig, DashProperties, LambdaDashProperties, ApiGwDashProperties, SfDashProperties, DynamoDbDashProperties, KinesisDashProperties, SqsDashProperties, - EcsDashProperties, SnsDashProperties, RuleDashProperties, AlbDashProperties, AlbTargetDashProperties, AppSyncDashProperties } from '../dashboards/default-config-dashboard' +import { DashboardConfig, DashboardBodyProperties, LambdaDashboardBodyProperties, ApiGwDashboardBodyProperties, SfDashboardBodyProperties, DynamoDbDashboardBodyProperties, KinesisDashboardBodyProperties, SqsDashboardBodyProperties, + EcsDashboardBodyProperties, SnsDashboardBodyProperties, RuleDashboardBodyProperties, AlbDashboardBodyProperties, AlbTargetDashboardBodyProperties, AppSyncDashboardBodyProperties } from '../dashboards/default-config-dashboard' import { LambdaFunctionAlarmPropertiess } from '../alarms/lambda' import { Statistic } from '../cf-template' import { AlarmProperties} from "cloudform-types/types/cloudWatch/alarm" @@ -24,7 +24,7 @@ const MAX_DEPTH = 10 type ConfigNode = DashboardConfig | AllAlarmsConfig type ParentNode ={ - DashProperties?: DashProperties + DashboardBodyProperties?: DashboardBodyProperties AlarmProperties?: AlarmProperties } @@ -41,18 +41,18 @@ export type DashboardsCascade ={ export type Widgets = { ActionsEnabled?:boolean // remove later ? mark Statistic?: Statistic[] - Lambda?: LambdaDashProperties - ApiGateway?: ApiGwDashProperties - States?: SfDashProperties, - DynamoDB?: DynamoDbDashProperties - Kinesis?: KinesisDashProperties - SQS?: SqsDashProperties - ECS?: EcsDashProperties - SNS?: SnsDashProperties - Events?: RuleDashProperties - ApplicationELB?: AlbDashProperties - ApplicationELBTarget?: AlbTargetDashProperties - AppSync?: AppSyncDashProperties + Lambda?: LambdaDashboardBodyProperties + ApiGateway?: ApiGwDashboardBodyProperties + States?: SfDashboardBodyProperties, + DynamoDB?: DynamoDbDashboardBodyProperties + Kinesis?: KinesisDashboardBodyProperties + SQS?: SqsDashboardBodyProperties + ECS?: EcsDashboardBodyProperties + SNS?: SnsDashboardBodyProperties + Events?: RuleDashboardBodyProperties + ApplicationELB?: AlbDashboardBodyProperties + ApplicationELBTarget?: AlbTargetDashboardBodyProperties + AppSync?: AppSyncDashboardBodyProperties } export type AlarmsCascade = { diff --git a/serverless-plugin/.gitignore b/serverless-plugin/.gitignore index 00360bba..64f9313a 100644 --- a/serverless-plugin/.gitignore +++ b/serverless-plugin/.gitignore @@ -1,3 +1,4 @@ README.md +dist/