Interface CreateAlarmOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
AlarmProps
All Known Implementing Classes:
AlarmProps.Jsii$Proxy, CreateAlarmOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:04.071Z") @Stability(Stable) public interface CreateAlarmOptions extends software.amazon.jsii.JsiiSerializable
Properties needed to make an alarm from a metric.

Example:

 import software.amazon.awscdk.services.cloudwatch.*;
 HostedZone myHostedZone;
 Certificate certificate = Certificate.Builder.create(this, "Certificate")
         .domainName("hello.example.com")
         .validation(CertificateValidation.fromDns(myHostedZone))
         .build();
 certificate.metricDaysToExpiry().createAlarm(this, "Alarm", CreateAlarmOptions.builder()
         .comparisonOperator(ComparisonOperator.LESS_THAN_THRESHOLD)
         .evaluationPeriods(1)
         .threshold(45)
         .build());
 
  • Method Details

    • getEvaluationPeriods

      @Stability(Stable) @NotNull Number getEvaluationPeriods()
      The number of periods over which data is compared to the specified threshold.
    • getThreshold

      @Stability(Stable) @NotNull Number getThreshold()
      The value against which the specified statistic is compared.
    • getActionsEnabled

      @Stability(Stable) @Nullable default Boolean getActionsEnabled()
      Whether the actions for this alarm are enabled.

      Default: true

    • getAlarmDescription

      @Stability(Stable) @Nullable default String getAlarmDescription()
      Description for the alarm.

      Default: No description

    • getAlarmName

      @Stability(Stable) @Nullable default String getAlarmName()
      Name of the alarm.

      Default: Automatically generated name

    • getComparisonOperator

      @Stability(Stable) @Nullable default ComparisonOperator getComparisonOperator()
      Comparison to use to check if metric is breaching.

      Default: GreaterThanOrEqualToThreshold

    • getDatapointsToAlarm

      @Stability(Stable) @Nullable default Number getDatapointsToAlarm()
      The number of datapoints that must be breaching to trigger the alarm.

      This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.

      Default: ``evaluationPeriods``

      See Also:
    • getEvaluateLowSampleCountPercentile

      @Stability(Stable) @Nullable default String getEvaluateLowSampleCountPercentile()
      Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.

      Used only for alarms that are based on percentiles.

      Default: - Not configured.

    • getTreatMissingData

      @Stability(Stable) @Nullable default TreatMissingData getTreatMissingData()
      Sets how this alarm is to handle missing data points.

      Default: TreatMissingData.Missing

    • builder

      @Stability(Stable) static CreateAlarmOptions.Builder builder()
      Returns:
      a CreateAlarmOptions.Builder of CreateAlarmOptions