Skip to content

Commit fbcac16

Browse files
committed
Add ecs-params service resource fields to README
1 parent bfea559 commit fbcac16

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ task_definition:
422422
services:
423423
<service_name>:
424424
essential: boolean
425+
cpu_shares: integer
426+
mem_limit: string
427+
mem_reservation: string
425428
426429
run_params:
427430
network_configuration:
@@ -441,8 +444,24 @@ Fields listed under `task_definition` correspond to fields that will be included
441444

442445
* `task_role_arn` should be the ARN of an IAM role. **NOTE**: If this role does not have the proper permissions/trust relationships on it, the `up` command will fail.
443446

444-
* `services` correspond to the services listed in your docker compose file, with `service_name` matching the name of the container you wish to run. Its fields will be merged into an [ECS Container Definition](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html).
445-
The only field you can specify on it is `essential`. The default value for the essential field is true.
447+
* `services` correspond to the services listed in your docker compose file, with `service_name` matching the name of the container you wish to run. Its fields will be merged into an [ECS Container Definition](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html).
448+
* If the [`essential`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-essential) field is not specified, the value defaults to true.
449+
* If you are using Docker compose version 3, the `cpu_shares`, `mem_limit`, and `mem_reservation` fields are optional and must be specified in the ECS params file rather than the compose file.
450+
* In Docker compose version 2, the `cpu_shares`, `mem_limit`, and `mem_reservation` fields can be specified in either the compose or ECS params file. If they are specified in the ECS params file, the values will override values present in the compose file.
451+
452+
Example `ecs-params.yml` with service resources specified:
453+
```
454+
version: 1
455+
task_definition:
456+
services:
457+
wordpress:
458+
cpu_shares: 100
459+
mem_limit: 500m
460+
mysql:
461+
cpu_shares: 105
462+
mem_limit: 500m
463+
mem_reservation: 450m
464+
```
446465

447466
* `task_execution_role` should be the ARN of an IAM role. **NOTE**: This field is required to enable ECS Tasks to be configured with Cloudwatch Logs, or to pull images from ECR for your tasks.
448467

0 commit comments

Comments
 (0)