Skip to content

Commit

Permalink
Fixed README
Browse files Browse the repository at this point in the history
  • Loading branch information
PettitWesley committed Aug 22, 2018
1 parent eba0453 commit a872cfe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ task_definition:
mem_reservation: string
docker_volumes:
- name: string
scope: string ("shared" or "task")
autoprovision: boolean (only valid if scope = "shared")
scope: string // Valid values: "shared" | "task"
autoprovision: boolean // only valid if scope = "shared"
driver: string
driver_opts:
string: string
Expand Down Expand Up @@ -468,21 +468,7 @@ Fields listed under `task_definition` correspond to fields that will be included
* 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.
* If you are using a private repository for pulling images, `repository_credentials` allows you to specify an AWS Secrets Manager secret ARN for the name of the secret containing your private repository credentials as a `credential_parameter`.

* `docker_volumes` allows you to create volumes with a [DockerVolumeConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-volumes.html). The volumes can be referenced in your compose file by name, even if they were not also specified in the compose file.

Example `ecs-params.yml` with service resources specified:
```
version: 1
task_definition:
services:
wordpress:
cpu_shares: 100
mem_limit: 500m
mysql:
cpu_shares: 105
mem_limit: 500m
mem_reservation: 450m
```
* `docker_volumes` allows you to create docker volumes. The name key is required, and `scope`, `autoprovision`, `driver`, `driver_opts` and `labels` correspond with the fields under [dockerVolumeConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-volumes.html) in an ECS Task Definition. Volumes defined with the `docker_volumes` key can be referenced in your compose file by name, even if they were not also specified in the compose file.

* `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.

Expand Down Expand Up @@ -516,8 +502,20 @@ task_definition:
ecs_network_mode: host
task_role_arn: myCustomRole
services:
my_service:
logging:
essential: false
wordpress:
cpu_shares: 100
mem_limit: 500m
mysql:
cpu_shares: 105
mem_limit: 500m
mem_reservation: 450m
docker_volumes:
- name: database_volume
scope: shared
autoprovision: true
driver: local
```

Example `ecs-params.yml` with network configuration with **EC2** launch type:
Expand Down
2 changes: 1 addition & 1 deletion ecs-cli/modules/utils/compose/convert_task_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func mergeVolumesWithoutHost(composeVolumes []string, ecsParams *ECSParams) ([]*
if dockerVol.Name != "" {
volumesWithoutHost[dockerVol.Name] = dockerVol
} else {
return nil, fmt.Errorf("docker_volume.name is a required field")
return nil, fmt.Errorf("Name is required when specifying a docker volume")
}
}
}
Expand Down

0 comments on commit a872cfe

Please sign in to comment.