Class CfnCompositeAlarm
- All Implemented Interfaces:
IInspectable,ICompositeAlarmRef,IEnvironmentAware,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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.cloudwatch.ICompositeAlarmRef
ICompositeAlarmRef.Jsii$Default, ICompositeAlarmRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnCompositeAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnCompositeAlarm(software.amazon.jsii.JsiiObjectRef objRef) CfnCompositeAlarm(software.constructs.Construct scope, String id, CfnCompositeAlarmProps props) Create a newAWS::CloudWatch::CompositeAlarm. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForCompositeAlarm(ICompositeAlarmRef resource) Indicates 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 theALARMstate.The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARMstate.The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARMstate.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.A reference to a CompositeAlarm 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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnCompositeAlarm.renderProperties(Map<String, Object> props) voidsetActionsEnabled(Boolean value) Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.voidsetActionsEnabled(IResolvable value) Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.voidsetActionsSuppressor(String value) Actions will be suppressed if the suppressor alarm is in theALARMstate.voidThe maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARMstate.voidThe maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARMstate.voidsetAlarmActions(List<String> value) The actions to execute when this alarm transitions to the ALARM state from any other state.voidsetAlarmDescription(String value) The description for the composite alarm.voidsetAlarmName(String value) The name for the composite alarm.voidsetAlarmRule(String value) An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.voidsetInsufficientDataActions(List<String> value) The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.voidsetOkActions(List<String> value) The actions to execute when this alarm transitions to the OK state from any other state.voidA 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, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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) Create a newAWS::CloudWatch::CompositeAlarm.- 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
-
arnForCompositeAlarm
@Stability(Stable) @NotNull public static String arnForCompositeAlarm(@NotNull ICompositeAlarmRef resource) - Parameters:
resource- This parameter is required.
-
isCfnCompositeAlarm
Checks whether the given object is a CfnCompositeAlarm.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin 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:
renderPropertiesin 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:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getCompositeAlarmRef
A reference to a CompositeAlarm resource.- Specified by:
getCompositeAlarmRefin interfaceICompositeAlarmRef
-
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.Returns union: either
BooleanorIResolvable -
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 theALARMstate. -
setActionsSuppressor
Actions will be suppressed if the suppressor alarm is in theALARMstate. -
getActionsSuppressorExtensionPeriod
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARMstate. -
setActionsSuppressorExtensionPeriod
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARMstate. -
getActionsSuppressorWaitPeriod
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARMstate. -
setActionsSuppressorWaitPeriod
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARMstate. -
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.
-