Coder Social home page Coder Social logo

aws-dx-monitor's Introduction

aws-dx-monitor

aws-dx-monitor monitors AWS Direct Connect runtime configuration items with Amazon CloudWatch. The system is driven by Amazon CloudWatch Events and AWS Lambda.

How it works

The following diagram expresses the high level system execution architecture.

aws-dx-monitor design

  1. CloudWatch Events schedules and invokes the Lambda function at one minute intervals.
  2. The Lambda function interrogates the AWS Direct Connect service through Describe API calls for every configuration type that makes sense for its operational scope (for example, if you are a Service Provider, you may wish to describe the Interconnects). AWS Direct Connect responds with the JSON payloads for each Describe call.
  3. After the Lambda function extracts the status from a given configuration item, it puts the data to a CloudWatch Custom Metric. Each configuration item type should have its own dimension in order to easily identify what is being monitored.
  4. Once the data has been settled in the custom CloudWatch metric, you can set alarms for it. See the section on Status Levels for information on configuration item status levels.
  5. Alarms may be triggered to notify an operator or administrator of a monitored status threshold.

Installation

Use the following steps to build and deploy the system. It is strongly suggested that you review the security policies prior to deploying to your environment.

1. Prerequisites

On the system where you will be building the AWS Lambda package, you will need the following:

2. Clone the Repository

Clone this repository.

$ git clone https://github.com/awslabs/aws-dx-monitor

3. Create a staging S3 bucket

The staging bucket is required to store the SAM deployment artifacts. The name I chose for my s3 bucket is rpcme-dx-monitor

aws s3api create-bucket --bucket rpcme-dx-monitor

4. Build and deploy the aws-dx-monitor Package

Validate, build, and deploy the aws-dx-monitor package.

cd aws-dx-monitor
sam validate
sam build
sam deploy --region us-west-1           \
           --stack-name dx-monitor      \
           --s3-bucket rpcme-dx-monitor \
           --capabilities CAPABILITY_IAM

5. Set Alarms

Once the scheduled event begins sending data to Amazon CloudWatch, you can begin setting alarms. The custom metric will be found in CloudWatch > Metrics under the name AWSx/DirectConnect. For more information, see Creating Amazon CloudWatch Alarms.

You may wish to alarm on these levels:

Config Item Level
Connection >= 5
Interconnect >= 4
Connections on Interconnect >= 5
Virtual Interface >= 5
Virtual Gateway >= 3

Status Levels

See the following sections for status levels on:

  • Connections
  • Interconnects
  • Connections on Interconnects
  • Virtual Interfaces
  • Virtual Gateways

Connections

Name API Status Value Numeric Value
Ordering ordering 1
Requested requested 2
Pending pending 3
Available available 4
Down down 5
Deleting deleting 6
Deleted deleted 7
Rejected rejected 8

Interconnects

Name API Status Value Numeric Value
Requested requested 1
Pending pending 2
Available available 3
Down down 4
Deleting deleting 5
Deleted deleted 6

Connections on Interconnects

Name API Status Value Numeric Value
Ordering ordering 1
Requested requested 2
Pending pending 3
Available available 4
Down down 5
Deleted deleted 6
Rejected rejected 7

Virtual Interfaces

Name API Status Value Numeric Value
Confirming confirming 1
Verifying verifying 2
Pending pending 3
Available available 4
Down down 5
Deleting deleting 6
Deleted deleted 7
Rejected rejected 8
Testing testing 9

Virtual Gateways

Name API Status Value Numeric Value
Pending pending 1
Available available 2
Deleting deleting 3
Deleted deleted 4

Cleanup

To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:

aws --region us-west-1 cloudformation delete-stack --stack-name dx-monitor

Resources

See the AWS SAM developer guide for an introduction to SAM specification, the SAM CLI, and serverless application concepts.

Next, you can use AWS Serverless Application Repository to deploy ready to use Apps that go beyond hello world samples and learn how authors developed their applications: AWS Serverless Application Repository main page

aws-dx-monitor's People

Contributors

henrysher avatar ovalba avatar rdelcampog avatar rpcme avatar wrgeorge1983 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-dx-monitor's Issues

Request to improve deployment instructions in README.md - aws s3api create-bucket fails

Section:

  1. Create a staging S3 bucket
    The staging bucket is required to store the SAM deployment artifacts. The name I chose for my s3 bucket is rpcme-dx-monitor
    aws s3api create-bucket --bucket rpcme-dx-monitor

The command returns the following error:
An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.

Rather replace with the following working command:
$ aws s3 mb s3://rpcme-dx-monitor --region us-west-1

Migrate to Python 3?

Any chance to migrate it to Python 3, since AWS will deprecate support to Python 2.7 on July 15, 2021?

Thanks!

multiple dx circuits

The monitor appears to work fine if you have a single Dx circuit. If you have multiple dx circuits for redundancy, then only the vif's on the first circuit, but not the second, appear to be able to be monitored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.