Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


v0.1.0 · public · Published 7 months ago

README
Asset Definition
Release Notes
Release Assets

Sensu Bonsai Asset
Go Test
goreleaser

Sensu AWS SNS Handler

sensu-aws-sns-handler

Table of Contents

Overview

The sensu-aws-sns-handler is a Sensu Handler that allows you to send alerts via AWS
Simple Notification Service (SNS).

Files

N/A

Usage examples

Help

AWS Simple Notification Service Handler

Usage:
  sensu-aws-sns-handler [flags]
  sensu-aws-sns-handler [command]

Available Commands:
  help        Help about any command
  version     Print the version number of this plugin

Flags:
  -h, --help                      help for sensu-aws-sns-handler
  -m, --message-template string   The template for the message sent via SNS (default "{{.Entity.Name}}/{{.Check.Name}}: {{.Check.State}}")
  -t, --topic-arn string          The SNS Topic ARN

Configuration

Sensu Go

Asset registration

Sensu Assets are the best way to make use of this plugin. If you're not using an asset, please
consider doing so! If you're using sensuctl 5.13 with Sensu Backend 5.13 or later, you can use the
following command to add the asset:

sensuctl asset add nixwiz/sensu-aws-sns-handler

If you're using an earlier version of sensuctl, you can find the asset on the Bonsai Asset Index.

Handler definition

---
type: Handler
api_version: core/v2
metadata:
  name: sensu-aws-sns-handler
  namespace: default
spec:
  command: sensu-aws-sns-handler
  type: pipe
  runtime_assets:
  - nixiwz/sensu-aws-sns-handler

Annotations

All arguments for this handler are tunable on a per entity or check basis based on annotations. The
annotations keyspace for this handler is sensu.io/plugins/sensu-aws-sns-handler/config.

Examples

To change the SNS topic ARN for a particular entity, in that agent's agent.yml file
add the following:

annotations:
  sensu.io/plugins/sensu-aws-sns-handler/config/topic-arn: "arn:aws:sns:us-west-2:0123456789012:sensu-alerts"

To change the message template for a particular check, for that checks's metadata add the following:

type: CheckConfig
api_version: core/v2
metadata:
  annotations:
    fatigue_check/occurrences: "3"
    sensu.io/plugins/sensu-aws-sns-handler/config/message-template: "{{.Entity.Name}}/{{.Check.Name}}: {{.Check.State}}, {{.Check.Occurrences}}"
[...]

AWS Credentials

This plugin makes use of the AWS SDK for Go. The SDK uses the default credential provider chain
to find AWS credentials. The SDK uses the first provider in the chain that returns credentials
without an error. The default provider chain looks for credentials in the following order:

  1. Environment variables (AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, and AWS_REGION).

  2. Shared credentials file (typically ~/.aws/credentials).

  3. If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.

  4. If your application uses an ECS task definition or RunTask API operation, IAM role for tasks.

The SDK detects and uses the built-in providers automatically, without requiring manual configurations.
For example, if you use IAM roles for Amazon EC2 instances, your applications automatically use the
instance’s credentials. You don’t need to manually configure credentials in your application.

Source: Configuring the AWS SDK for Go

If you go the route of using environment variables, it is highly suggested you use them via the
Env secrets provider.

Installation from source

The preferred way of installing and deploying this plugin is to use it as an Asset. If you would
like to compile and install the plugin from source or contribute to it, download the latest version
or create an executable script from this source.

From the local path of the sensu-aws-sns-handler repository:

go build

Additional notes

Contributing

For more information about contributing to this plugin, see Contributing.

Are you sure you want to report this asset?

Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.

×

You must be signed in to report this asset.

Sign In with Github

Download

×

Either download the source code:

Download Source

Or download the asset definition: