aws / aws/aws-cdk

custom_resources: onEvent response disagreement on if PhysicalResourceId is required

Open
#29,304 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/custom-resources bug documentation effort/medium p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the issue

When implementing a CustomResource, the onEvent handler must return some json.
There is disagreement about if PhysicalResourceId is required.

This repo [says](https://github.com/aws/aws-cdk/blob/a7de7feb6a14658ec25f4cfda434d5e1d69157d2/packages/aws-cdk-lib/custom-resources/README.md?plain=1#L157) it's **not** required.

The [CloudFormation guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html#crpg-ref-responses-physicalresourceid.title) says that it **is** required.

The [typescript definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/aws-lambda/trigger/cloudformation-custom-resource.d.ts#L50) say it **is** required, but looks like it was *trying* to make it only required if it's Update or Delete and then they did all event types.

I can make PRs once I know what it should be.
Though I don't know where the CloudFormation guide source is.

### Links

* https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.custom_resources-readme.html#handling-lifecycle-events-onevent
* https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html#crpg-ref-responses-physicalresourceid.title

Contributor guide

Open the contributing guide

Research direction

Compare the custom-resources README section linked in the issue with the CloudFormation response guide and the DefinitelyTyped cloudformation-custom-resource.d.ts definition. Determine the authoritative PhysicalResourceId requirement for each lifecycle event, then align the documented guidance and relevant type definition or record the agreed clarification.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, documentation, infrastructure
Issue type
Documentation
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.