Requirement Summary:
Trigger an AWS Step Functions state machine (test execution)
Only when a specific AWS CloudFormation stack is deployed
Option A: Create a Lambda function to invoke the state machine
Valid approach: Lambda can be used as an intermediary trigger for Step Functions using the SDK (e.g., StartExecution API).
Offers flexibility (custom filtering, additional logic).
Option B: Create EventBridge rule filtering on UPDATE_IN_PROGRESS
Incorrect: UPDATE_IN_PROGRESS triggers before the stack is fully deployed.
You need to trigger after deployment, such as UPDATE_COMPLETE or CREATE_COMPLETE.
Option C: EventBridge Pipes with Lambda target filtering on UPDATE_IN_PROGRESS
Incorrect for same reason as B (wrong timing).
Also, EventBridge Pipes are not necessary here if you're using rules directly.
Option D: Pipe with EventBridge Rule as source and Step Functions as target
Invalid setup: EventBridge Pipes use event sources, not rules, as input.
This configuration is unsupported.
Option E: Add the state machine as a target of the EventBridge rule
Direct and low-overhead approach.
EventBridge natively supports Step Functions as a target.
You can trigger the state machine without a Lambda if the filter matches (e.g., ResourceStatus = CREATE_COMPLETE, with the correct StackId).
Step Functions as EventBridge target: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-target-step-functions.html
EventBridge CloudFormation events: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-listing-event-history.html
StartExecution API: https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html