Skip to content

Commit

Permalink
fix: Truncate statement_id length after 100 characters (#54)
Browse files Browse the repository at this point in the history
* Fix `statement_id` length

* Update logs_monitoring_cloudwatch_log.tf

Co-authored-by: Jim Park <jimp@scribd.com>

---------

Co-authored-by: Jim Park <jimp@scribd.com>
  • Loading branch information
jjkoh95 and jim80net committed Jul 20, 2023
1 parent 3e740db commit 3f98ed3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logs_monitoring_cloudwatch_log.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "aws_cloudwatch_log_subscription_filter" "test_lambdafunction_logfilter

resource "aws_lambda_permission" "allow_cloudwatch_logs_to_call_dd_lambda_handler" {
count = length(var.cloudwatch_log_groups)
statement_id = "${replace(var.cloudwatch_log_groups[count.index], "/", "_")}-AllowExecutionFromCloudWatchLogs"
statement_id = "${substr(replace(var.cloudwatch_log_groups[count.index], "/", "_"), 0, 67)}-AllowExecutionFromCloudWatchLogs"
action = "lambda:InvokeFunction"
function_name = aws_cloudformation_stack.datadog-forwarder.outputs.DatadogForwarderArn
principal = "logs.${var.aws_region}.amazonaws.com"
Expand Down

0 comments on commit 3f98ed3

Please sign in to comment.