Slide 51
Slide 51 text
© 2020, Amazon Web Services, Inc. or its Affiliates.
ECS スタンドアロンタスクの成功終了保証 w/ Step Functions
{
"StartAt": "Run an ECS Task and wait for it to complete successfully",
"States":{
"Run an ECS Task and wait for it to complete successfully":{
"Type":"Task",
"Resource":"arn:aws:states:::ecs:runTask.sync",
"Parameters":{
"LaunchType":"FARGATE",
"Cluster":"arn:aws:ecs:us-west-2:123456789012:cluster/my-cluster",
"TaskDefinition":"arn:aws:ecs:us-west-2:123456789012:task-definition/my-task:1",
"Overrides":{
"ContainerOverrides":[{
"Name":"my-container",
"Environment":[{
"Name":"SOME_VALUE",
"Value.$":"$.some_value"
}]
}]}},
"Retry":[{
"ErrorEquals":["States.TaskFailed"],
"IntervalSeconds":3,
"MaxAttempts":3,
"BackoffRate":1.5 }],
"End":true }}}
1. Manage Amazon ECS or Fargate Tasks with Step Functions: https://docs.aws.amazon.com/step-functions/latest/dg/connect-ecs.html
2. Error Handling in Step Functions: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
例: ECS タスクの処理が失敗した際に最⼤3回までリトライする Step Functions のステートマシンの定義