为 Step Functions Local 设置配置选项 - Amazon Step Functions
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

为 Step Functions Local 设置配置选项

使用 JAR 文件启动 Amazon Step Functions Local 时,可以使用 Amazon Command Line Interface (Amazon CLI) 来设置配置选项,也可以通过在系统环境中包含这些选项来设置。对于 Docker,您必须在启动 Step Functions Local 时引用的文件中指定这些选项。

配置选项

将 Step Functions Local 容器配置为使用 Lambda 端点和 Batch 端点等覆盖端点并调用该端点时,Step Functions Local 不会使用您指定的凭证。设置这些端点覆盖是可选的。

选项 命令行 环境
账户 -account, --aws-account AWS_ACCOUNT_ID
区域 -region, --aws-region AWS_DEFAULT_REGION
等待时间比例 -waitTimeScale, --wait-time-scale WAIT_TIME_SCALE
Lambda 端点 -lambdaEndpoint, --lambda-endpoint LAMBDA_ENDPOINT
Batch 端点 -batchEndpoint, --batch-endpoint BATCH_ENDPOINT
DynamoDB 端点 -dynamoDBEndpoint, --dynamodb-endpoint DYNAMODB_ENDPOINT
ECS 端点 -ecsEndpoint, --ecs-endpoint ECS_ENDPOINT
Glue 端点 -glueEndpoint,--glue-endpoint GLUE_ENDPOINT
SageMaker 端点 -sageMakerEndpoint,--sagemaker-endpoint SAGE_MAKER_ENDPOINT
SQS 端点 -sqsEndpoint,--sqs-endpoint SQS_ENDPOINT
SNS 端点 -snsEndpoint,--sns-endpoint SNS_ENDPOINT
Step Functions 端点 -stepFunctionsEndpoint, --step-functions-endpoint STEP_FUNCTIONS_ENDPOINT

Docker 的凭证和配置

要为 Docker 配置 Step Functions Local,请创建以下文件:aws-stepfunctions-local-credentials.txt

此文件包含您的凭证以及其他配置选项。创建 aws-stepfunctions-local-credentials.txt 文件时,以下内容可用作模板。

AWS_DEFAULT_REGION=AWS_REGION_OF_YOUR_AWS_RESOURCES AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_KEY WAIT_TIME_SCALE=VALUE LAMBDA_ENDPOINT=VALUE BATCH_ENDPOINT=VALUE DYNAMODB_ENDPOINT=VALUE ECS_ENDPOINT=VALUE GLUE_ENDPOINT=VALUE SAGE_MAKER_ENDPOINT=VALUE SQS_ENDPOINT=VALUE SNS_ENDPOINT=VALUE STEP_FUNCTIONS_ENDPOINT=VALUE

aws-stepfunctions-local-credentials.txt 中配置您的凭证和配置选项后,使用以下命令启动 Step Functions。

docker run -p 8083:8083 --env-file aws-stepfunctions-local-credentials.txt amazon/aws-stepfunctions-local
注意

建议使用特殊的 DNS 名称 host.docker.internal,该名称可解析为主机使用的内部 IP 地址,例如 http://host.docker.internal:8000。有关更多信息,请分别参阅 Mac 版 Docker 文档和 Windows 版 Docker 文档:Networking features in Docker Desktop for MacNetworking features in Docker Desktop for Windows