The only way to bind the task to the host is to do it through the AWS CLI with the initial task: http://docs.aws.amazon.com/cli/latest/reference/ecs/start-task.html
ECS Cloudformation, CFT . CFT:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Curator runner",
"Parameters": {
"CpuUnits": {
"Type": "Number",
"Default": 0,
"Description": "The number of CPU Units to allocate."
},
"Memory": {
"Type": "Number",
"Default": 256,
"Description": "The amount of Memory (MB) to allocate."
},
"ClusterName": {
"Type": "String",
"Description": "The cluster to run the ecs tasks on."
},
"DockerImageUrl": {
"Type": "String",
"Description": "The URL for the docker image. Example: 354500939573.dkr.ecr.us-east-1.amazonaws.com/something:latest"
}
},
"Resources": {
"SomeTask": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"ContainerDefinitions": [{
"Memory": {
"Ref": "Memory"
},
"Name": "something",
"Image": {
"Ref": "DockerImageUrl"
},
"Cpu": {
"Ref": "CpuUnits"
}
}],
"Volumes": []
}
},
"service": {
"Type": "AWS::ECS::Service",
"Properties": {
"Cluster": {
"Ref": "ClusterName"
},
"DesiredCount": "1",
"TaskDefinition": {
"Ref": "SomeTask"
}
}
}
}
}