compose-x / ecs_composex

Manage, Configure and Deploy your services and AWS services and applications from your docker-compose definitions
https://docs.compose-x.io
Mozilla Public License 2.0
164 stars 17 forks source link

[FR] Set return values directly in services `environment` #605

Closed JohnPreston closed 2 years ago

JohnPreston commented 2 years ago

As a user I currently have to set the ReturnValues at the Services level for a given resource, such as

services:
  my-service: {}

x-s3:
  bucket:
    Services:
      my-service:
        Access: {}
        ReturnValues:
          BucketName: MY_SUPER_BUCKET

I would like to be able to do something simpler, as follows

x-s3:
  bucket: {}

services:
  my-service:
    environment:
      MY_SUPER_BUCKET: x-s3::bucket::BucketName
  my-other-service:
    environment:
      - "MY_SUPER_BUCKET=x-s3::bucket::BucketName"

We get a 3 parts value

x-<module>::<resource_name>::<ReturnValue>

ECS Compose-X would automatically set the env-var appropriately.

In case of conflict, for a same env var key (i.e here MY_SUPER_BUCKET), the value set from services.environment should takes precedence?