fleet/terraform/addons/monitoring
2023-02-22 21:25:25 -06:00
..
.header.md Separate monitoring notifications per alert (#10032) 2023-02-22 21:25:25 -06:00
.terraform-docs.yml Initial terraform monitoring addon module (#9864) 2023-02-16 14:30:08 -06:00
main.tf Separate monitoring notifications per alert (#10032) 2023-02-22 21:25:25 -06:00
README.md Separate monitoring notifications per alert (#10032) 2023-02-22 21:25:25 -06:00
variables.tf Separate monitoring notifications per alert (#10032) 2023-02-22 21:25:25 -06:00

Monitoring addon

This addon enables Cloudwatch monitoring for Fleet.

This includes:

  • 5XX Errors on ALB
  • ECS Service Monitoring
  • RDS Monitoring
  • Redis Monitoring
  • ACM Certificate Monitoring

Preparation

Some of the for_each and counts in this module cannot pre-determine the numbers until the main fleet module is applied.

You will need to terraform apply -target module.main prior applying monitoring assuming the use of a configuration matching the example at https://github.com/fleetdm/fleet/blob/main/terraform/example/main.tf.

Example Configuration

This assumes your fleet module is main and is configured with it's default documentation.

See https://github.com/fleetdm/fleet/blob/main/terraform/example/main.tf for details.

module "monitoring" {
  source                      = "github.com/fleetdm/fleet//terraform/addons/monitoring?ref=main"
  fleet_ecs_service_name      = module.main.byo-vpc.byo-db.byo-ecs.service.name
  fleet_min_containers        = module.main.byo-vpc.byo-db.byo-ecs.service.desired_count
  alb_name                    = module.main.byo-vpc.byo-db.alb.lb_dns_name
  alb_target_group_name       = module.main.byo-vpc.byo-db.alb.target_group_names[0]
  alb_target_group_arn_suffix = module.main.byo-vpc.byo-db.alb.target_group_arn_suffixes[0]
  alb_arn_suffix              = module.main.byo-vpc.byo-db.alb.lb_arn_suffix
  default_sns_topic_arns      = [var.sns_topic_arn]
  mysql_cluster_members       = module.main.byo-vpc.rds.cluster_members
  redis_cluster_members       = module.main.byo-vpc.redis.member_clusters[0]
  acm_certificate_arn         = module.acm.acm_certificate_arn
}

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_cloudwatch_metric_alarm.acm_certificate_expired resource
aws_cloudwatch_metric_alarm.alb_healthyhosts resource
aws_cloudwatch_metric_alarm.cpu_utilization_too_high resource
aws_cloudwatch_metric_alarm.lb resource
aws_cloudwatch_metric_alarm.redis-current-connections resource
aws_cloudwatch_metric_alarm.redis-database-memory-percentage resource
aws_cloudwatch_metric_alarm.redis-replication-lag resource
aws_cloudwatch_metric_alarm.redis_cpu resource
aws_cloudwatch_metric_alarm.redis_cpu_engine_utilization resource
aws_cloudwatch_metric_alarm.target_response_time resource
aws_db_event_subscription.default resource

Inputs

Name Description Type Default Required
acm_certificate_arn n/a string null no
alb_arn_suffix n/a string null no
alb_name n/a string null no
alb_target_group_arn_suffix n/a string null no
alb_target_group_name n/a string null no
customer_prefix n/a string "fleet" no
default_sns_topic_arns n/a list(string) [] no
fleet_ecs_service_name n/a string null no
fleet_min_containers n/a number 1 no
mysql_cluster_members n/a list(string) [] no
redis_cluster_members n/a list(string) [] no
sns_topic_arns_map n/a map(list(string)) {} no

Outputs

No outputs.