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

Auto Scale: filter out the $tags tag #1770

Merged
merged 1 commit into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion azurerm/resource_arm_autoscale_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ func resourceArmAutoScaleSettingRead(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("Error setting `notification` of Autoscale Setting %q (resource group %q): %+v", name, resourceGroup, err)
}

flattenAndSetTags(d, resp.Tags)
// Return a new tag map filtered by the specified tag names.
tagMap := filterTags(resp.Tags, "$type")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this filtering be applied more globally? There seems to have been a few issues related to it across various resources.

Copy link
Contributor Author

@tombuildsstuff tombuildsstuff Aug 15, 2018

Choose a reason for hiding this comment

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

Not necessarily unfortunately - this values only restricted in certain API's (read: Monitor/App Insights) - such that it's potentially a valid key in other API's

flattenAndSetTags(d, tagMap)

return nil
}
Expand Down
1 change: 1 addition & 0 deletions azurerm/resource_arm_autoscale_setting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func TestAccAzureRMAutoScaleSetting_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "profile.0.name", "metricRules"),
resource.TestCheckResourceAttr(resourceName, "profile.0.rule.#", "1"),
resource.TestCheckResourceAttr(resourceName, "notification.#", "0"),
resource.TestCheckNoResourceAttr(resourceName, "tags.$type"),
),
},
},
Expand Down