Browse Source

Adds Datasync Permissions for Four-Hourly

Also updates timeout to match producction value.

To be tagged v3.0.7
Fred Damstra [afs macbook] 3 years ago
parent
commit
143ce370b3
2 changed files with 9 additions and 1 deletions
  1. 8 0
      base/customer_portal_lambda/cloudwatch.tf
  2. 1 1
      base/customer_portal_lambda/main.tf

+ 8 - 0
base/customer_portal_lambda/cloudwatch.tf

@@ -141,6 +141,14 @@ resource "aws_lambda_permission" "allow_cloudwatch_to_call_portal_lambda_hourly"
   source_arn    = aws_cloudwatch_event_rule.portal_event_hourly_rule.arn
 }
 
+resource "aws_lambda_permission" "allow_cloudwatch_to_call_portal_lambda_four_hourly" {
+  statement_id  = "AllowExecutionFromCloudWatchFourHourly"
+  action        = "lambda:InvokeFunction"
+  function_name = aws_lambda_function.portal_data_sync.function_name
+  principal     = "events.amazonaws.com"
+  source_arn    = aws_cloudwatch_event_rule.portal_event_four_hourly_rule.arn
+}
+
 resource "aws_lambda_permission" "allow_cloudwatch_to_call_portal_lambda_daily" {
   statement_id  = "AllowExecutionFromCloudWatchDaily"
   action        = "lambda:InvokeFunction"

+ 1 - 1
base/customer_portal_lambda/main.tf

@@ -106,7 +106,7 @@ resource "aws_lambda_function" "portal_data_sync" {
   role             = aws_iam_role.portal-lambda-role.arn
   handler          = "lambda_function.lambda_handler"
   runtime          = "python3.7"
-  timeout          = "720"
+  timeout          = "898"
   vpc_config {
     subnet_ids          = var.subnets
     security_group_ids  = [ data.aws_security_group.typical-host.id, aws_security_group.portal_lambda_splunk_sg.id ]