diff --git a/main.tf b/main.tf index ad6e345..3cdf593 100644 --- a/main.tf +++ b/main.tf @@ -28,6 +28,7 @@ resource "aws_db_instance" "default" { name = var.db_name username = var.master_username password = local.password + monitoring_interval = var.enhanced_monitoring ? 60 : 0 maintenance_window = "mon:02:00-mon:03:30" backup_window = "03:30-05:00" backup_retention_period = 14 diff --git a/vars.tf b/vars.tf index 0e78e79..509248e 100644 --- a/vars.tf +++ b/vars.tf @@ -51,3 +51,9 @@ variable "apply_immediately" { default = false description = "Apply changes immediately or wait for next maintenance window" } + +variable "enhanced_monitoring" { + type = bool + default = false + description = "Enable enhanced monitor on the instance" +}