按照 AWS 文档中的步骤操作
https://docs.aws.amazon.com/step-functions/latest/dg/sfn-local-lambda.html
使用 aws-stepfuncitons-local docker 容器
我在最后一步收到连接被拒绝的错误
2019-05-28 12:37:05.004: arn:aws:states:us-east-1:123456789012:execution:HelloWorld:test :
{
"Type":"ExecutionFailed",
"PreviousEventId":5,
"ExecutionFailedEventDetails":
{
"Error":"Lambda.SdkClientException",
"Cause":"Unable to execute HTTP request: Connect to 127.0.0.1:3001 [/127.0.0.1] failed: Connection refused (Connection refused)"
}
}
任何有关如何解决它的帮助将不胜感激。
最佳答案
docker 容器无法与主机网络上的服务通信。要使其正常工作,您需要添加“--network host”。
例子:
docker run -p 8083:8083 --network host --env-file aws-stepfunctions-local-credentials.txt amazon/aws-stepfunctions-local
更多详情here和 here
关于amazon-web-services - Step Functions AWS SAM CLI 本地连接被拒绝错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56342683/