From 53d389a534e82d6501eb76abc5c49451a04fc1e7 Mon Sep 17 00:00:00 2001 From: "Zach A. Thomas" Date: Mon, 8 Jan 2024 09:18:35 -0500 Subject: [PATCH] add notification for excel files --- terraform/functions.tf | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/terraform/functions.tf b/terraform/functions.tf index a5958b74..74cc8adb 100644 --- a/terraform/functions.tf +++ b/terraform/functions.tf @@ -179,7 +179,7 @@ resource "aws_s3_object" "lambda_artifact-cpfValidation" { } resource "aws_s3_bucket_notification" "json_notification" { - bucket = aws_s3_bucket.cpf_uploads_bucket.bucket + bucket = module.cpf_uploads_bucket.bucket_id lambda_function { lambda_function_arn = module.lambda_function-cpfValidation.lambda_function_arn @@ -188,6 +188,16 @@ resource "aws_s3_bucket_notification" "json_notification" { } } +resource "aws_s3_bucket_notification" "excel_notification" { + bucket = module.cpf_uploads_bucket.bucket_id + + lambda_function { + lambda_function_arn = module.lambda_function-excelToJson.lambda_function_arn + events = ["s3:ObjectCreated:*"] + filter_suffix = ".xlsm" + } +} + module "lambda_function-graphql" { source = "terraform-aws-modules/lambda/aws" version = "6.5.0"