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

custom-resource: better log customization design for custom resource logs #33196

Open
2 tasks
pahud opened this issue Jan 27, 2025 · 1 comment
Open
2 tasks
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@pahud
Copy link
Contributor

pahud commented Jan 27, 2025

Describe the feature

Challenges

In AWS CDK, some constructs implicitly create custom resources with associated providers that generate CloudWatch log groups. Customers currently have no way to customize these log groups, either by:

  1. Using their own existing log groups instead of the generated ones.
  2. Specifying the log retention period for the generated log groups.

As a result, when customers deploy stacks containing these implicit custom resources, the generated log groups are left orphaned, requiring manual cleanup by the customer.

Affected Issues

The issues related to this challenge are:

Affected Modules

This challenge affects all CDK modules that implicitly create custom resources with lambda function providers.

Use Case

deploy any L2 constructs that have custom resources implicitly created.

Proposed Solution

Expected Experience

To improve the customer experience, it would be desirable to allow customers more freedom in customizing the log groups associated with these implicit custom resources, such as:

  1. Enabling customers to specify their own existing log groups for the custom resource providers to use, instead of generating new ones.
  2. Allowing customers to set a default log retention period for the generated log groups, to avoid orphaned log groups.
  3. Exploring other ideas that give customers more control over the log group configuration for these implicit custom resources.

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.177.0

Environment details (OS name and version, etc.)

all

@pahud pahud added @aws-cdk/custom-resources Related to AWS CDK Custom Resources effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Jan 27, 2025
@samson-keung
Copy link
Contributor

Adding some more info there with what I know. There was an attempt to implement this feature with the CustomResourceConfig class: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources.CustomResourceConfig.html

But as pointed out in #33116, CustomResourceConfig does not work for some of the custom resource providers. This should be fixed. Contributions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants