aws / aws/aws-cdk

(awc_ecr): L2 construct for RepositoryCreationTemplate OR serialize support for LifecycleRule

Open
#35,208 3 comments 1 reaction 0 assignees View on GitHub
aws-cdk-lib effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

I have a stack that is configuring a pull-through cache. Since there are no L2 constructs I had to use the base L1 construct.

So far this has been fine so far. However, now I want to configure life cycle rules and it would be nice to be able to use the LifecycleRule class to help build those. The issue is that the class is not serializable to JSON.

### Use Case

Configuring a pull through cache with default lifecycle policies

### Proposed Solution

Thus there are a few options to improve this.
1) make LifecycleRule serializable so it can be used in more contexts than just another L2 construct.
2) create a L2 construct around the CfnRepositoryCreationTemplate (and CfnPullThroughCacheRule while we are at it). Though from how the current serialization of LifecycleRule is done in the JS, this would need to be refactored for shared usage (e.g. back to option 1 being helpful. here as well).

### Other Information

_No response_

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.182.0 (python)

### AWS CDK CLI version

2.1024.0

### Environment details (OS name and version, etc.)

macOS 14

Contributor guide

Open the contributing guide

Research direction

Start by examining LifecycleRule serialization and the CfnRepositoryCreationTemplate and CfnPullThroughCacheRule constructs. Determine whether serializing LifecycleRule for broader use or adding the proposed L2 constructs best addresses pull-through cache lifecycle policies; done means the selected approach supports configuring the stated use case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.