Class CfnCompositeAlarm
A CloudFormation AWS::CloudWatch::CompositeAlarm
.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.AWS.CloudWatch.dll
Syntax (csharp)
public class CfnCompositeAlarm : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnCompositeAlarm
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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.
CloudformationResource: AWS::CloudWatch::CompositeAlarm
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;
var cfnCompositeAlarm = new CfnCompositeAlarm(this, "MyCfnCompositeAlarm", new CfnCompositeAlarmProps {
AlarmRule = "alarmRule",
// the properties below are optional
ActionsEnabled = false,
ActionsSuppressor = "actionsSuppressor",
ActionsSuppressorExtensionPeriod = 123,
ActionsSuppressorWaitPeriod = 123,
AlarmActions = new [] { "alarmActions" },
AlarmDescription = "alarmDescription",
AlarmName = "alarmName",
InsufficientDataActions = new [] { "insufficientDataActions" },
OkActions = new [] { "okActions" }
});
Synopsis
Constructors
CfnCompositeAlarm(Construct, String, ICfnCompositeAlarmProps) | Create a new |
CfnCompositeAlarm(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnCompositeAlarm(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
ActionsEnabled | Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. |
ActionsSuppressor | Actions will be suppressed if the suppressor alarm is in the |
ActionsSuppressorExtensionPeriod | The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the |
ActionsSuppressorWaitPeriod | The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the |
AlarmActions | The actions to execute when this alarm transitions to the ALARM state from any other state. |
AlarmDescription | The description for the composite alarm. |
AlarmName | The name for the composite alarm. |
AlarmRule | An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. |
AttrArn | The ARN of the composite alarm, such as |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
InsufficientDataActions | The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. |
OkActions | The actions to execute when this alarm transitions to the OK state from any other state. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnCompositeAlarm(Construct, String, ICfnCompositeAlarmProps)
Create a new AWS::CloudWatch::CompositeAlarm
.
public CfnCompositeAlarm(Construct scope, string id, ICfnCompositeAlarmProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnCompositeAlarmProps
- resource properties.
CfnCompositeAlarm(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnCompositeAlarm(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnCompositeAlarm(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnCompositeAlarm(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
ActionsEnabled
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.
public virtual object ActionsEnabled { get; set; }
Property Value
System.Object
Remarks
ActionsSuppressor
Actions will be suppressed if the suppressor alarm is in the ALARM
state.
public virtual string ActionsSuppressor { get; set; }
Property Value
System.String
Remarks
ActionsSuppressor
can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.
ActionsSuppressorExtensionPeriod
The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the ALARM
state.
public virtual Nullable<double> ActionsSuppressorExtensionPeriod { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
After this time, the composite alarm performs its actions.
ExtensionPeriod
is required only when ActionsSuppressor
is specified.
ActionsSuppressorWaitPeriod
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the ALARM
state.
public virtual Nullable<double> ActionsSuppressorWaitPeriod { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
After this time, the composite alarm performs its actions.
WaitPeriod
is required only when ActionsSuppressor
is specified.
AlarmActions
The actions to execute when this alarm transitions to the ALARM state from any other state.
public virtual string[] AlarmActions { get; set; }
Property Value
System.String[]
Remarks
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 .
AlarmDescription
The description for the composite alarm.
public virtual string AlarmDescription { get; set; }
Property Value
System.String
Remarks
AlarmName
The name for the composite alarm.
public virtual string AlarmName { get; set; }
Property Value
System.String
Remarks
This name must be unique within your AWS account.
AlarmRule
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.
public virtual string AlarmRule { get; set; }
Property Value
System.String
Remarks
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 .
AttrArn
The ARN of the composite alarm, such as arn:aws:cloudwatch:us-west-2:123456789012:alarm/CompositeAlarmName
.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
InsufficientDataActions
The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.
public virtual string[] InsufficientDataActions { get; set; }
Property Value
System.String[]
Remarks
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 .
OkActions
The actions to execute when this alarm transitions to the OK state from any other state.
public virtual string[] OkActions { get; set; }
Property Value
System.String[]
Remarks
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 .
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>