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

Allow for declaring default properties that will be added to all resources declared in a bicep file/project #1639

Open
JustinGrote opened this issue Feb 26, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@JustinGrote
Copy link

JustinGrote commented Feb 26, 2021

Is your feature request related to a problem? Please describe.
A common issue is needing to assign tags and location to multiple resources (and resources in submodules) that results in a lot of boilerplate code and potential mistakes (especially with tags) if it is forgotten on one or more resources. Nearly every resource has this tag/location definition and leads to a lot of cut/paste non-DRY that the README states is the goal of bicep to reduce.

Describe the solution you'd like

  1. A location bicep keyword (similar to module) that will apply to all resources where location is relevant so it can be omitted. Potentially a schema keyword that if defined as resourceGroup the location would automatically be implicit as resourcegroup().location. If location is defined on a resource it overrides the default location setting.
  2. A tags keyword that can be defined at any level and will flow to resources in the same file and downstream modules where tags can be defined and will be merged with any downlevel tags definitions. Potential Issue: How to override tags at a resource level if you want to explicitly override rather than merge. Special tag name perhaps? e.g. __BICEP_DO_NOT_INHERIT: true

EDIT: This is partially covered in a downstream conversation for #1121

@JustinGrote JustinGrote added the enhancement New feature or request label Feb 26, 2021
@ghost ghost added the Needs: Triage 🔍 label Feb 26, 2021
@alex-frankel alex-frankel changed the title "tags" and "location" top level operators to reduce boilerplate Allow for declaring default properties that will be added to all resources declared in a bicep file/project Mar 4, 2021
@alex-frankel
Copy link
Collaborator

Definitely could be a useful feature and we've discussed in the past. We will need to have more conversations on priority for this further down the road. Not likely for 0.4.

@JustinGrote
Copy link
Author

@alex-frankel sounds good, I think if we focus on being able to "splat" properties between modules that would go a long way to reducing the boilerplate, this would just be icing on top.

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

2 participants