Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default parameters for modules in astro.yaml #57

Open
btromanova opened this issue Jan 3, 2020 · 0 comments
Open

Default parameters for modules in astro.yaml #57

btromanova opened this issue Jan 3, 2020 · 0 comments

Comments

@btromanova
Copy link
Contributor

Sometimes we have to add the same configuration to all the modules, it'd be great if astro
allows to specify default values that apply for everything and can be overwritten if needed.

Having an ability to specify default values for modules has the following advantages:

  • eliminate code duplication
  • prevent human errors (oops, I forgot to add this line to a new module)
  • central place for further configuration changes

Proposed example:
without default parameters:

---

terraform:
  version: <>

modules:
  - name: module1
    remote:
      backend_config:
        bucket: bucket
        region: us-east-1
        key: module1
        dynamodb_table: table

  - name: module2
    remote:
      backend_config:
        bucket: bucket
        region: us-west-1
        key: module2
        dynamodb_table: table

With default parameters

---

terraform:
  version: <>

default:
  remote:
    backend_config:
      bucket: bucket
      region: us-east-1
      dynamodb_table: table

modules:
  - name: module1
    remote:
      backend_config:
        key: module1

  - name: module2
    remote:
      backend_config:
        key: module2
        region: us-west-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant