SIGN IN SIGN UP

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.

0 0 125 Java
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# snippet-start:[python.example_code.sfn.Hello]
import boto3
def hello_stepfunctions(stepfunctions_client):
"""
Use the AWS SDK for Python (Boto3) to create an AWS Step Functions client and list
the state machines in your account. This list might be empty if you haven't created
any state machines.
This example uses the default settings specified in your shared credentials
and config files.
:param stepfunctions_client: A Boto3 Step Functions Client object.
"""
print("Hello, Step Functions! Let's list up to 10 of your state machines:")
state_machines = stepfunctions_client.list_state_machines(maxResults=10)
for sm in state_machines["stateMachines"]:
print(f"\t{sm['name']}: {sm['stateMachineArn']}")
if __name__ == "__main__":
hello_stepfunctions(boto3.client("stepfunctions"))
# snippet-end:[python.example_code.sfn.Hello]