terraform.aws-baseline-infra/modules/ManagementGovernance/Monitoring.EC2
2024-01-13 00:25:30 +08:00
..
get-cwagent-device.sh UPD: backported monitoring modules from customer repo 2023-05-23 13:10:16 +08:00
get-cwagent-dimensions.sh UPD: Added Cwl-firehose-s3 module and pulled a couple updates from upstream repo. 2024-01-13 00:25:30 +08:00
get-os-platform.sh UPD: backported monitoring modules from customer repo 2023-05-23 13:10:16 +08:00
main.tf UPD: Added Cwl-firehose-s3 module and pulled a couple updates from upstream repo. 2024-01-13 00:25:30 +08:00
provider.tf UPD: backported monitoring modules from customer repo 2023-05-23 13:10:16 +08:00
README.md DOC: updated readme with examples 2022-11-10 17:10:45 +08:00
variables.tf UPD: various monitoring updates from upstream 2023-07-04 08:16:09 +08:00

Monitoring module

This module deploys the default cloudwatch metric monitoring

Notes

Terraform lifecycle ignores tags to speed up terraform subsequent update. Cloudwatch alarm tags cannot be read on aws console anyway.

Example

module "ec2-instances" {
  source        = "../../modules/util/resource-list"
  resource-type = "ec2"
}

module "ec2-monitoring" {
  cw-alarm-prefix            = local.cw-alarm-prefix
  for_each                   = module.ec2-instances.result-set
  source                     = "../../modules/ManagementGovernance/Monitoring.EC2"
  default-tags               = local.default-tags
  ec2-instance-id            = each.value
  threshold-CPUUtilization   = 90
  threshold-mem_free         = 100000
  threshold-swap_free        = 100000
  threshold-disk_free        = 1 * 1000 * 1000 * 1000
  threshold-disk_inodes_free = 10000
  threshold-processes_total  = 500
  threshold-LogicalDiskFreePct = 10
  threshold-MemoryCommittedPct = 90
  actions-enabled            = var.actions-enabled
  sns-targets = var.sns-targets
}