Amazon EC2 Instance Retirement Scheduled Event Status

Amazon.AmazonWebServices.UnitMonitor.InstanceRetirementScheduledEventState (UnitMonitor)

It is a monitor for EC2 Instance Retirement Scheduled Event Status

Knowledge Base article:

Summary

Monitor is in Error state when an instance-retirement event is scheduled or occurs.

Retirement commonly occurs when the underlying host is degraded and must be replaced. Retirement events include a scheduled start and end time. You will also be notified by email if one of your instances is set to retiring. The email message indicates when your instance will be permanently retired.

Causes

This monitor depends on EC2 Instance status check.

Resolutions

Investigate reason why EC2 Instance failed to pass status check in Amazon Console

Element properties:

TargetAmazon.AmazonWebServices.AmazonInstanceHealth
Parent MonitorAmazon.AmazonWebServices.Aggregate.AmazonInstanceHealthScheduledEventsAggregate
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveFalse
Monitor TypeAmazon.AmazonWebServices.MonitorType.AmazonInstanceScheduledEventErrorStateType
RemotableTrue
AccessibilityPublic
Alert Message
Amazon EC2 Instance Retirement Scheduled Event Status Alert
The EC2 Instance '{0}' is scheduled for retirement between {2} and {3}. Event description: {1}
RunAsDefault

Source Code:

<UnitMonitor ID="Amazon.AmazonWebServices.UnitMonitor.InstanceRetirementScheduledEventState" Target="Amazon.AmazonWebServices.AmazonInstanceHealth" ParentMonitorID="Amazon.AmazonWebServices.Aggregate.AmazonInstanceHealthScheduledEventsAggregate" TypeID="Amazon.AmazonWebServices.MonitorType.AmazonInstanceScheduledEventErrorStateType" Remotable="true" Priority="Normal" ConfirmDelivery="false" Accessibility="Public" Enabled="true">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Amazon.AmazonWebServices.UnitMonitor.InstanceRetirementScheduledEventState.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>false</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="System!System.Entity"]/DisplayName$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name="Description"]$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name="NotBefore"]$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='NotAfter']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<WorkFlowName>InstanceRetirementScheduledEventState</WorkFlowName>
<StartTimeInSeconds>290</StartTimeInSeconds>
<IntervalTimeInSeconds>900</IntervalTimeInSeconds>
<InstanceId>$Target/Property[Type='Amazon.AmazonWebServices.AmazonInstanceHealth']/InstanceId$</InstanceId>
<RegionName>$Target/Property[Type='Amazon.AmazonWebServices.Component']/RegionName$</RegionName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='InstanceId']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Property[Type='Amazon.AmazonWebServices.AmazonInstanceHealth']/InstanceId$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='EventType']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">instance-retirement</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Configuration>
</UnitMonitor>