aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.5k stars 3.85k forks source link

custom-resource: support isComplete handler for AwsCustomResource #31062

Open maltejk opened 1 month ago

maltejk commented 1 month ago

Describe the feature

Please add the isCompleteHandler functionality to AwsCustomResource also.

Thank you for your consideration!

As suggested by @hoegertn

Use Case

When I make use of AwsCustomResource to ModifyVpnTunnelOptions, I would not know when the modification completed. As I need to modify both tunnels, adding a dependency would not help. The second AwsCustomResource to run ModifyVpnTunnelOptions would start and fail with an error as the VPN is in state "modifying".

So I would end up creating a CustomResource, so I can make use of the isCompleteHandler.

Proposed Solution

No response

Other Information

No response

Acknowledgements

CDK version used

2.150.0

Environment details (OS name and version, etc.)

Darwin mbp.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64

pahud commented 1 month ago

Generally we'll recommend CustomResource in tis case but we welcome any feature requests. Please help us prioritize by 👍

hoegertn commented 1 month ago

Having the isComplete handler as part of the AwsCustomResource would help a lot with undifferentiated heavy-lifting as several APIs return without the modification being ready. A polling mech to wait for this to happen would help with all AwsCustomResources that are not read-only.

I will look into drafting a PR for this.