# Step Function --- ![Stability: Stable](https://img.shields.io/badge/stability-Stable-success.svg?style=for-the-badge) > **This is a stable example. It should successfully build out of the box** > > This example is built on Construct Libraries marked "Stable" and does not have any infrastructure prerequisites to build. --- This example creates a new step function which calls a series of lambda functions to process an event. This project is intended to be sample code only. Not for use in production. This project will create the following in your AWS cloud environment: - Two Lambda functions - One Lambda function will simulate processing an event and returns a SUCCESS status - The other Lambda function will interpret the event returned by the first Lambda, and return a final SUCCESS status - Step Function State Machine which invokes the above Lambdas to process an event - Roles and policies allowing appropriate access to these resources ## Setup The `cdk.json` file tells the CDK Toolkit how to execute your app. The `go.mod` file defines the module's path and dependency requirements. To download the dependencies locally, run `go mod download`. ## Deploy Run `cdk deploy`. This will deploy / redeploy your Stack to your AWS Account. ## Testing Test the Step Function via the AWS console by navigating to the State machine that was created. Click on "Start execution". This will bring you to the Graph view of the state machine, outlining the various states and input/output that is passed throughout. To test via the AWS CLI, run the following command. `` will be logged at end of the deployment during cdk deploy. Note that this requires AWS CLI v2. ```bash aws stepfunctions start-execution --state-machine-arn "" ``` This command will output an execution ARN. Please allow the execution to run for a few seconds before running the following command. ```bash aws stepfunctions describe-execution --execution-arn "" ``` ## Synthesize Cloudformation Template To see the Cloudformation template generated by the CDK, run `cdk synth`, then check the output file in the "cdk.out" directory. # Useful commands - `cdk ls` list all stacks in the app - `cdk synth` emits the synthesized CloudFormation template - `cdk deploy` deploy this stack to your default AWS account/region - `cdk diff` compare deployed stack with current state - `cdk docs` open CDK documentation