EC2

ENTERPRISE: Built-in integrations are available for Sensu Enterprise users only.

Overview

Deregister Sensu clients from the client registry, if they no longer have an associated Amazon Web Services (AWS) EC2 instance in the allowed state(s). This enterprise handler (integration) will only work if Sensu clients are named using the EC2 instance ID, for the instance on which they reside. The ec2 enterprise handler requires valid AWS IAM user credentials with the EC2 describe instances action in a policy, e.g. ec2:DescribeInstances.

Configuration

Example(s)

The following is an example global configuration for the ec2 enterprise handler (integration).

{
  "ec2": {
    "region": "us-west-2",
    "access_key_id": "AlygD0X6Z4Xr2m3gl70J",
    "secret_access_key": "y9Jt5OqNOqdy5NCFjhcUsHMb6YqSbReLAJsy4d6obSZIWySv",
    "allowed_instance_states": ["running"],
    "timeout": 10
  }
}

Integration Specification

NOTE: the following integration definition attributes may be overwritten by the corresponding Sensu client definition ec2 attributes, which are included in event data.

ec2 attributes

The following attributes are configured within the {"ec2": {} } configuration scope.

region
description The AWS EC2 region to query for EC2 instance state(s).
required false
type String
default us-east-1
example
"region": "us-west-1"
access_key_id
description The AWS IAM user access key ID to use when querying the EC2 API.
required true
type String
example
"access_key_id": "AlygD0X6Z4Xr2m3gl70J"
secret_access_key
description The AWS IAM user secret access key to use when querying the EC2 API.
required true
type String
example
"secret_access_key": "y9Jt5OqNOqdy5NCFjhcUsHMb6YqSbReLAJsy4d6obSZIWySv"
allowed_instance_states
description An array of allowed EC2 instance states. Each array item must each be a string. Any other state(s) will cause the Sensu client to be deregistered.
required false
type Array
allowed values running, stopping, stopped, shutting-down, terminated, rebooting, pending
default ["running"]
example
"allowed_instance_states": ["running", "rebooting"]
filters
description An array of Sensu event filters (names) to use when filtering events for the handler. Each array item must be a string. Specified filters are merged with default values.
required false
type Array
default
["handle_when", "check_dependencies"]
example
"filters": ["recurrence", "production"]
severities
description An array of check result severities the handler will handle. NOTE: event resolution bypasses this filtering.
required false
type Array
allowed values ok, warning, critical, unknown
default
["warning", "critical", "unknown"]
example
 "severities": ["critical", "unknown"]
timeout
description The handler execution duration timeout in seconds (hard stop).
required false
type Integer
default 10
example
"timeout": 30