Interface PutCompositeAlarmRequest.Builder
- All Superinterfaces:
AwsRequest.Builder
,Buildable
,CloudWatchRequest.Builder
,CopyableBuilder<PutCompositeAlarmRequest.Builder,
,PutCompositeAlarmRequest> SdkBuilder<PutCompositeAlarmRequest.Builder,
,PutCompositeAlarmRequest> SdkPojo
,SdkRequest.Builder
- Enclosing class:
PutCompositeAlarmRequest
-
Method Summary
Modifier and TypeMethodDescriptionactionsEnabled
(Boolean actionsEnabled) Indicates whether actions should be executed during any changes to the alarm state of the composite alarm.actionsSuppressor
(String actionsSuppressor) Actions will be suppressed if the suppressor alarm is in theALARM
state.actionsSuppressorExtensionPeriod
(Integer actionsSuppressorExtensionPeriod) The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state.actionsSuppressorWaitPeriod
(Integer actionsSuppressorWaitPeriod) The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state.alarmActions
(String... alarmActions) The actions to execute when this alarm transitions to theALARM
state from any other state.alarmActions
(Collection<String> alarmActions) The actions to execute when this alarm transitions to theALARM
state from any other state.alarmDescription
(String alarmDescription) The description for the composite alarm.The name for the composite alarm.An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state.insufficientDataActions
(String... insufficientDataActions) The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.insufficientDataActions
(Collection<String> insufficientDataActions) The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state.The actions to execute when this alarm transitions to anOK
state from any other state.okActions
(Collection<String> okActions) The actions to execute when this alarm transitions to anOK
state from any other state.overrideConfiguration
(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Add an optional request override configuration.overrideConfiguration
(AwsRequestOverrideConfiguration overrideConfiguration) Add an optional request override configuration.tags
(Collection<Tag> tags) A list of key-value pairs to associate with the alarm.tags
(Consumer<Tag.Builder>... tags) A list of key-value pairs to associate with the alarm.A list of key-value pairs to associate with the alarm.Methods inherited from interface software.amazon.awssdk.awscore.AwsRequest.Builder
overrideConfiguration
Methods inherited from interface software.amazon.awssdk.services.cloudwatch.model.CloudWatchRequest.Builder
build
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
Method Details
-
actionsEnabled
Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is
TRUE
.- Parameters:
actionsEnabled
- Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default isTRUE
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmActions
The actions to execute when this alarm transitions to the
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
Systems Manager actions:
arn:aws:ssm:region:account-id:opsitem:severity
- Parameters:
alarmActions
- The actions to execute when this alarm transitions to theALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
Systems Manager actions:
arn:aws:ssm:region:account-id:opsitem:severity
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
alarmActions
The actions to execute when this alarm transitions to the
ALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
Systems Manager actions:
arn:aws:ssm:region:account-id:opsitem:severity
- Parameters:
alarmActions
- The actions to execute when this alarm transitions to theALARM
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
Systems Manager actions:
arn:aws:ssm:region:account-id:opsitem:severity
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
alarmDescription
The description for the composite alarm.
- Parameters:
alarmDescription
- The description for the composite alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmName
The name for the composite alarm. This name must be unique within the Region.
- Parameters:
alarmName
- The name for the composite alarm. This name must be unique within the Region.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
alarmRule
An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. 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:
-
ALARM("alarm-name or alarm-ARN")
is TRUE if the named alarm is in ALARM state. -
OK("alarm-name or alarm-ARN")
is TRUE if the named alarm is in OK state. -
INSUFFICIENT_DATA("alarm-name or alarm-ARN")
is TRUE if the named alarm is in INSUFFICIENT_DATA state. -
TRUE
always evaluates to TRUE. -
FALSE
always evaluates to FALSE.
TRUE and FALSE are useful for testing a complex
AlarmRule
structure, and for testing your alarm actions.Alarm names specified in
AlarmRule
can be surrounded with double-quotes ("), but do not have to be.The following are some examples of
AlarmRule
:-
ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)
specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state. -
ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)
specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window. -
(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)
goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.
The
AlarmRule
can specify as many as 100 "children" alarms. TheAlarmRule
expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses.- Parameters:
alarmRule
- An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. 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:
-
ALARM("alarm-name or alarm-ARN")
is TRUE if the named alarm is in ALARM state. -
OK("alarm-name or alarm-ARN")
is TRUE if the named alarm is in OK state. -
INSUFFICIENT_DATA("alarm-name or alarm-ARN")
is TRUE if the named alarm is in INSUFFICIENT_DATA state. -
TRUE
always evaluates to TRUE. -
FALSE
always evaluates to FALSE.
TRUE and FALSE are useful for testing a complex
AlarmRule
structure, and for testing your alarm actions.Alarm names specified in
AlarmRule
can be surrounded with double-quotes ("), but do not have to be.The following are some examples of
AlarmRule
:-
ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)
specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state. -
ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)
specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window. -
(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)
goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.
The
AlarmRule
can specify as many as 100 "children" alarms. TheAlarmRule
expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
insufficientDataActions
PutCompositeAlarmRequest.Builder insufficientDataActions(Collection<String> insufficientDataActions) The actions to execute when this alarm transitions to the
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
- Parameters:
insufficientDataActions
- The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
insufficientDataActions
The actions to execute when this alarm transitions to the
INSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
- Parameters:
insufficientDataActions
- The actions to execute when this alarm transitions to theINSUFFICIENT_DATA
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
okActions
The actions to execute when this alarm transitions to an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
- Parameters:
okActions
- The actions to execute when this alarm transitions to anOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
okActions
The actions to execute when this alarm transitions to an
OK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
- Parameters:
okActions
- The actions to execute when this alarm transitions to anOK
state from any other state. Each action is specified as an Amazon Resource Name (ARN).Valid Values: ]
Amazon SNS actions:
arn:aws:sns:region:account-id:sns-topic-name
Lambda actions:
-
Invoke the latest version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name
-
Invoke a specific version of a Lambda function:
arn:aws:lambda:region:account-id:function:function-name:version-number
-
Invoke a function by using an alias Lambda function:
arn:aws:lambda:region:account-id:function:function-name:alias-name
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
tags
A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the
cloudwatch:TagResource
permission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
- Parameters:
tags
- A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have thecloudwatch:TagResource
permission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
tags
A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the
cloudwatch:TagResource
permission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
- Parameters:
tags
- A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have thecloudwatch:TagResource
permission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
tags
A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the
cloudwatch:TagResource
permission.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use TagResource or UntagResource.
This is a convenience method that creates an instance of theTag.Builder
avoiding the need to create one manually viaTag.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed totags(List<Tag>)
.- Parameters:
tags
- a consumer that will call methods onTag.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
actionsSuppressor
Actions will be suppressed if the suppressor alarm is in the
ALARM
state.ActionsSuppressor
can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.- Parameters:
actionsSuppressor
- Actions will be suppressed if the suppressor alarm is in theALARM
state.ActionsSuppressor
can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
actionsSuppressorWaitPeriod
The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into the
ALARM
state. After this time, the composite alarm performs its actions.WaitPeriod
is required only whenActionsSuppressor
is specified.- Parameters:
actionsSuppressorWaitPeriod
- The maximum time in seconds that the composite alarm waits for the suppressor alarm to go into theALARM
state. After this time, the composite alarm performs its actions.WaitPeriod
is required only whenActionsSuppressor
is specified.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
actionsSuppressorExtensionPeriod
PutCompositeAlarmRequest.Builder actionsSuppressorExtensionPeriod(Integer actionsSuppressorExtensionPeriod) The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of the
ALARM
state. After this time, the composite alarm performs its actions.ExtensionPeriod
is required only whenActionsSuppressor
is specified.- Parameters:
actionsSuppressorExtensionPeriod
- The maximum time in seconds that the composite alarm waits after suppressor alarm goes out of theALARM
state. After this time, the composite alarm performs its actions.ExtensionPeriod
is required only whenActionsSuppressor
is specified.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
overrideConfiguration
PutCompositeAlarmRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) Description copied from interface:AwsRequest.Builder
Add an optional request override configuration.- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
- Parameters:
overrideConfiguration
- The override configuration.- Returns:
- This object for method chaining.
-
overrideConfiguration
PutCompositeAlarmRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) Description copied from interface:AwsRequest.Builder
Add an optional request override configuration.- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
- Parameters:
builderConsumer
- AConsumer
to which an emptyAwsRequestOverrideConfiguration.Builder
will be given.- Returns:
- This object for method chaining.
-