Fugue.AWS.CloudWatch.Alarm

Module Members

new

(Function)

new CloudWatch Alarm (Constructor)

Call this constructor to create a new Fugue.Core.AWS.CloudWatch.Alarm value.

Example:

composition

import Fugue.AWS as AWS
import Fugue.AWS.CloudWatch as CloudWatch
import Fugue.AWS.SNS as SNS

alerts: SNS.Topic.new {
  name: "my-alerts",
  region: AWS.Us-west-2,
}

sendAlert: CloudWatch.Action.notifyTopic(alerts)

alarm: CloudWatch.Alarm.new {
  name: "example-alarm",
  description: "1 minute WriteThrottleEvents > 0 for some-table",
  okActions: [sendAlert],
  alarmActions: [sendAlert],
  insufficientDataActions: [sendAlert],
  namespace: CloudWatch.Namespace.dynamodb,
  metricName: "WriteThrottleEvents",
  dimensions: {
    "TableName": "some-table",
  },
  period: 60,
  evaluationPeriods: 1,
  threshold: 0.0,
  statistic: CloudWatch.Sum,
  comparisonOperator: CloudWatch.GreaterThanThreshold,
  region: AWS.Us-west-2,
}

Type Signature

 fun { name: String,
       description: Optional<String>,
       actionsEnabled: Optional<Bool>,
       okActions: Optional<List<Action>>,
       alarmActions: Optional<List<Action>>,
       insufficientDataActions: Optional<List<Action>>,
       metricName: String,
       namespace: String,
       statistic: Statistic,
       dimensions: Optional<Dictionary<String>>,
       period: Int,
       unit: Optional<StandardUnit>,
       evaluationPeriods: Int,
       threshold: Float,
       comparisonOperator: ComparisonOperator,
       region: Region} -> Alarm
Argument: name

The name of the alarm. Must be between 1 and 255 characters in length.

Type: String

Argument: description

An optional description of the alarm. Must be between 1 and 255 characters in length.

Type: Optional<String>

Argument: actionsEnabled
Type: Optional<Bool>
Argument: okActions

List of 1 to 5 actions to take when the alarm enters the “OK” state.

Type: Optional<List<Action>>

Argument: alarmActions

List of 1 to 5 actions to take when the alarm enters the “ALARM” state.

Type: Optional<List<Action>>

Argument: insufficientDataActions

List of 1 to 5 actions to take when the alarm enters the “INSUFFICIENT DATA” state.

Type: Optional<List<Action>>

Argument: metricName

The name of the metric to monitor. Must be between 1 and 255 characters in length.

Type: String

Argument: namespace

The namespace containing the targeted metric. Must be between 1 and 255 characters in length. See Fugue.AWS.CloudWatch.Namespace for predefined AWS namespaces.

Type: String

Argument: statistic

The metric statistic to monitor.

Type: Statistic

Argument: dimensions

Dictionary mapping dimension names to values. Up to 10 dimensions may be specified.

Type: Optional<Dictionary<String>>

Argument: period

The number of seconds over which the statistic is applied. Must be greater than or equal to 60.

Type: Int

Argument: unit

The unit applied to the statistic. The unit must be supported by the target metric. See the AWS docs for specific units supported by each metric.

Type: Optional<StandardUnit>

Argument: evaluationPeriods

The number of periods that the metric data is compared to the threshold.

Type: Int

Argument: threshold

The threshold value to compare the metric data to.

Type: Float

Argument: comparisonOperator

The operator to use when comparing metric data to the threshold.

Type: ComparisonOperator

Argument: region

The region to create the alarm in.

Type: Region

Returns:
Type: Alarm

requiredStrLenValidator

(Function)

Type Signature

 fun { field: String,
       min: Int,
       max: Int} -> fun (String) -> Validation
Argument: field
Type: String
Argument: min
Type: Int
Argument: max
Type: Int
Returns:
Type: fun ( String) -> Validation

toDimensions

(Function)

Type Signature

 fun (Dictionary<String>) -> List<Dimension>
Argument: dimensions
Type: Dictionary<String>
Returns:
Type: List<Dimension>

validateAlarmActions

(Function)

validateDescription

(Function)

validateDimensions

(Function)

validateEvaluationPeriods

(Function)

validateInsufficientDataActions

(Function)

validateMetricName

(Function)

validateName

(Function)

validateNamespace

(Function)

validateOkActions

(Function)

validatePeriod

(Function)

Type Signature

 fun (Int) -> Validation
Argument: period
Type: Int
Returns:
Type: Validation