You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When supplying a large number of keys (>50) to cloudwatch_forwarder_log_groups, resource-based policy permissions throws a PolicyLengthExceededException with no way to recover. In addition to this, when the exception is thrown by the AWS SDK, terraform does not stop attempting to run PutSubscriptionFilter for every log group provided, with up to 25 retries each. This leads to incredibly long terraform apply times without any apparent reason if you don't have TF_LOGS set.
Expected Behavior
Provide any number of cloudwatch_forwarder_log_groups to the module that scales.
Potential fix?
Allow user to supply a "catch-all" source arn that can provide permissions to a larger number of log groups.
Steps to Reproduce
Steps to reproduce the behavior:
Add new datasource referencing your account log groups.
data "aws_cloudwatch_log_groups" "user_log_groups" {
log_group_name_prefix = "/aws/lambda/${var.resource_prefix}"
}
Map datasource to local variable
locals {
log_groups = { for value in data.aws_cloudwatch_log_groups.user_log_groups.log_group_names :
# Remove invalid key characters
trim(replace("${value}", "/", "-"), "-") => {
name = "${value}"
filter_pattern = ""
}
}
}
Provide to cloudposse/datadog-lambda-forwarder/aws module
Found a bug? Maybe our Slack Community can help.
Describe the Bug
When supplying a large number of keys (>50) to
cloudwatch_forwarder_log_groups
, resource-based policy permissions throws aPolicyLengthExceededException
with no way to recover. In addition to this, when the exception is thrown by the AWS SDK, terraform does not stop attempting to runPutSubscriptionFilter
for every log group provided, with up to 25 retries each. This leads to incredibly longterraform apply
times without any apparent reason if you don't haveTF_LOGS
set.Expected Behavior
Provide any number of
cloudwatch_forwarder_log_groups
to the module that scales.Potential fix?
Allow user to supply a "catch-all" source arn that can provide permissions to a larger number of log groups.
Steps to Reproduce
Steps to reproduce the behavior:
datasource
referencing your account log groups.datasource
to local variablecloudposse/datadog-lambda-forwarder/aws
moduleterraform apply
withTF_LOGS
set to DEBUG to see SDK callslambda/AddPermission
andlogs/PutSubscriptionFilter
failingScreenshots
If applicable, add screenshots or logs to help explain your problem.
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Additional Context
terraform-aws-datadog-lambda-forwarder/lambda-log.tf
Lines 195 to 203 in 373367a
The text was updated successfully, but these errors were encountered: