Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Latest commit

 

History

History
40 lines (32 loc) · 1.05 KB

File metadata and controls

40 lines (32 loc) · 1.05 KB

This module creates a set of alarms and attaches them to a specific API Gateway stage. Alarms for the following metrics are supported:

  • 4XXError
  • 5XXError
  • CacheHitCount
  • CacheMissCount
  • Count
  • IntegrationLatency
  • Latency

See Amazon API Gateway 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     = "git::https://github.com/vistaprint/terraformmodules.git//modules/api_cloudwatch_monitors"
  api_name   = "SampleApi"
  stage_name = "Prod" 

  alarms = {
    "4XXError" = {
      threshold = 100
    }
    "5XXError" = {
      threshold = 25
    }
    "Latency" = {
      statistic = "Average"
    }
    "CacheMissCount" = {}
  }
}

Notes

The alarms name is prefixed with the api and the stage names. For example, the 4XXError alarm will be called SampleApi_Prod_4XXError.