-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_mssql_database_vulnerability_assessment_rule_baseline: fix the resource is being replaced every new tf apply issue #14759
azurerm_mssql_database_vulnerability_assessment_rule_baseline: fix the resource is being replaced every new tf apply issue #14759
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @sinbai
Thanks for this PR - apologies for the delayed review here.
I've taken a look through and it appears this data can come from the ID being provided, as such we can use that casing here which should solve this.
Thanks!
@@ -153,7 +153,8 @@ func resourceMsSqlDatabaseVulnerabilityAssessmentRuleBaselineRead(d *pluginsdk.R | |||
d.Set("rule_id", id.RuleName) | |||
d.Set("baseline_name", id.BaselineName) | |||
|
|||
vulnerabilityAssessmentId := parse.NewServerVulnerabilityAssessmentID(id.SubscriptionId, id.ResourceGroup, id.ServerName, "default") | |||
// TODO: replace "Default" with "default" after the issue(https://github.com/Azure/azure-rest-api-specs/issues/17192) is fixed. | |||
vulnerabilityAssessmentId := parse.NewServerVulnerabilityAssessmentID(id.SubscriptionId, id.ResourceGroup, id.ServerName, "Default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is coming from the user input we can make this:
vulnerabilityAssessmentId := parse.NewServerVulnerabilityAssessmentID(id.SubscriptionId, id.ResourceGroup, id.ServerName, "Default") | |
vulnerabilityAssessmentId := parse.NewServerVulnerabilityAssessmentID(id.SubscriptionId, id.ResourceGroup, id.ServerName, id.DatabaseName, id.VulnerabilityAssessmentName) |
which'll make it consistent with how this is handled above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sinbai - LGTM 🦀
This functionality has been released in v3.0.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! |
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. |
The purpose of this PR:
Test results:
PASS: TestAccMsSqlDatabaseVulnerabilityAssessmentRuleBaseline_basic (461.71s)
PASS: TestAccMsSqlDatabaseVulnerabilityAssessmentRuleBaseline_primary (550.76s)