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

scope() function to support multi-scope modules #10131

Open
flanakin opened this issue Mar 17, 2023 · 2 comments
Open

scope() function to support multi-scope modules #10131

flanakin opened this issue Mar 17, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@flanakin
Copy link
Member

Is your feature request related to a problem? Please describe.
Some resources support multiple scopes, like Cost Management budgets and scheduled actions. The modules for these features are identical, except for any specific handling around the scope. In some cases, we need specific logic based on the scope ID, but this requires different logic for each scope:

// For subscriptions...
var scopeId = subscription().id
// For resource groups...
var scopeId = resourceGroup().id
// For management groups...
var scopeId = managementGroup().id

Since these functions all work differently for each scope, it's not possible to reuse the same code for each scoped module.

Describe the solution you'd like
Create a scope() function that is an alias for the scope the deployment is run for.

@flanakin flanakin added the enhancement New feature or request label Mar 17, 2023
@ghost ghost added the Needs: Triage 🔍 label Mar 17, 2023
@alex-frankel alex-frankel added this to the Committed Backlog milestone Mar 22, 2023
@alex-frankel
Copy link
Collaborator

Related to #788

@anthony-c-martin
Copy link
Member

Also related to #4698

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

3 participants