Vandeperre Maarten
Vandeperre Maarten

Reputation: 576

YAML properties from AWS ECS-CLI compose are not documented

All,

I'm trying to automate my AWS ECS cluster setup via scripting. I found the AWS ecs-cli to create task definitions and it's corresponding documentation:

I am able to create task definition and log group with the following two docker-compose files

1)service-security-docker-compose.yml

version: '3'
    services:
      ps-security-service-test:
        image: ...-east-1.amazonaws.com/security:latest
        ports:
          - "8080:80"
        logging:
          driver: awslogs
          options:
            awslogs-group: /ecs/20200208-security
            awslogs-region: us-east-1
            awslogs-stream-prefix: ecs

2)service-security-ecs-params.yml

version: 1
task_definition:
  services:
    ps-security-service-test:
      mem_limit: 750MB

This configuration creates a task definition with the name "service". I would like to change the name and have a look which other parameters can be set with the yaml configuration.

At this point I got blocked as I can't find which properties I can use to e.g. set the name of the task definition/service.

Does someone know where to find the yaml configuration documentation?

Upvotes: 0

Views: 1122

Answers (3)

Vandeperre Maarten
Vandeperre Maarten

Reputation: 576

With the answers posted above, I could find the answer. First of all, these are indeed the pages where you can find information about all the possible parameters:

  1. https://docs.docker.com/compose/compose-file/#versioning
  2. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-compose-up.html
  3. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-compose-ecsparams.html

Then I still had the issue that I couldn't configure the family property of the task definition. When I looked at the example of https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-compose-up.html I saw that the yaml files where not defining the family name that was mentioned in the displayed console log. Like that I found out that the "family" property is set by the "--project-name" parameter of the cli command.

Upvotes: 0

lasleyd
lasleyd

Reputation: 174

AWS did release support for v3 of docker compose syntax so your first stop is here. Important to note, however, AWS is not aligned with the latest v3 release (3.7) so anything that doesn't yet work is probably noted in the AWS Container Roadmap. You can also find specifics about Task Definition on this section of the ECS docs.

So, in summary:

  1. Start with v3 docker compose format
  2. Specific to the task definition, try family which per the docs is "similar to a name for multiple versions of the task definition, specified with a revision number"
  3. If that doesn't get you where you need to be, log an issue on GitHub linked above

Upvotes: 1

Mark B
Mark B

Reputation: 200850

The ECS CLI docker-compose file is documented here and here.

The ECS params file is documented here.

Upvotes: 0

Related Questions