-
Notifications
You must be signed in to change notification settings - Fork 4.5k
aws-stepfunctions-tasks: EventBridge aws. event source prefix check is more strict than it should be #30191
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-stepfunctions-tasksbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2
Description
Describe the bug
We discovered that the EventBridgePutEvents is throwing an error even in cases when it's not necessary to throw.
For example our source looks like this aws-some-feature.this.that and according to the docs this should be valid.
All events that come from AWS services begin with "aws."
Whereas in the CDK code of EventBridgePutEvents is this check
if (entry.source?.startsWith('aws')) {The correct implementation should be following
if (entry.source?.startsWith('aws.')) {Expected Behavior
EventBridgePutEvents should not throw an error when source starts with aws. (but not just aws)
Current Behavior
EventBridgePutEvents throws an error when source starts with aws
Reproduction Steps
Use this task in a state machine.
import { EventBridgePutEvents } from 'aws-cdk-lib/aws-stepfunctions-tasks'
new EventBridgePutEvents(
this,
'SendEvent',
{
entries: [
{
eventBus: 'some-event-bus',
source: `aws-feature-name-whatever-you-want`,
detailType: 'some-detail',
detail: TaskInput.fromJsonPathAt('$')
}
]
}
)Possible Solution
to:
- if (entry.source?.startsWith('aws')) {
+ if (entry.source?.startsWith('aws.')) { Additional Information/Context
No response
CDK CLI Version
v2.141.0
Framework Version
No response
Node.js Version
20.x
OS
MacOS (personal) / Ubuntu (in CI)
Language
TypeScript
Language Version
5.4.5
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-stepfunctions-tasksbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2