Skip to content

docs(events): add examples for RuleTargetInput and EventField - #38470

Open
krantboy wants to merge 2 commits into
aws:mainfrom
krantboy:docs/events-input-transformer-examples
Open

docs(events): add examples for RuleTargetInput and EventField#38470
krantboy wants to merge 2 commits into
aws:mainfrom
krantboy:docs/events-input-transformer-examples

Conversation

@krantboy

@krantboy krantboy commented Aug 2, 2026

Copy link
Copy Markdown

Issue # (if applicable)

Closes #11210.

Reason for this change

RuleTargetInput already supports everything the issue asks for, but it was
undocumented. input.ts carried no examples at all, so the generated
RuleTargetInput API page
listed four factory methods with no indication of what to pass or what they produce.
The README did show RuleTargetInput in use, but only inside a CodeCommit walkthrough
and without a section of its own, so it read as a detail of that example rather than a
general capability, and it did not say which CloudFormation property each factory
method produces.

Description of changes

Documented on RuleTargetInput the three CloudFormation shapes it abstracts over
(Input, InputPath, InputTransformer) and when each is synthesized, and added an
@example to fromText(), fromMultilineText(), fromObject() and
fromEventPath(). The fromObject() example shows the method both with and without
EventField, since that is what decides between a literal Input and an
InputTransformer. Also documented on EventField how referenced paths become
InputPathsMap entries with <key> placeholders in the InputTemplate.

Added a short README section so the capability is discoverable from the module docs.
It notes that the prop accepting a RuleTargetInput is named per target (event on
LambdaFunction, message on SnsTopic) and that some targets such as EcsTask
shape their input differently.

Describe any new or updated permissions being added

None.

Description of how you validated changes

Documentation only, no runtime behavior affected. aws-cdk-lib builds and
run-rosetta.sh passes, so the new examples compile and translate to all target
languages. The synthesized values shown in the examples match the expectations in
aws-events/test/input.test.ts.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

`input.ts` carried no examples, so the generated API reference listed the
factory methods with no indication of what to pass or what they produce.

Add an example to each factory method, document the three CloudFormation
shapes `RuleTargetInput` abstracts over, and add a section to the aws-events
README so the capability is discoverable from the module docs.

Closes aws#11210
@github-actions github-actions Bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Aug 2, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team August 2, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aws-events] Clarify inputTransformer in docs

1 participant