(custom-resources): provider-framework export request/response types for OnEventHandler and IsComplete Handler
Describe the feature
While leveraging the powerful provider-framework one needs the proper Event and Response types.
The single point of truth is here: https://github.com/aws/aws-cdk/blob/main/packages/@aws-cdk/custom-resources/lib/provider-framework/types.d.ts#L53
Often People try to use import { CloudFormationCustomResourceEvent, CloudFormationCustomResourceDeleteEvent, CloudFormationCustomResourceUpdateEvent, CloudFormationCustomResourceCreateEvent } from "aws-lambda"; (which leads to a different understanding) or https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/aws-lambda/trigger/cdk-custom-resource.d.ts (which are outdated and have other names)
How can we export them as a lighweight package from aws-cdk-lib to import in a Lambda?
Use Case
I'm always frustrated when looking for the correct and up-to-date typings for a lambda handler
Proposed Solution
Publish the OnEvent and IsComplete Handler types as a package from sources
Other Information
Using the CFN CustomResource types lead to a different of the provider-framework
Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
CDK version used
2.48.0
Environment details (OS name and version, etc.)
MacOS
@pflorek I'm doing
import type { OnEventRequest, OnEventResponse } from 'aws-cdk-lib/custom-resources/lib/provider-framework/types';
I think a new package @aws-cdk/custom-resources-types would be most idiomatic.
Any progress on this?
I am also curious if there is any plan for this one?