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

azurerm_role_management_policy - notification_rules are no longer Optional/Computed and removing the block will reset them back to the default values provided by Azure #28877

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mbfrahry
Copy link
Member

This PR prevents the default notification rules from being set into state.

This is to get around a recurring issue when removing an Optional/Computed block from the config file and Terraform leaving the block as it is currently in state instead of sending a request to remove the block to the api.

By not setting the default values into state, we have much finer control over when to update notification_rules and have the ability to reset those values back to the defaults Azure initially had them as

`, r.resourceGroupTemplate(data), data.RandomString)
}

func (r RoleManagementPolicyResource) resourceGroupUpdateUpdateRemovedNestedNotificationRules(data acceptance.TestData) string {
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
func (r RoleManagementPolicyResource) resourceGroupUpdateUpdateRemovedNestedNotificationRules(data acceptance.TestData) string {
func (r RoleManagementPolicyResource) resourceGroupRemovedNestedNotificationRules(data acceptance.TestData) string {

* `notification_rules` - (Optional) A `notification_rules` block as defined below.

* ~> **NOTE:** The default notification rules provided by Azure are not set into state. Removing the `notification_rules` block or any of the nested blocks for `notification_rules` will reset them back to the default values for those rules.
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
* ~> **NOTE:** The default notification rules provided by Azure are not set into state. Removing the `notification_rules` block or any of the nested blocks for `notification_rules` will reset them back to the default values for those rules.
* ~> **Note:** The default notification rules provided by Azure are not set into state. Removing the `notification_rules` block or any of the nested blocks for `notification_rules` will reset them back to the default values for those rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants