I have a very simple workflow using Fargate containers. The containers simply return inputs. Workflow Input is:
{
"value": "FALSE"
}
How can I pass the starting parameter to this Task ?
{
"Comment": "A description of my state machine",
"StartAt": "Choice",
"States": {
"Choice": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.value",
"StringEquals": "FALSE",
"Next": "ECS RunTask-FALSE"
}
],
"Default": "ECS RunTask-TRUE"
},
"ECS RunTask-FALSE": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"LaunchType": "FARGATE",
"Cluster": "arn:aws:ecs:us-east-2:xxxxxxxxxxx:cluster/portal",
"TaskDefinition": "arn:aws:ecs:us-east-2:xxxxxxxxxxx:task-definition/simple:4",
"Overrides": {
"ContainerOverrides": [
{
"Name": "simple",
"Command": ["$.value"]
}
]
},
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"Subnets": [
"subnet-001f85595e8af43cf",
"subnet-05e742358ac59ae04"
],
"SecurityGroups": [
"sg-0948e5328861ae667"
],
"AssignPublicIp": "ENABLED"
}
}
},
"End": true
},
"ECS RunTask-TRUE": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"LaunchType": "FARGATE",
"Cluster": "arn:aws:ecs:us-east-2:xxxxxxxxxxx:cluster/portal",
"TaskDefinition": "arn:aws:ecs:us-east-2:xxxxxxxxxxx:task-definition/simple:4",
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"Subnets": [
"subnet-001f85595e8af43cf",
"subnet-05e742358ac59ae04"
],
"SecurityGroups": [
"sg-0948e5328861ae667"
],
"AssignPublicIp": "ENABLED"
}
}
},
"End": true
}
}
}
"Command.$": "States.Array($.value)"
Parameters: For key-value pairs where the value is selected using a path, the key name must end in .$
.
States.Array Intrinsic Function: The interpreter returns a JSON array containing the values of the arguments in the order provided.