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

New Resource: azurerm_consumption_budget_management_group #14411

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

josh-barker
Copy link
Contributor

This PR creates a new resources for the managing a consumption budget for management groups.

Whilst developing this I found that the schema is slightly different to resource groups and subscriptions.

  • contact_roles are not supported
  • contact_groups are not supported

This then changes the requirements for contact_emails making them mandatory and a minimum of 1 element.

I used go-generate to help create the initial outline for the ID resources, but as management group IDs do not have a subscription, I had to use ParseAzureResourceIDWithoutSubscription.

Addresses #13112

@tombuildsstuff tombuildsstuff changed the title Feat/budget management group New Resource: azurerm_consumption_budget_management_group Dec 1, 2021
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @josh-barker. Overall this looks good, once the docs have been fixed up and the comment on the schema addressed this should be good to go!

internal/services/consumption/schema.go Outdated Show resolved Hide resolved
internal/services/consumption/schema.go Outdated Show resolved Hide resolved

---

A `filter` block supports the following:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A `filter` block supports the following:
A `filter` block exports the following:

@josh-barker
Copy link
Contributor Author

Hey @stephybun,

Thanks for all your feedback.

In the other consumption resources, the reference object is not consistent.

The azurerm_consumption_budget_subscription resource uses subscription_id which is specified as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
However, the azurerm_consumption_budget_resource_group resource uses resource_group_id which is specified as /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/example-rg.

Are you asking the implementation to be changed to this?

  • managment_group_id = "/providers/Microsoft.Management/managementGroups/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  • managment_group_id = azurerm_management_group.example.id

@stephybun
Copy link
Member

Hey @josh-barker,

Apologies I should have clarified further, the implementation should be changed to use the management group resource ID, so this form:
managment_group_id = "/providers/Microsoft.Management/managementGroups/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

@johnroach
Copy link

Thank you @josh-barker really need this! Can't wait for this to be merged. Please do reach out if you need any help!

@josh-barker
Copy link
Contributor Author

Hey @stephybun, I've implemented all of your requested changes except for the request to change supports to exports as the documentation is under the Arguments Reference heading.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josh-barker, LGTM 👍🏼

@stephybun stephybun merged commit 1020f43 into hashicorp:main Dec 9, 2021
@github-actions github-actions bot added this to the v2.89.0 milestone Dec 9, 2021
stephybun added a commit that referenced this pull request Dec 9, 2021
@josh-barker josh-barker deleted the feat/budget-management-group branch December 9, 2021 22:25
@github-actions
Copy link

This functionality has been released in v2.89.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants