Skip to main content

AWS Step Functions

Basic example of AWS Step Functions

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set aws-ts-stepfunctions
cd pulumi-examples/aws-ts-stepfunctions

A basic example that demonstrates using AWS Step Functions with a Lambda function.

This example also utilizes our Stack Readme feature. You can view the stack readme by going to the console by running pulumi console and selecting the README tab. See the stack-readme-ts example for a more detailed example.

Prerequisites#

  1. Install Pulumi
  2. Configure AWS credentials
  3. Install Node.js

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init stepfunctions-dev
  2. Set the AWS region:

    Terminal window
    pulumi config set aws:region us-east-2
  3. Install dependencies:

    Terminal window
    npm install
  4. Preview and deploy the changes:

    Terminal window
    pulumi up
  5. Start an execution using the AWS CLI (or from the console at https://console.aws.amazon.com/states):

    Terminal window
    aws stepfunctions start-execution --state-machine-arn $(pulumi stack output stateMachineArn)

Cleaning up#

Once you’re done, destroy the resources and remove the stack:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.