Skip to content

feat: Chaining / Extending / Merging config files #48

@jkirkpatrick24

Description

@jkirkpatrick24

Hey there 👋

I think it would be really excellent to support extending or merging teller config files. As we've begun to use teller more and more, we've found that often we need to have a teller config file for different environment. This would be similar to how chamber works with chaining services. The reason for this is sometimes in deployment context, our environment configuration will come from different providers.

An example of this would be a DATABASE_URL. If I am deploying my application on heroku, and using their database extensions, this variable will be accessible from the heroku provider, and thats where the app should consume it from. In other deployment/development contexts, I would want to access this variable from another provider. (e.g the AWS SSM param store).

For a situation like this, I end up with config files that look like this:

project: hello-world-production
providers:
  aws_ssm:
    env:
      SECRET_KEY:
        path: /{{project}}/{{environment}}/secret_key
        decrypt: true
  heroku:
    env:
      DATABASE_URL:
        path: hello-world-{{environment}}

and:

project: hello-world-production
providers:
  aws_ssm:
    env:
      SECRET_KEY:
        path: /{{project}}/{{environment}}/secret_key
        decrypt: true
      DATABASE_URL:
        path: /{{project}}/{{environment}}/database_url
        decrypt: true

The problem with this is the duplication of env declarations across files. I need to define SECRET_KEY in both files. It would be amazing we could avoid this duplication by merging configs in some way. An example of this could look like

Core configuration shared across environments:

// .teller.yml
project: hello-world-production
providers:
  aws_ssm:
    env:
      SECRET_KEY:
        path: /{{project}}/{{environment}}/secret_key
        decrypt: true

and production specific file:

// .teller.deploy.yml
providers:
  heroku:
    env:
      DATABASE_URL:
        path: /{{project}}/{{environment}}/database_url
        decrypt: true

Run teller:

teller run -c .teller.yml -c .teller.deploy.yml -- my command

This would merge the above files and inject both the SECRET_KEY and DATABASE_URL environment variables.

Hopefully that explains the issue well! Happy to answer any questions about this! Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions