Skip to content

Add config option for $createGroup #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DBX12 opened this issue Sep 8, 2022 · 4 comments · May be fixed by #38
Open

Add config option for $createGroup #36

DBX12 opened this issue Sep 8, 2022 · 4 comments · May be fixed by #38

Comments

@DBX12
Copy link

DBX12 commented Sep 8, 2022

Requested feature

Configuration option create_group

Rationale

When the underlying Maxbanton\Cwh\Handler\Cloudwatch instance flushes the logs, it will initialize itself and check if the log group and log stream already exist or create them if they do not.
To prevent this behavior (for example due to limited permissions on AWS), they provide the constructor parameter createGroup which defaults to true -> to source code. It would be beneficial to have this parameter exposed as config option of this log handler so it can be configured on the application level. Currently, the parameter is left unspecified in this library -> to source code

Let me know what you think about this so I might open a pull request in the future.

@DBX12
Copy link
Author

DBX12 commented Sep 8, 2022

It is understandable why administrators might be reluctant to allow the logs:DescribeLogGroups since it cannot be scoped to a single resource. An malicious actor who obtained the application's AWS credentials is able to learn the names of all log groups in the account even though actual access to them might be blocked.

@stefanrakicfaxi
Copy link

I have a problem with this thing too, will be great to that parameter can be moved to config

@particleflux
Copy link

#38 seems to add this

@danishn
Copy link

danishn commented Sep 21, 2023

With #42 that was merged around 3 weeks ago has shifted from using Maxbanton\Cwh\Handler\Cloudwatch to PhpNexus\Cwh\Handler\Cloudwatch package.

The current open PR #38 might be helpful but the new package PhpNexus also supports an additional param $creatStream which is useful to further reduce API calls to AWS in case LogGroup and LogStream both already exist - reference docs

I am looking forward to having this suggestion accepted so that API throttling can be controlled by the application via config params exposed by the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants