compose-cli icon indicating copy to clipboard operation
compose-cli copied to clipboard

More flexibility with merging arrays in x-aws-cloudformation overlays

Open FraserThompson opened this issue 3 years ago • 4 comments

Description

To workaround the lack of sidecar support in docker compose files, I had the idea of simply adding in a definition for a new container to the ContainerDefinitions array on a generated TaskDefinition via the x-aws-cloudformation overlay.

However I found that if I add an element to a YAML array in the overlay, it will replace the entire array with my override rather than appending.

It would make this feature much more powerful if there was some way to control the way the YAML is merged.

It looks like the library used for this is kyaml from kubernetes? I couldn't find any documenation so I'm not sure if this is a feature which is already here, or if this is a feature request.

FraserThompson avatar May 30 '22 03:05 FraserThompson

Implemented in ECS Compose-X since version 0.2, you can define a deploy label ecs.task.family that will logically group services together. i.e.

services:
  nginx:
    deploy:
      labels:
        ecs.task.family: frontend
  some-sidecar:
    deploy:
      labels:
        ecs.task.family: frontend
  backend: {}

will automatically merge these two (nginx, some-sidecar) into the one task definition. All details in these docs

Again, the objective here of compose-x is to remove the necessity to write CFN template for ECS services, and retain CFN syntax for every other aws resources that you want to create/use.

JohnPreston avatar May 31 '22 15:05 JohnPreston

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 08 '23 04:01 stale[bot]

Don't close stupid bot

tkrotoff avatar Jan 10 '23 22:01 tkrotoff

This issue has been automatically marked as not stale anymore due to the recent activity.

stale[bot] avatar Jan 10 '23 22:01 stale[bot]