Skip to content

Commit

Permalink
add lambda alarm modules (#1520)
Browse files Browse the repository at this point in the history
* add lambda_name to outputs

* output lambda names

* add additional lambda alarm modules
  • Loading branch information
timburke-hackit authored Nov 28, 2023
1 parent b54ee34 commit f9c2c6e
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 18 deletions.
84 changes: 66 additions & 18 deletions terraform/core/41-lambda-failure-alarms.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,71 @@
module "ringgo_sftp_ingestion_lambda_alarm" {
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = "${local.short_identifier_prefix}sftp-to-s3"
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = "${local.short_identifier_prefix}sftp-to-s3"
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
}

module "icaseworks_api_ingestion_lambda_alarm" {
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = "${local.short_identifier_prefix}icaseworks-api-ingestion"
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = "${local.short_identifier_prefix}icaseworks-api-ingestion"
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
}

module "max_concurrency_lambda_alarm" {
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = module.max_concurrency_lambda[0].lambda_name
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
}

module "rds_snapshot_s3_to_s3_copie_lambda_alarm" {
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = module.liberator_rds_snapshot_to_s3[0].rds_snapshot_s3_to_s3_copier_lambda_name
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
}

module "export_rds_to_s3_snapshot_lambda_alarm" {
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = module.liberator_rds_snapshot_to_s3[0].export_rds_to_s3_snapshot_lambda_name
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
}

module "mtfh_export_lambda_lambda_alarm" {
count = local.is_production_environment ? 1 : 0
source = "../modules/lambda-alarms-and-monitoring"
tags = module.tags.values
identifier_prefix = local.short_identifier_prefix
lambda_name = "${local.short_identifier_prefix}-mtfh-export-lambda"
project = var.project
environment = var.environment
alarms_handler_lambda_name = module.lambda_alarms_handler[0].lambda_name
alarms_handler_lambda_arn = module.lambda_alarms_handler[0].lambda_arn
}
4 changes: 4 additions & 0 deletions terraform/modules/aws-lambda/99-outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ output "lambda_iam_role" {
value = aws_iam_role.lambda_role.name
}

output "lambda_name" {
description = "name of the lambda function"
value = aws_lambda_function.lambda.function_name
}
10 changes: 10 additions & 0 deletions terraform/modules/rds-snapshot-to-s3/99-outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@ output "rds_snapshot_s3_to_s3_copier_lambda_role_arn" {
description = "ARN for the s3_to_s3_copier_lambda_role"
value = aws_iam_role.rds_snapshot_s3_to_s3_copier_lambda_role.arn
}

output "rds_snapshot_s3_to_s3_copier_lambda_name" {
description = "Name for the s3_to_s3_copier_lambda"
value = module.rds_snapshot_s3_to_s3_copier.lambda_name
}

output "export_rds_to_s3_snapshot_lambda_name" {
description = "Name for the export_rds_to_s3_snapshot_lambda"
value = module.trigger_rds_snapshot_export.lambda_name
}

0 comments on commit f9c2c6e

Please sign in to comment.