Skip to content

Commit

Permalink
TM-720: fix schedule alarms (#8800)
Browse files Browse the repository at this point in the history
* TM-720: fix for schedule-alarms

* add output

* fix
  • Loading branch information
drobinson-moj authored Nov 26, 2024
1 parent b1793de commit fc9c9aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ locals {
}

schedule_alarms_lambda = {
function_name = "schedule-alarms"
alarm_patterns = [
"public-https-*-unhealthy-load-balancer-host",
]
Expand Down
15 changes: 15 additions & 0 deletions terraform/modules/baseline/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,26 @@ output "security_groups" {
value = aws_security_group.this
}

output "schedule_alarms_lambda" {
description = "schedule alarms lambda output"
value = module.schedule_alarms_lambda
}

output "sns_topics" {
description = "map of aws_sns_topic resources corresponding to var.sns_topics"
value = aws_sns_topic.this
}

output "ssm_associations" {
description = "map of aws_ssm_association resources corresponding to var.ssm_association"
value = aws_ssm_association.this
}

output "ssm_documents" {
description = "map of aws_ssm_document resources corresponding to var.ssm_documents"
value = aws_ssm_document.this
}

output "ssm_parameters" {
description = "map of security groups corresponding to var.ssm_parameters"
value = merge(
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/baseline/schedule_alarms_lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "schedule_alarms_lambda" {
length(var.schedule_alarms_lambda.alarm_patterns) > 0
) ? 1 : 0

lambda_function_name = var.schedule_alarms_lambda.function_name
lambda_function_name = "schedule-alarms"
lambda_log_level = var.schedule_alarms_lambda.lambda_log_level

alarm_list = var.schedule_alarms_lambda.alarm_list
Expand Down
5 changes: 2 additions & 3 deletions terraform/modules/baseline/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -918,13 +918,12 @@ variable "s3_buckets" {
variable "schedule_alarms_lambda" {
description = ""
type = object({
function_name = optional(string, null)
lambda_log_level = optional(string, "INFO")
alarm_list = optional(list(string), [])
alarm_patterns = optional(list(string), [])
disable_weekend = optional(bool, true)
start_time = optional(string, "06:15")
end_time = optional(string, "20:45")
start_time = optional(string, "20:45") # when to disable alarm
end_time = optional(string, "06:15") # when to re-enable alarm
tags = optional(map(string), {})
})
default = {}
Expand Down

0 comments on commit fc9c9aa

Please sign in to comment.