Skip to content

fourTheorem/sfn-localstack

Repository files navigation

Simple Localstack Step Function Mock example

  1. Start LocalStack, loading the Mock Configuration File
LOCALSTACK_SFN_MOCK_CONFIG=/tmp/MockConfigFile.json localstack start --volume $PWD/MockConfigFi
le.json:/tmp/MockConfigFile.json
  1. Deploy the application
cdklocal bootstrap

cdklocal deploy --require-approval=never 
  1. Invoke the state machine, specifying the test case name using a special ARN suffix:
awslocal stepfunctions start-execution \
    --state-machine arn:aws:states:us-east-1:000000000000:stateMachine:MyStateMachine#BaseCase \
    --input '{"name": "John", "surname": "smith"}' \
    --name "MockExecutionBaseCase" --region us-east-1

⚠️ The test case name (BaseCase) must match the name of the test case in MockConfigFile.json. Otherwise, LocalStack will try to invoke a real Lambda function, which does not exist!

📌 See Run Test Cases with Mocked Integrations in the LocalStack documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published