Class CfnAlarm
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.lightsail.CfnAlarm
- All Implemented Interfaces:
IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:10.653Z")
@Stability(Stable)
public class CfnAlarm
extends CfnResource
implements IInspectable
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();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnAlarm
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnAlarm
(software.amazon.jsii.JsiiObjectRef objRef) CfnAlarm
(software.constructs.Construct scope, String id, CfnAlarmProps props) -
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 theALARM
state.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.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAlarmName
(String value) The name of the alarm.void
setComparisonOperator
(String value) The arithmetic operation to use when comparing the specified statistic and threshold.void
setContactProtocols
(List<String> value) The contact protocols for the alarm, such asEmail
,SMS
(text messaging), or both.void
setDatapointsToAlarm
(Number value) The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARM
state.void
setEvaluationPeriods
(Number value) The number of periods over which data is compared to the specified threshold.void
setMetricName
(String value) The name of the metric associated with the alarm.void
setMonitoredResourceName
(String value) The name of the Lightsail resource that the alarm monitors.void
setNotificationEnabled
(Boolean value) A Boolean value indicating whether the alarm is enabled.void
A Boolean value indicating whether the alarm is enabled.void
setNotificationTriggers
(List<String> value) The alarm states that trigger a notification.void
setThreshold
(Number value) The value against which the specified statistic is compared.void
setTreatMissingData
(String value) Specifies how the alarm handles missing data points.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnAlarmProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in 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:
getCfnProperties
in 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. -
setContactProtocols
The contact protocols for the alarm, such asEmail
,SMS
(text messaging), or both. -
getDatapointsToAlarm
The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARM
state. -
setDatapointsToAlarm
The number of data points within the evaluation periods that must be breaching to cause the alarm to go to theALARM
state. -
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. -
setNotificationTriggers
The alarm states that trigger a notification. -
getTreatMissingData
Specifies how the alarm handles missing data points. -
setTreatMissingData
Specifies how the alarm handles missing data points.
-