-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event sources do not invoke versioned state machines by their alias #3624
Comments
Hi @aidansteele thanks for reporting this issue. This does look like a bug on our side and the target should be referencing the alias resource and not the statemachine resource. As a workaround for |
Hi @aaythapa thanks for looking into this. I forgot to mention in my initial bug report that I tried that, but it didn't help. Setting the |
I see thanks for letting me know and I can see in the transformed template the arn is still pointing to the statemachine resource and not the alias. Fixing this directly would be backwards incompatible so the best next step is probably introduce the |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Description
I am using the state machine versioning introduced in v1.70.0, specifically the
AutoPublishAlias
property ofAWS::Serverless::StateMachine
. My state machines are invoked by EventBridge via an event source defined on the state machine'sEvents
property. I expect EventBridge to invoke my state machine by its alias ARN, but EventBridge is actually invoking the underlying (i.e. unqualified) ARN. This reduces the utility of state machine versioning and is inconsistent with how versioned Lambda function event sources work in SAM.Steps to reproduce
Let's use the following SAM template as an example
Observed result
The above SAM template is transformed (at the time of writing) into the following template (I have converted JSON back to YAML for ease of reading):
Note that the generated
ExampleMachineMachineExample
resource has a target ARN of!Ref ExampleMachine
, whereas theExampleFunctionLambdaExample
resource has a target ARN of!Ref ExampleFunctionAliaslive
.Expected result
I would expect
ExampleMachineMachineExample
resource has a target ARN of!Ref ExampleMachineAliaslive
. This would mean that the alias actually gets invoked by EventBridge. This would make state machines consistent with Lambda functions.NOTE: I didn't experiment with other event source types (e.g. schedules and API GW) but I would expect them to behave the same way.
The text was updated successfully, but these errors were encountered: