Code Monkey home page Code Monkey logo

terraform-aws-cloudwatch-alarm's Introduction

cloudwatch-alarm

Terraform actions status

Provides CloudWatch alarms. This module's support is currently limited to ECS services, and currently supports only the CPUUtilization and MemoryUtilization metrics.

In this minimum viable implementation, the CloudWatch alarm period, and statistic are hardcoded. Thresholds for the CPUUtilization and MemoryUtilization metrics can be specified by the caller; both values are numeric percentages.

Example Usage

module "alarm" {
  source = "[email protected]:techservicesillinois/terraform-aws-cloudwatch-alarm"

  name = "foo"

  subscriptions = [
      {
        protocol = "sms"
        endpoint = "+18005551212"
      },
  ]

  ecs_cluster = "foo"

  ecs_services = {
    "foo-daemon" = {
      cpu    = 90
      memory = 85
    },

    "foo-ui" = {
      cpu    = 75
      memory = 75
    }
  }
}

Argument Reference

The following arguments are supported:

  • ecs_cluster – (Required) ECS cluster containing services for which alarms are created.

  • ecs_services – (Optional) Map of ECS services for which alarms are created; key is name of service and value is an object with the attributes cpu and memory. Both attributes are numeric values.

  • name – (Required) Service name. This is used to form the name of alarm(s).

  • subscriptions (Optional) A subscriptions block. The subscriptions block is documented below.

  • tags – (Optional) Tags to be applied to resources where supported.

subscriptions

A subscription block consists of a list containing one or more maps, each of which must contain the following keys:

  • protocol – (Required) The protocol to use. The fully-supported values for this are: sqs, sms, lambda, application.

  • endpoint – (Required) The endpoint to send data to, the contents will vary with the protocol.

Note: AWS supports additional email and email-json protocols that are not supported by Terraform because the authorization process does not generate an ARN until the target email address has been validated. However, subscriptions using the email and email-json protocols can be created in the AWS console.

Additionally, http and https protocols are only partially supported by Terraform.

For further information, see the documentation on Terraform's terraform-sns-topic-subscription resource. The Amazon documentation on the Simple Notification Service (SNS) may also be helpful.

Attributes Reference

The following attributes are exported:

  • alarm_arn – List consisting of ARNs of each alarm managed by the module.

  • topic_arn - ARN of the SNS alarm topic for this service.

terraform-aws-cloudwatch-alarm's People

Contributors

jonroma avatar alanb-uofi 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.