1 回答
- 最新
- 投票最多
- 评论最多
0
【以下的回答经过翻译处理】 你好,Andrius,
我已经能够重现你的测试案例,并更新为一个可用的示例:
docker run -p 8083:8083 -e AWS_DEFAULT_REGION=xx-yyyy-1 -e AWS_ACCESS_KEY_ID=TESTID -e AWS_SECRET_ACCESS_KEY=TESTKEY -e STEP_FUNCTIONS_ENDPOINT=http://localhost:8083 amazon/aws-stepfunctions-local:1.10.1
(与你的示例相比,做了两个更改:第一、地域故意设为无效;第二、真正有效的解决方案是:定义' STEP_FUNCTIONS_ENDPOINT '环境变量为服务本身)
然后,你的示例能够运行,只需要根据所在地区进行调整:
aws stepfunctions --endpoint-url http://localhost:8083 create-state-machine --definition "{\
\"Comment\": \"A Hello World example of the Amazon States Language using a Pass state\",\
\"StartAt\": \"HelloWorld\",\
\"States\": {\
\"HelloWorld\": {\
\"Type\": \"Pass\",\
\"End\": true\
}\
}}" --name "HelloWorld" --role-arn "arn:aws:iam::012345678901:role/DummyRole"
aws stepfunctions --endpoint-url http://localhost:8083 create-state-machine --definition "{\
\"Comment\": \"OuterTestComment\",\
\"StartAt\": \"InnerInvoke\",\
\"States\": {\
\"InnerInvoke\": {\
\"Type\": \"Task\",\
\"Resource\": \"arn:aws:states:::states:startExecution\",\
\"Parameters\": {\
\"StateMachineArn\": \"arn:aws:states:xx-yyyy-1:123456789012:stateMachine:HelloWorld\"\
},\
\"End\": true\
}\
}}" --name "HelloWorldOuter" --role-arn "arn:aws:iam::012345678901:role/DummyRole"
aws stepfunctions --endpoint-url http://localhost:8083 start-execution --state-machine-arn arn:aws:states:xx-yyyy-1:123456789012:stateMachine:HelloWorldOuter
现在查看执行内容:
aws stepfunctions --endpoint-url http://localhost:8083 list-executions --state-machine-arn arn:aws:states:xx-yyyy-1:123456789012:stateMachine:HelloWorldOuter
{
"executions": [
{
"executionArn": "arn:aws:states:xx-yyyy-1:123456789012:execution:HelloWorldOuter:f2b0c4aa-1b38-4da2-a219-b81b3a40e92e",
"stateMachineArn": "arn:aws:states:xx-yyyy-1:123456789012:stateMachine:HelloWorldOuter",
"name": "f2b0c4aa-1b38-4da2-a219-b81b3a40e92e",
"status": "SUCCEEDED",
"startDate": 1653908224.187,
"stopDate": 1653908224.3
}
]
}
aws stepfunctions --endpoint-url http://localhost:8083 list-executions --state-machine-arn arn:aws:states:xx-yyyy-1:123456789012:stateMachine:HelloWorld
{
"executions": [
{
"executionArn": "arn:aws:states:xx-yyyy-1:123456789012:execution:HelloWorld:5f9e4d20-cbf1-4051-93fd-6c108356d657",
"stateMachineArn": "arn:aws:states:xx-yyyy-1:123456789012:stateMachine:HelloWorld",
"name": "5f9e4d20-cbf1-4051-93fd-6c108356d657",
"status": "SUCCEEDED",
"startDate": 1653908224.284,
"stopDate": 1653908224.286
}
]
}
我们可以观察到,内部执行包含在外部执行中。
相关内容
- AWS 官方已更新 3 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前