AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the Amazon CloudWatch PutAlarmMuteRule API operation.

Syntax

Write-CWAlarmMuteRule
-Name <String>
-MuteTargets_AlarmName <String[]>
-Description <String>
-Rule_Schedule_Duration <String>
-ExpireDate <DateTime>
-Rule_Schedule_Expression <String>
-StartDate <DateTime>
-Tag <Tag[]>
-Rule_Schedule_Timezone <String>
-Select <String>
-Force <SwitchParameter>
-ClientConfig <AmazonCloudWatchConfig>

Description

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:*), 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.

Parameters

-ClientConfig <AmazonCloudWatchConfig>
Amazon.PowerShell.Cmdlets.CW.AmazonCloudWatchClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Description <String>
A description of the alarm mute rule that helps you identify its purpose.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ExpireDate <DateTime>
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.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MuteTargets_AlarmName <String[]>
The list of alarm names that this mute rule targets. You can specify up to 100 alarm names.Each alarm name must be between 1 and 255 characters in length. The alarm names must match existing alarms in your Amazon Web Services account and region. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesMuteTargets_AlarmNames
-Name <String>
The name of the alarm mute rule. This name must be unique within your Amazon Web Services account and region.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-Rule_Schedule_Duration <String>
The length of time that alarms remain muted when the schedule activates. The duration must be between 1 and 50 characters in length.Specify the duration using ISO 8601 duration format with a minimum of 1 minute (PT1M) and maximum of 15 days (P15D).Examples:
  • PT4H - 4 hours for weekly system maintenance
  • P2DT12H - 2 days and 12 hours for weekend muting from Friday 6:00 PM to Monday 6:00 AM
  • PT6H - 6 hours for monthly database maintenance
  • PT2H - 2 hours for nightly backup operations
  • P7D - 7 days for annual company shutdown
The duration begins when the schedule expression time is reached. For recurring schedules, the duration applies to each occurrence.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-Rule_Schedule_Expression <String>
The schedule expression that defines when the mute rule activates. The expression must be between 1 and 256 characters in length.You can use one of two expression formats:
  • Cron expressions - For recurring mute windows. Format: cron(Minutes Hours Day-of-month Month Day-of-week)Examples:
    • cron(0 2 * * *) - Activates daily at 2:00 AM
    • cron(0 2 * * SUN) - Activates every Sunday at 2:00 AM for weekly system maintenance
    • cron(0 1 1 * *) - Activates on the first day of each month at 1:00 AM for monthly database maintenance
    • cron(0 18 * * FRI) - Activates every Friday at 6:00 PM
    • cron(0 23 * * *) - Activates every day at 11:00 PM during nightly backup operations
    The characters *, -, and , are supported in all fields. English names can be used for the month (JAN-DEC) and day of week (SUN-SAT) fields.
  • At expressions - For one-time mute windows. Format: at(yyyy-MM-ddThh:mm)Examples:
    • at(2024-05-10T14:00) - Activates once on May 10, 2024 at 2:00 PM during an active incident response session
    • at(2024-12-23T00:00) - Activates once on December 23, 2024 at midnight during annual company shutdown
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-Rule_Schedule_Timezone <String>
The time zone to use when evaluating the schedule expression. The time zone must be between 1 and 50 characters in length.Specify the time zone using standard timezone identifiers (for example, America/New_York, Europe/London, or Asia/Tokyo).If you don't specify a time zone, UTC is used by default. The time zone affects how cron and at expressions are interpreted, as well as start and expire dates you specifyExamples:
  • America/New_York - Eastern Time (US)
  • America/Los_Angeles - Pacific Time (US)
  • Europe/London - British Time
  • Asia/Tokyo - Japan Standard Time
  • UTC - Coordinated Universal Time
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The cmdlet doesn't have a return value by default. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.CloudWatch.Model.PutAlarmMuteRuleResponse). Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-StartDate <DateTime>
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.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Tag[]>
A list of key-value pairs to associate with the alarm mute rule. You can use tags to categorize and manage your mute rules. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet does not generate any output.The service response (type Amazon.CloudWatch.Model.PutAlarmMuteRuleResponse) be returned by specifying '-Select *'.

Supported Version

AWS Tools for PowerShell: 2.x.y.z