Class CfnAlarm
- All Implemented Interfaces:
 IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::Lightsail::Alarm.
 
 The AWS::Lightsail::Alarm resource specifies an alarm that can be used to monitor a single metric for one of your Lightsail resources.
 
Example:
 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lightsail.*;
 CfnAlarm cfnAlarm = CfnAlarm.Builder.create(this, "MyCfnAlarm")
         .alarmName("alarmName")
         .comparisonOperator("comparisonOperator")
         .evaluationPeriods(123)
         .metricName("metricName")
         .monitoredResourceName("monitoredResourceName")
         .threshold(123)
         // the properties below are optional
         .contactProtocols(List.of("contactProtocols"))
         .datapointsToAlarm(123)
         .notificationEnabled(false)
         .notificationTriggers(List.of("notificationTriggers"))
         .treatMissingData("treatMissingData")
         .build();
 - 
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionThe name of the alarm.The Amazon Resource Name (ARN) of the alarm.The current state of the alarm.The arithmetic operation to use when comparing the specified statistic and threshold.The contact protocols for the alarm, such asEmail,SMS(text messaging), or both.The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARMstate.The number of periods over which data is compared to the specified threshold.The name of the metric associated with the alarm.The name of the Lightsail resource that the alarm monitors.A Boolean value indicating whether the alarm is enabled.The alarm states that trigger a notification.The value against which the specified statistic is compared.Specifies how the alarm handles missing data points.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAlarmName(String value) The name of the alarm.voidsetComparisonOperator(String value) The arithmetic operation to use when comparing the specified statistic and threshold.voidsetContactProtocols(List<String> value) The contact protocols for the alarm, such asEmail,SMS(text messaging), or both.voidsetDatapointsToAlarm(Number value) The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARMstate.voidsetEvaluationPeriods(Number value) The number of periods over which data is compared to the specified threshold.voidsetMetricName(String value) The name of the metric associated with the alarm.voidsetMonitoredResourceName(String value) The name of the Lightsail resource that the alarm monitors.voidsetNotificationEnabled(Boolean value) A Boolean value indicating whether the alarm is enabled.voidA Boolean value indicating whether the alarm is enabled.voidsetNotificationTriggers(List<String> value) The alarm states that trigger a notification.voidsetThreshold(Number value) The value against which the specified statistic is compared.voidsetTreatMissingData(String value) Specifies how the alarm handles missing data points.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson 
- 
Field Details
- 
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class. 
 - 
 - 
Constructor Details
- 
CfnAlarm
protected CfnAlarm(software.amazon.jsii.JsiiObjectRef objRef)  - 
CfnAlarm
protected CfnAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  - 
CfnAlarm
@Stability(Stable) public CfnAlarm(@NotNull Construct scope, @NotNull String id, @NotNull CfnAlarmProps props) Create a newAWS::Lightsail::Alarm.- Parameters:
 scope-- scope in which this resource is defined.
 
id-- scoped id of the resource.
 
props-- resource properties.
 
 
 - 
 - 
Method Details
- 
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
 inspectin interfaceIInspectable- Parameters:
 inspector-- tree inspector to collect and process attributes.
 
 - 
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
 renderPropertiesin classCfnResource- Parameters:
 props- This parameter is required.
 - 
getAttrAlarmArn
The Amazon Resource Name (ARN) of the alarm. - 
getAttrState
The current state of the alarm.An alarm has the following possible states:
ALARM- The metric is outside of the defined threshold.INSUFFICIENT_DATA- The alarm has recently started, the metric is not available, or not enough data is available for the metric to determine the alarm state.OK- The metric is within the defined threshold.
 - 
getCfnProperties
- Overrides:
 getCfnPropertiesin classCfnResource
 - 
getAlarmName
The name of the alarm. - 
setAlarmName
The name of the alarm. - 
getComparisonOperator
The arithmetic operation to use when comparing the specified statistic and threshold. - 
setComparisonOperator
The arithmetic operation to use when comparing the specified statistic and threshold. - 
getEvaluationPeriods
The number of periods over which data is compared to the specified threshold. - 
setEvaluationPeriods
The number of periods over which data is compared to the specified threshold. - 
getMetricName
The name of the metric associated with the alarm. - 
setMetricName
The name of the metric associated with the alarm. - 
getMonitoredResourceName
The name of the Lightsail resource that the alarm monitors. - 
setMonitoredResourceName
The name of the Lightsail resource that the alarm monitors. - 
getThreshold
The value against which the specified statistic is compared. - 
setThreshold
The value against which the specified statistic is compared. - 
getContactProtocols
The contact protocols for the alarm, such asEmail,SMS(text messaging), or both.Allowed Values :
Email|SMS - 
setContactProtocols
The contact protocols for the alarm, such asEmail,SMS(text messaging), or both.Allowed Values :
Email|SMS - 
getDatapointsToAlarm
The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARMstate. - 
setDatapointsToAlarm
The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARMstate. - 
getNotificationEnabled
A Boolean value indicating whether the alarm is enabled. - 
setNotificationEnabled
A Boolean value indicating whether the alarm is enabled. - 
setNotificationEnabled
A Boolean value indicating whether the alarm is enabled. - 
getNotificationTriggers
The alarm states that trigger a notification.To specify the
OKandINSUFFICIENT_DATAvalues, you must also specifyContactProtocolsvalues. Otherwise, theOKandINSUFFICIENT_DATAvalues will not take effect and the stack will drift.Allowed Values :
OK|ALARM|INSUFFICIENT_DATA - 
setNotificationTriggers
The alarm states that trigger a notification.To specify the
OKandINSUFFICIENT_DATAvalues, you must also specifyContactProtocolsvalues. Otherwise, theOKandINSUFFICIENT_DATAvalues will not take effect and the stack will drift.Allowed Values :
OK|ALARM|INSUFFICIENT_DATA - 
getTreatMissingData
Specifies how the alarm handles missing data points.An alarm can treat missing data in the following ways:
breaching- Assumes the missing data is not within the threshold. Missing data counts towards the number of times that the metric is not within the threshold.notBreaching- Assumes the missing data is within the threshold. Missing data does not count towards the number of times that the metric is not within the threshold.ignore- Ignores the missing data. Maintains the current alarm state.missing- Missing data is treated as missing.
 - 
setTreatMissingData
Specifies how the alarm handles missing data points.An alarm can treat missing data in the following ways:
breaching- Assumes the missing data is not within the threshold. Missing data counts towards the number of times that the metric is not within the threshold.notBreaching- Assumes the missing data is within the threshold. Missing data does not count towards the number of times that the metric is not within the threshold.ignore- Ignores the missing data. Maintains the current alarm state.missing- Missing data is treated as missing.
 
 -