AlarmMuteRule
- class aws_cdk.aws_cloudwatch.AlarmMuteRule(scope, id, *, alarms=None, duration, schedule, alarm_mute_rule_name=None, description=None, expire=None, start=None, tags=None)
Bases:
ResourceA CloudWatch Alarm Mute Rule.
- ExampleMetadata:
infused
Example:
# alarm1: cloudwatch.Alarm # alarm2: cloudwatch.Alarm alarm_mute_rule = cloudwatch.AlarmMuteRule(self, "AlarmMuteRule", alarms=[alarm1], # Defines the mute period begins at 0:00 everyday in UTC schedule=cloudwatch.ScheduleExpression.cron(minute="0", hour="0"), # Specifies the mute rule lasts 1 hour. duration=Duration.hours(1) ) # The mute target can be added after construction. alarm_mute_rule.add_alarm(alarm2)
- Parameters:
scope (
Construct)id (
str)alarms (
Optional[Sequence[IAlarmRef]]) – The list of alarms that this mute rule targets. You can specify up to 100 alarms. Default: - no target alarmsduration (
Duration) – The length of time that alarms remain muted when the schedule activates. Minimum: 1 minute, Maximum: 15 daysschedule (
ScheduleExpression) – The schedule defines when alarms should be muted.alarm_mute_rule_name (
Optional[str]) – The name of the alarm mute rule. This name must be unique within your AWS account and region. Default: - generated by CloudFormationdescription (
Optional[str]) – A description of the alarm mute rule that helps you identify its purpose. Default: - no descriptionexpire (
Union[CalendarDateTime,Dict[str,Any],None]) – The date and time when the mute rule expires and is no longer evaluated. After this time, the rule status becomes EXPIRED and will no longer mute the targeted alarms. This date and time is interpreted according to the schedule timezone, or UTC if no timezone is specified. Default: - no configurationstart (
Union[CalendarDateTime,Dict[str,Any],None]) – The date and time after which the mute rule takes effect. If not specified, the mute rule takes effect immediately upon creation and the mutes are applied as per the schedule expression. This date and time is interpreted according to the schedule timezone, or UTC if no timezone is specified. Default: - no configurationtags (
Optional[Mapping[str,str]]) – A list of tags associated with the alarm mute rule. Tags help you organize and categorize your AWS resources. Default: - No tags are applied
Methods
- add_alarm(alarm)
Add a CloudWatch alarm to mute rule target alarms.
- Parameters:
alarm (
IAlarmRef)- Return type:
None
- apply_cross_stack_reference_strength(strength)
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferencescontext key. This is useful for selectively weakening specific references to avoid the “deadly embrace” problem without changing the app-wide default.- Parameters:
strength (
ReferenceStrength) –The reference strength to use for this resource.
- Return type:
None
- apply_removal_policy(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).- Parameters:
policy (
RemovalPolicy)- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- with_(*mixins)
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple
with()calls if subsequent mixins should apply to added constructs.- Parameters:
mixins (
IMixin)- Return type:
Attributes
- PROPERTY_INJECTION_ID = 'aws-cdk-lib.aws-cloudwatch.AlarmMuteRule'
- alarm_mute_rule_arn
ARN of this alarm mute rule.
- Attribute:
true
- alarm_mute_rule_name
Name of this alarm mute rule.
- Attribute:
true
- alarm_mute_rule_ref
A reference to a AlarmMuteRule resource.
- env
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by creating new class instances like
new Role(),new Bucket(), etc.), this is always the same as the environment of the stack they belong to.For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(),Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.
- node
The tree node.
- stack
The stack in which this resource is defined.
Static Methods
- classmethod from_alarm_mute_rule_arn(scope, id, alarm_mute_rule_arn)
Import an existing CloudWatch alarm mute rule provided an ARN.
- Parameters:
scope (
Construct) – The parent creating construct (usuallythis).id (
str) – The construct’s name.alarm_mute_rule_arn (
str) – Alarm Mute Rule ARN.
- Return type:
- classmethod from_alarm_mute_rule_name(scope, id, alarm_mute_rule_name)
Import an existing CloudWatch alarm mute rule provided an Name.
- Parameters:
scope (
Construct) – The parent creating construct (usuallythis).id (
str) – The construct’s name.alarm_mute_rule_name (
str) – Alarm Mute Rule Name.
- Return type:
- classmethod is_construct(x)
Checks if
xis a construct.Use this method instead of
instanceofto properly detectConstructinstances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the classConstructin each copy of theconstructslibrary is seen as a different class, and an instance of one class will not test asinstanceofthe other class.npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructslibrary can be accidentally installed, andinstanceofwill behave unpredictably. It is safest to avoid usinginstanceof, and using this type-testing method instead.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsConstruct.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct)- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct)- Return type:
bool