Coder Social home page Coder Social logo

sskalnik / terraform-aws-cloudfront-cloudwatch-alarms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vistaprint/terraform-aws-cloudfront-cloudwatch-alarms

0.0 1.0 0.0 18 KB

This Terraform module simplifies creating cloudwatch alarms for a cloudfront distribution.

License: Other

HCL 16.50% Ruby 73.81% HTML 9.69%

terraform-aws-cloudfront-cloudwatch-alarms's Introduction

Terraform AWS Cloudfront Cloudwatch Alarms

This module creates a set of alarms and attaches them to a cloudfront distribution. Alarms for the following metrics are supported:

  • Requests
  • BytesDownloaded
  • BytesUploaded
  • TotalErrorRate
  • 4xxErrorRate
  • 5xxErrorRate

See Amazon CloudFront Metrics and Dimensions for more information about these metrics.

See the variables.tf file in the module folder for more information on the module parameters.

Example

module "sample_monitors" {
  source     = "vistaprint/cloudfront-cloudwatch-alarms/aws"
  domain   = "www.example.com"
  distribution_id = "${aws_cloudfront_distribution.example_distribution.id}"

  alarms = {
    "4xxErrorRate" = {
      threshold = 5 #(%)
    }
    "5xxErrorRate" = {
      threshold = 1 #(%)
    }
  }
}

Notes

The alarms name is prefixed with the domain name and the distributionid. For example, the 4xxError alarm will be called example.com-E12312QH8BVRIY-4xxErrorRate.

Cloudfront distributions are Global but all metrics and alarms must be set in N. Virginia (us-east-1).

Testing

This module uses the terraform-module-testing framework. After making some changes run rake preflight from the root of the repository to run all tests for the module. This will require:

  • A config file in test\cloudfront-cloudwatch-monitors\config\config-dev.yml
terraform-version: 0.11.0
project-name: cloudfront cloudwatch monitors tests
aws:
  profile: <profile>
  region: <region>
  • A secrets file in test\cloudfront-cloudwatch-monitors\secrets.yml:
region: <region>
aws_access_key_id: <access_key_id>
aws_secret_access_key:  <secret_access_key>

terraform-aws-cloudfront-cloudwatch-alarms's People

Contributors

daniebker avatar

Watchers

 avatar

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.