Skip to content
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

aws-lambda-nodejs: NodejsFunction should enable configuring log group #27414

Closed
1 of 2 tasks
AlJohri opened this issue Oct 5, 2023 · 6 comments
Closed
1 of 2 tasks

aws-lambda-nodejs: NodejsFunction should enable configuring log group #27414

AlJohri opened this issue Oct 5, 2023 · 6 comments
Labels
@aws-cdk/aws-lambda-nodejs feature-request A feature should be added or improved. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@AlJohri
Copy link

AlJohri commented Oct 5, 2023

Describe the feature

The NodejsFunction construct should enable setting the log group similar to how the underlying Lambda construct already does.

Use Case

We would like to centralize all of our application logs into a single log group.

Proposed Solution

Add a new logGroup property to the constructor props.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.95.0 (build cfa7e88)

Environment details (OS name and version, etc.)

Amazon Linux 2

@AlJohri AlJohri added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2023
@indrora
Copy link
Contributor

indrora commented Oct 5, 2023

This feels like a duplicate of #27413 but with a different target.

I suspect that adding a more generic "It'd be nice to have log groups configurable where they might make one" ticket and binding these to it would be appropriate. I'll bring this up with the Construct Squad.

@indrora indrora added needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2023
@peterwoodworth
Copy link
Contributor

NodejsFunction extends Function, and includes the same logging related props, so it has all the same functionality. Lambda functions create logs by default on creation, I'm pretty sure we offer the most control you can really have already. Maybe I don't understand the request?

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-review labels Oct 5, 2023
@AlJohri
Copy link
Author

AlJohri commented Oct 6, 2023

Lambda functions create logs by default on creation, I'm pretty sure we offer the most control you can really have already.

Thanks for the prompt response and clarification. I see that indeed even on the Function construct, there is no construct property for log group. Coming from the ECS world, I did not realize that you can't change the log group of a lambda.

@AlJohri AlJohri closed this as completed Oct 6, 2023
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@AlJohri
Copy link
Author

AlJohri commented Nov 18, 2023

Customizing lambda log group is supported now and should get exposed on the Function construct: https://aws.amazon.com/blogs/compute/introducing-advanced-logging-controls-for-aws-lambda-functions/

When that is done, NodeJsFunction construct will also get this property.

@AlJohri
Copy link
Author

AlJohri commented Nov 18, 2023

And it’s already done! #28039

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs feature-request A feature should be added or improved. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants