elastic / elastic/elastic-serverless-forwarder

policy size limits - max 44 log groups you can add

Open
#731 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
38
Forks
50
PR merge metrics
No merged PRs in 30d

Description

I have tried to split log groups into 2 lists:
```
ElasticServerlessForwarderCloudWatchLogsEvents = join(",", formatlist("%s:*", slice(local.log_groups_list, 0, local.log_groups_half_index)))
ElasticServerlessForwarderCloudWatchLogsEvents2 = join(",", formatlist("%s:*", slice(local.log_groups_list, local.log_groups_half_index, local.log_groups_count)))
```
But is still creating only 1 policy: https://github.com/elastic/elastic-serverless-forwarder/blob/befdd23dca45624b10c18c7d17bc30a87e8d1d1a/.internal/aws/cloudformation/macro.yaml#L164

This should create a second policy and attach it to the role, because we can add a maximum of 44 log groups to one serverless deployment.

The previous issue should have fixed this: https://github.com/elastic/elastic-serverless-forwarder/issues/560 but it's not.

For confirmed bugs, please report:
- Version: -> 1.12
- Steps to Reproduce: add more than 44 log groups in

error from CloudFormation: `Resource handler returned message: "The final policy size (20906) is bigger than the limit (20480). (Service: Lambda, Status Code: 400, Request ID:****-b3c8-4363-adc0-****)" (RequestToken: ****-b3c8-4363-adc0-****, HandlerErrorCode: InvalidRequest)`

Contributor guide

Open the contributing guide

Research direction

Start at .internal/aws/cloudformation/macro.yaml around line 164 and reproduce the deployment with more than 44 log groups on version 1.12. Trace how the policy is generated and attached to the role. Done means the configuration creates and attaches a second policy, allowing the deployment to avoid the 20,480-byte policy limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.