Class CfnCompositeAlarm
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
AWS::CloudWatch::CompositeAlarm
type creates or updates a composite alarm.
When you create a composite alarm, you specify a rule expression for the alarm that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met.
The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms.
Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, you could create a composite alarm that goes into ALARM state only when more than one of the underlying metric alarms are in ALARM state.
When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. For a composite alarm, this initial time after creation is the only time that the alarm can be in INSUFFICIENT_DATA state.
When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.
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.cloudwatch.*; CfnCompositeAlarm cfnCompositeAlarm = CfnCompositeAlarm.Builder.create(this, "MyCfnCompositeAlarm") .alarmRule("alarmRule") // the properties below are optional .actionsEnabled(false) .actionsSuppressor("actionsSuppressor") .actionsSuppressorExtensionPeriod(123) .actionsSuppressorWaitPeriod(123) .alarmActions(List.of("alarmActions")) .alarmDescription("alarmDescription") .alarmName("alarmName") .insufficientDataActions(List.of("insufficientDataActions")) .okActions(List.of("okActions")) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .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
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnCompositeAlarm
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnCompositeAlarm
(software.amazon.jsii.JsiiObjectRef objRef) CfnCompositeAlarm
(software.constructs.Construct scope, String id, CfnCompositeAlarmProps props) -
Method Summary
Modifier and TypeMethodDescriptionIndicates whether actions should be executed during any changes to the alarm state of the composite alarm.Actions will be suppressed if the suppressor alarm is in theALARM
state.The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state.The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state.The actions to execute when this alarm transitions to the ALARM state from any other state.The description for the composite alarm.The name for the composite alarm.An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.The ARN of the composite alarm, such asarn:aws:cloudwatch:us-west-2:123456789012:alarm/CompositeAlarmName
.Tag Manager which manages the tags for this resource.The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.The actions to execute when this alarm transitions to the OK state from any other state.getTags()
A list of key-value pairs to associate with the alarm.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setActionsEnabled
(Boolean value) Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.void
setActionsEnabled
(IResolvable value) Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.void
setActionsSuppressor
(String value) Actions will be suppressed if the suppressor alarm is in theALARM
state.void
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state.void
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state.void
setAlarmActions
(List<String> value) The actions to execute when this alarm transitions to the ALARM state from any other state.void
setAlarmDescription
(String value) The description for the composite alarm.void
setAlarmName
(String value) The name for the composite alarm.void
setAlarmRule
(String value) An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.void
setInsufficientDataActions
(List<String> value) The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.void
setOkActions
(List<String> value) The actions to execute when this alarm transitions to the OK state from any other state.void
A list of key-value pairs to associate with the alarm.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
-
CfnCompositeAlarm
protected CfnCompositeAlarm(software.amazon.jsii.JsiiObjectRef objRef) -
CfnCompositeAlarm
protected CfnCompositeAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnCompositeAlarm
@Stability(Stable) public CfnCompositeAlarm(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnCompositeAlarmProps 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.
-
getAttrArn
The ARN of the composite alarm, such asarn:aws:cloudwatch:us-west-2:123456789012:alarm/CompositeAlarmName
. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getAlarmRule
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. -
setAlarmRule
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. -
getActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. -
setActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. -
setActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. -
getActionsSuppressor
Actions will be suppressed if the suppressor alarm is in theALARM
state. -
setActionsSuppressor
Actions will be suppressed if the suppressor alarm is in theALARM
state. -
getActionsSuppressorExtensionPeriod
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state. -
setActionsSuppressorExtensionPeriod
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state. -
getActionsSuppressorWaitPeriod
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state. -
setActionsSuppressorWaitPeriod
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state. -
getAlarmActions
The actions to execute when this alarm transitions to the ALARM state from any other state. -
setAlarmActions
The actions to execute when this alarm transitions to the ALARM state from any other state. -
getAlarmDescription
The description for the composite alarm. -
setAlarmDescription
The description for the composite alarm. -
getAlarmName
The name for the composite alarm. -
setAlarmName
The name for the composite alarm. -
getInsufficientDataActions
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. -
setInsufficientDataActions
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. -
getOkActions
The actions to execute when this alarm transitions to the OK state from any other state. -
setOkActions
The actions to execute when this alarm transitions to the OK state from any other state. -
getTags
A list of key-value pairs to associate with the alarm. -
setTags
A list of key-value pairs to associate with the alarm.
-