terraform.aws-baseline-infra/modules/ManagementGovernance/Monitoring.EKS
2023-01-05 23:35:31 +08:00
..
main.tf UPD: various bug fixes and enhancements 2023-01-05 23:35:31 +08:00
provider.tf NEW: EKS monitoring 2022-12-30 00:01:39 +08:00
README.md NEW: EKS monitoring 2022-12-30 00:01:39 +08:00
variables.tf UPD: various bug fixes and enhancements 2023-01-05 23:35:31 +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. Unlike other monitoring modules which discovers resources details automatically, EKS pod name need to be supplied to this module. AWS cli does not provide pod information.

Example

data "aws_eks_clusters" "eks-clusters" {}

module "eks-monitoring" {
  cw-alarm-prefix                            = local.cw-alarm-prefix
  for_each                                   = data.aws_eks_clusters.eks-clusters.names
  source                                     = "../../modules/ManagementGovernance/Monitoring.EKS"
  default-tags                               = local.default-tags
  cluster-name                               = each.value
  eks-namespace                              = "default"
  pod-names                                  = ["depl-nginx", "depl-alpine"]
  threshold-pod_cpu_utilization              = 85
  threshold-pod_memory_utilization           = 85
  threshold-pod_number_of_container_restarts = 5
  actions-enabled                            = var.actions-enabled
  sns-targets                                = local.sns-targets
}