class AlarmBase
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudWatch.AlarmBase |
Java | software.amazon.awscdk.services.cloudwatch.AlarmBase |
Python | aws_cdk.aws_cloudwatch.AlarmBase |
TypeScript (source) | @aws-cdk/aws-cloudwatch » AlarmBase |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IAlarm
, IAlarm
Extends
Resource
Implemented by
Alarm
, Composite
The base class for Alarm and CompositeAlarm resources.
Initializer
new AlarmBase(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct
- id
string
- props
Resource
Props
Properties
Name | Type | Description |
---|---|---|
alarm | string | Alarm ARN (i.e. arn:aws:cloudwatch: |
alarm | string | Name of the alarm. |
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
alarm | string[] | |
insufficient | string[] | |
ok | string[] |
alarmArn
Type:
string
Alarm ARN (i.e. arn:aws:cloudwatch:
alarmName
Type:
string
Name of the alarm.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
alarmActionArns?
Type:
string[]
(optional)
insufficientDataActionArns?
Type:
string[]
(optional)
okActionArns?
Type:
string[]
(optional)
Methods
Name | Description |
---|---|
add | Trigger this action if the alarm fires. |
add | Trigger this action if there is insufficient data to evaluate the alarm. |
add | Trigger this action if the alarm returns from breaching state into ok state. |
apply | Apply the given removal policy to this resource. |
render | AlarmRule indicating ALARM state for Alarm. |
to | Returns a string representation of this construct. |
addAlarmAction(...actions)
public addAlarmAction(...actions: IAlarmAction[]): void
Parameters
- actions
IAlarm
Action
Trigger this action if the alarm fires.
Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
addInsufficientDataAction(...actions)
public addInsufficientDataAction(...actions: IAlarmAction[]): void
Parameters
- actions
IAlarm
Action
Trigger this action if there is insufficient data to evaluate the alarm.
Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
addOkAction(...actions)
public addOkAction(...actions: IAlarmAction[]): void
Parameters
- actions
IAlarm
Action
Trigger this action if the alarm returns from breaching state into ok state.
Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
renderAlarmRule()
public renderAlarmRule(): string
Returns
string
AlarmRule indicating ALARM state for Alarm.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.