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

Global variables with defaults? #110

Open
yorinasub17 opened this issue Jun 30, 2022 · 0 comments
Open

Global variables with defaults? #110

yorinasub17 opened this issue Jun 30, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@yorinasub17
Copy link
Contributor

Describe the solution you'd like
There are cases where certain variables are needed across the entire repo, and oftentimes the default value is the same. E.g., in our architecture catalog, the AWSAccount, IsEnvCommon, IncludeCommonVars, etc.

Right now, boilerplate requires that each of these variables be defined in every single boilerplate template config if they need to be set with a default. This can lead to a lot of duplication.

Describe alternatives you've considered

The only workaround I can think of is to have a default varfile when invoking boilerplate. This takes advantage of the fact that boilerplate variable definitions are not strict (as in, you can pass in and reference variables that are not defined in boilerplate.yml).

So you can do this by convention: essentially, you have a file that defines the global variables that all boilerplate templates can reference by convention.

The downsides of this approach are:

  • You have to make sure that the variables are passed in when invoking boilerplate.
  • Since it's by convention, it can be difficult to orient oneself as there is room for many different projects to adopt different ways of achieving this.

Additional context
Originally requested by a customer.

Also see #65 for past discussion on a similar feature.

@yorinasub17 yorinasub17 added the enhancement New feature or request label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant