I have a step function where I want to start by getting the resourceArn for an ECS Cluster and then invoke tasks on that cluster.
However, I'm having difficulty dynamically passing the arn from step to step.
{
"StartAt": "GetArnLambda",
"States": {
"GetArnLambda": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:AWS_ACCOUNT_ID:function:FUNCTION_NAME",
"Next": "ecs_task"
},
"ecs_task": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"Cluster": "$.arn",
"TaskDefinition": "ecs_task_def"
},
"End": true
}
}
And I get as output from GetArnLambda
{
"name": "GetArnLambda",
"output": {
"arn": "arn:aws:ecs:us-east-1:AWS_ACCOUNT_ID:cluster/CLUSTER_NAME"
}
}
But this interprets the Cluster arn as "$.arn". How can I reference the arn I just received from the first task?