简体   繁体   English

未记录来自 AWS ECS-CLI compose 的 YAML 属性

[英]YAML properties from AWS ECS-CLI compose are not documented

All,全部,

I'm trying to automate my AWS ECS cluster setup via scripting.我正在尝试通过脚本自动化我的 AWS ECS 集群设置。 I found the AWS ecs-cli to create task definitions and it's corresponding documentation:我找到了 AWS ecs-cli 来创建任务定义及其相应的文档:

I am able to create task definition and log group with the following two docker-compose files我可以使用以下两个 docker-compose 文件创建任务定义和日志组

1)service-security-docker-compose.yml 1)服务安全-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 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".此配置创建一个名为“service”的任务定义。 I would like to change the name and have a look which other parameters can be set with the yaml configuration.我想更改名称并查看可以使用 yaml 配置设置哪些其他参数。

At this point I got blocked as I can't find which properties I can use to eg set the name of the task definition/service.在这一点上,我被阻止了,因为我找不到可以使用哪些属性来设置任务定义/服务的名称。

Does someone know where to find the yaml configuration documentation?有人知道在哪里可以找到 yaml 配置文档吗?

AWS did release support for v3 of docker compose syntax so your first stop is here . AWS 确实发布了对 docker compose 语法 v3 的支持,因此您的第一站就在这里 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 .但是,需要注意的是,AWS 并未与最新的 v3 版本 (3.7) 保持一致,因此AWS Container Roadmap 中可能会注明尚不可用的任何内容。 You can also find specifics about Task Definition on this section of the ECS docs.您还可以在 ECS 文档的这一部分找到有关任务定义的详细信息。

So, in summary:所以,总结一下:

  1. Start with v3 docker compose format从 v3 docker compose 格式开始
  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"特定于任务定义,请尝试根据文档的family是“类似于任务定义的多个版本的名称,用修订号指定”
  3. If that doesn't get you where you need to be, log an issue on GitHub linked above如果这不能让您到达需要的位置,请在上面链接的 GitHub 上记录问题

The ECS CLI docker-compose file is documented here and here . ECS CLI docker-compose 文件记录在此处此处

The ECS params file is documented here . ECS 参数文件记录在此处

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 https://docs.docker.com/compose/compose-file/#versioning
  2. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-compose-up.html 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 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.当我查看https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cmd-ecs-cli-compose-up.html的示例时,我看到 yaml 文件没有定义家族名称在显示的控制台日志中提到。 Like that I found out that the "family" property is set by the "--project-name" parameter of the cli command.就像那样,我发现“family”属性是由 cli 命令的“--project-name”参数设置的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM