/AWS1/IF_CWT=>PUTALARMMUTERULE()¶
About PutAlarmMuteRule¶
Creates or updates an alarm mute rule.
Alarm mute rules automatically mute alarm actions during predefined time windows. When a mute rule is active, targeted alarms continue to evaluate metrics and transition between states, but their configured actions (such as Amazon SNS notifications or Auto Scaling actions) are muted.
You can create mute rules with recurring schedules using cron expressions or one-time mute windows using at expressions. Each mute rule can target up to 100 specific alarms by name.
If you specify a rule name that already exists, this operation updates the existing rule with the new configuration.
Permissions
To create or update a mute rule, you must have the cloudwatch:PutAlarmMuteRule permission on two types of resources: the alarm mute rule resource itself, and each alarm that the rule targets.
For example, If you want to allow a user to create mute rules that target only specific alarms named "WebServerCPUAlarm" and "DatabaseConnectionAlarm", you would create an IAM policy with one statement granting cloudwatch:PutAlarmMuteRule on the alarm mute rule resource (arn:aws:cloudwatch:[REGION]:123456789012:alarm-mute-rule:*), and another statement granting cloudwatch:PutAlarmMuteRule on the targeted alarm resources (arn:aws:cloudwatch:[REGION]:123456789012:alarm:WebServerCPUAlarm and arn:aws:cloudwatch:[REGION]:123456789012:alarm:DatabaseConnectionAlarm).
You can also use IAM policy conditions to allow targeting alarms based on resource tags. For example, you can restrict users to create/update mute rules to only target alarms that have a specific tag key-value pair, such as Team=TeamA.
Method Signature¶
METHODS /AWS1/IF_CWT~PUTALARMMUTERULE
IMPORTING
!IV_NAME TYPE /AWS1/CWTNAME OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/CWTALARMDESCRIPTION OPTIONAL
!IO_RULE TYPE REF TO /AWS1/CL_CWTRULE OPTIONAL
!IO_MUTETARGETS TYPE REF TO /AWS1/CL_CWTMUTETARGETS OPTIONAL
!IT_TAGS TYPE /AWS1/CL_CWTTAG=>TT_TAGLIST OPTIONAL
!IV_STARTDATE TYPE /AWS1/CWTTIMESTAMP OPTIONAL
!IV_EXPIREDATE TYPE /AWS1/CWTTIMESTAMP OPTIONAL
RAISING
/AWS1/CX_CWTLIMITEXCEEDEDFAULT
/AWS1/CX_CWTCLIENTEXC
/AWS1/CX_CWTSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/CWTNAME /AWS1/CWTNAME¶
The name of the alarm mute rule. This name must be unique within your Amazon Web Services account and region.
io_rule TYPE REF TO /AWS1/CL_CWTRULE /AWS1/CL_CWTRULE¶
The configuration that defines when and how long alarms should be muted.
Optional arguments:¶
iv_description TYPE /AWS1/CWTALARMDESCRIPTION /AWS1/CWTALARMDESCRIPTION¶
A description of the alarm mute rule that helps you identify its purpose.
io_mutetargets TYPE REF TO /AWS1/CL_CWTMUTETARGETS /AWS1/CL_CWTMUTETARGETS¶
Specifies which alarms this rule applies to.
it_tags TYPE /AWS1/CL_CWTTAG=>TT_TAGLIST TT_TAGLIST¶
A list of key-value pairs to associate with the alarm mute rule. You can use tags to categorize and manage your mute rules.
iv_startdate TYPE /AWS1/CWTTIMESTAMP /AWS1/CWTTIMESTAMP¶
The date and time after which the mute rule takes effect, specified as a timestamp in ISO 8601 format (for example,
2026-04-15T08:00:00Z). If not specified, the mute rule takes effect immediately upon creation and the mutes are applied as per the schedule expression.
iv_expiredate TYPE /AWS1/CWTTIMESTAMP /AWS1/CWTTIMESTAMP¶
The date and time when the mute rule expires and is no longer evaluated, specified as a timestamp in ISO 8601 format (for example,
2026-12-31T23:59:59Z). After this time, the rule status becomes EXPIRED and will no longer mute the targeted alarms.
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
lo_client->putalarmmuterule(
io_mutetargets = new /aws1/cl_cwtmutetargets(
it_alarmnames = VALUE /aws1/cl_cwtmutetgtalrmnamel00=>tt_mutetargetalarmnamelist(
( new /aws1/cl_cwtmutetgtalrmnamel00( |string| ) )
)
)
io_rule = new /aws1/cl_cwtrule(
io_schedule = new /aws1/cl_cwtschedule(
iv_duration = |string|
iv_expression = |string|
iv_timezone = |string|
)
)
it_tags = VALUE /aws1/cl_cwttag=>tt_taglist(
(
new /aws1/cl_cwttag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_description = |string|
iv_expiredate = '20150101000000.0000000'
iv_name = |string|
iv_startdate = '20150101000000.0000000'
).