@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.227Z") @Stability(value=Stable) public class CfnCompositeAlarm extends CfnResource implements IInspectable
The 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.
Currently, the only alarm actions that can be taken by composite alarms are notifying SNS topics.
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")
.alarmName("alarmName")
.alarmRule("alarmRule")
// the properties below are optional
.actionsEnabled(false)
.actionsSuppressor("actionsSuppressor")
.actionsSuppressorExtensionPeriod(123)
.actionsSuppressorWaitPeriod(123)
.alarmActions(List.of("alarmActions"))
.alarmDescription("alarmDescription")
.insufficientDataActions(List.of("insufficientDataActions"))
.okActions(List.of("okActions"))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnCompositeAlarm.Builder
A fluent builder for
CfnCompositeAlarm. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnCompositeAlarm(software.constructs.Construct scope,
String id,
CfnCompositeAlarmProps props)
Create a new `AWS::CloudWatch::CompositeAlarm`.
|
protected |
CfnCompositeAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnCompositeAlarm(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getActionsEnabled()
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.
|
String |
getActionsSuppressor()
`AWS::CloudWatch::CompositeAlarm.ActionsSuppressor`.
|
Number |
getActionsSuppressorExtensionPeriod()
`AWS::CloudWatch::CompositeAlarm.ActionsSuppressorExtensionPeriod`.
|
Number |
getActionsSuppressorWaitPeriod()
`AWS::CloudWatch::CompositeAlarm.ActionsSuppressorWaitPeriod`.
|
List<String> |
getAlarmActions()
The actions to execute when this alarm transitions to the ALARM state from any other state.
|
String |
getAlarmDescription()
The description for the composite alarm.
|
String |
getAlarmName()
The name for the composite alarm.
|
String |
getAlarmRule()
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.
|
String |
getAttrArn()
The ARN of the composite alarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm/CompositeAlarmName` .
|
protected Map<String,Object> |
getCfnProperties() |
List<String> |
getInsufficientDataActions()
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
|
List<String> |
getOkActions()
The actions to execute when this alarm transitions to the OK state from any other state.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
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)
`AWS::CloudWatch::CompositeAlarm.ActionsSuppressor`.
|
void |
setActionsSuppressorExtensionPeriod(Number value)
`AWS::CloudWatch::CompositeAlarm.ActionsSuppressorExtensionPeriod`.
|
void |
setActionsSuppressorWaitPeriod(Number value)
`AWS::CloudWatch::CompositeAlarm.ActionsSuppressorWaitPeriod`.
|
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.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnCompositeAlarm(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnCompositeAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnCompositeAlarm(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnCompositeAlarmProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getAlarmName()
This name must be unique within your AWS account.
@Stability(value=Stable)
public void setAlarmName(@NotNull
String value)
This name must be unique within your AWS account.
@Stability(value=Stable) @NotNull public String getAlarmRule()
For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.
You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.
Functions can include the following:
TRUE and FALSE are useful for testing a complex AlarmRule structure, and for testing your alarm actions.
For more information about AlarmRule syntax, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable)
public void setAlarmRule(@NotNull
String value)
For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.
You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.
Functions can include the following:
TRUE and FALSE are useful for testing a complex AlarmRule structure, and for testing your alarm actions.
For more information about AlarmRule syntax, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable) @Nullable public Object getActionsEnabled()
The default is TRUE.
@Stability(value=Stable)
public void setActionsEnabled(@Nullable
Boolean value)
The default is TRUE.
@Stability(value=Stable)
public void setActionsEnabled(@Nullable
IResolvable value)
The default is TRUE.
@Stability(value=Stable) @Nullable public String getActionsSuppressor()
@Stability(value=Stable)
public void setActionsSuppressor(@Nullable
String value)
@Stability(value=Stable) @Nullable public Number getActionsSuppressorExtensionPeriod()
@Stability(value=Stable)
public void setActionsSuppressorExtensionPeriod(@Nullable
Number value)
@Stability(value=Stable) @Nullable public Number getActionsSuppressorWaitPeriod()
@Stability(value=Stable)
public void setActionsSuppressorWaitPeriod(@Nullable
Number value)
@Stability(value=Stable) @Nullable public List<String> getAlarmActions()
Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable)
public void setAlarmActions(@Nullable
List<String> value)
Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable) @Nullable public String getAlarmDescription()
@Stability(value=Stable)
public void setAlarmDescription(@Nullable
String value)
@Stability(value=Stable) @Nullable public List<String> getInsufficientDataActions()
Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable)
public void setInsufficientDataActions(@Nullable
List<String> value)
Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable) @Nullable public List<String> getOkActions()
Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
@Stability(value=Stable)
public void setOkActions(@Nullable
List<String> value)
Each action is specified as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutCompositeAlarm in the Amazon CloudWatch API Reference .
Copyright © 2022. All rights reserved.