1
**To register a task definition with a JSON file**
3
This example registers a task definition to the specified family with container definitions that are saved in JSON format at the specified file location.
7
aws ecs register-task-definition --family sleep360 --container-definitions file://<path_to_json_file>/sleep360.json
34
"taskDefinitionArn": "arn:aws:ecs:us-west-2:<aws_account_id>:task-definition/sleep360:2",
35
"containerDefinitions": [
58
**To register a task definition with a JSON string**
60
This example registers a the same task definition from the previous example, but the container definitions are in a string format with the double quotes escaped.
64
aws ecs register-task-definition --family sleep360 --container-definitions "[{\"environment\":[],\"name\":\"sleep\",\"image\":\"busybox\",\"cpu\":10,\"portMappings\":[],\"entryPoint\":[\"/bin/sh\"],\"memory\":10,\"command\":[\"sleep\",\"360\"],\"essential\":true}]"
70
"taskDefinitionArn": "arn:aws:ecs:us-west-2:<aws_account_id>:task-definition/sleep360:3",
71
"containerDefinitions": [