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
165 stars 17 forks source link

[FR] environment variables as stack parameters #680

Closed JohnPreston closed 1 year ago

JohnPreston commented 1 year ago

Some environment variables might be useful to have as parameters to the CFN stack of a given service to make it easy to re-use the existing template and avoid changing/re-generating the template each time.

Suggestions

services:
  serviceA:
    environment:
      first_var: value1
      second_var: value2
    x-environment:
      SetAsParameter:

SetAsParameter would either be a list of the keys to swap as parameters

SetAsParameter:
  - second_var

or allows the user to set the full CFN definition of parameter

SetAsParameter:
  second_var:
    Type: String
    <<: * CFN Parameters Properties

These parameters would be created at the very end of the service template creation to ensure that every other parameter has been set, for CFN resources. With a limit of 200 parameters per stack, if there already were too many parameters, the ones set would come in order as defined in the definition. For example, if there was only 1 parameter available left on the stack, first_var would be set, leaving second_var out

smazurov commented 1 year ago

Looks great to me!