libZSservicesZSamazonka-cloudwatchZSamazonka-cloudwatch
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.CloudWatch.SetAlarmState

Description

Temporarily sets the state of an alarm for testing purposes. When the updated state differs from the previous value, the action configured for the appropriate state is invoked. For example, if your alarm is configured to send an Amazon SNS message when an alarm is triggered, temporarily changing the alarm state to ALARM sends an SNS message.

Metric alarms returns to their actual state quickly, often within seconds. Because the metric alarm state change happens quickly, it is typically only visible in the alarm's History tab in the Amazon CloudWatch console or through DescribeAlarmHistory.

If you use SetAlarmState on a composite alarm, the composite alarm is not guaranteed to return to its actual state. It returns to its actual state only once any of its children alarms change state. It is also reevaluated if you update its configuration.

If an alarm triggers EC2 Auto Scaling policies or application Auto Scaling policies, you must include information in the StateReasonData parameter to enable the policy to take the correct action.

Synopsis

Creating a Request

data SetAlarmState Source #

See: newSetAlarmState smart constructor.

Constructors

SetAlarmState' 

Fields

  • stateReasonData :: Maybe Text

    The reason that this alarm is set to this specific state, in JSON format.

    For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.

  • alarmName :: Text

    The name of the alarm.

  • stateValue :: StateValue

    The value of the state.

  • stateReason :: Text

    The reason that this alarm is set to this specific state, in text format.

Instances

Instances details
Eq SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Read SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Show SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Generic SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Associated Types

type Rep SetAlarmState :: Type -> Type #

NFData SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Methods

rnf :: SetAlarmState -> () #

Hashable SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

AWSRequest SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Associated Types

type AWSResponse SetAlarmState #

ToHeaders SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

ToPath SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

ToQuery SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

type Rep SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

type Rep SetAlarmState = D1 ('MetaData "SetAlarmState" "Amazonka.CloudWatch.SetAlarmState" "libZSservicesZSamazonka-cloudwatchZSamazonka-cloudwatch" 'False) (C1 ('MetaCons "SetAlarmState'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "stateReasonData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "alarmName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "stateValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 StateValue) :*: S1 ('MetaSel ('Just "stateReason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse SetAlarmState Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

newSetAlarmState Source #

Create a value of SetAlarmState with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:stateReasonData:SetAlarmState', setAlarmState_stateReasonData - The reason that this alarm is set to this specific state, in JSON format.

For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.

$sel:alarmName:SetAlarmState', setAlarmState_alarmName - The name of the alarm.

$sel:stateValue:SetAlarmState', setAlarmState_stateValue - The value of the state.

$sel:stateReason:SetAlarmState', setAlarmState_stateReason - The reason that this alarm is set to this specific state, in text format.

Request Lenses

setAlarmState_stateReasonData :: Lens' SetAlarmState (Maybe Text) Source #

The reason that this alarm is set to this specific state, in JSON format.

For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.

setAlarmState_stateReason :: Lens' SetAlarmState Text Source #

The reason that this alarm is set to this specific state, in text format.

Destructuring the Response

data SetAlarmStateResponse Source #

See: newSetAlarmStateResponse smart constructor.

Instances

Instances details
Eq SetAlarmStateResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Read SetAlarmStateResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Show SetAlarmStateResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Generic SetAlarmStateResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Associated Types

type Rep SetAlarmStateResponse :: Type -> Type #

NFData SetAlarmStateResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

Methods

rnf :: SetAlarmStateResponse -> () #

type Rep SetAlarmStateResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.SetAlarmState

type Rep SetAlarmStateResponse = D1 ('MetaData "SetAlarmStateResponse" "Amazonka.CloudWatch.SetAlarmState" "libZSservicesZSamazonka-cloudwatchZSamazonka-cloudwatch" 'False) (C1 ('MetaCons "SetAlarmStateResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newSetAlarmStateResponse :: SetAlarmStateResponse Source #

Create a value of SetAlarmStateResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.