aws / aws/aws-cdk

(core): add optional interface method to signal when all nodes have been processed

Open
#24,189 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/core 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 would like a signal after all constructs have been processed through the aspect to be able to perform final operations

### Use Case

I would like to output a distinct list of AWS service names detected in the stack to a file. So knowing when all constructs have been visited to do this final operations would be much better than writing over a file repetitively on each visit.

### Proposed Solution

Add optional `done | completed | end` method to the IAspect interface and call it after all nodes have been visited if the function exists.

### Other Information

_No response_

### Acknowledgements

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

### CDK version used

2.55.1

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

MACOS

Contributor guide

Open the contributing guide

Research direction

Start by locating the IAspect interface and the traversal entry point that processes all constructs. Review how aspect visits are completed, then determine how the optional completion signal should be invoked only after the full traversal; done means the behavior is covered by appropriate tests and the final operation can run once per traversal.

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.