From 66f37c5a841100dd6319406c8eace10fb06ae57b Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 24 Sep 2024 16:53:19 +0800 Subject: [PATCH] update pr per comments --- ...ction_backup_instance_mysql_flexible_server_resource.go | 7 +++++-- ...ion_backup_instance_mysql_flexible_server.html.markdown | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/services/dataprotection/data_protection_backup_instance_mysql_flexible_server_resource.go b/internal/services/dataprotection/data_protection_backup_instance_mysql_flexible_server_resource.go index 224e84d69a81..f885456988a0 100644 --- a/internal/services/dataprotection/data_protection_backup_instance_mysql_flexible_server_resource.go +++ b/internal/services/dataprotection/data_protection_backup_instance_mysql_flexible_server_resource.go @@ -193,13 +193,13 @@ func (r DataProtectionBackupInstanceMySQLFlexibleServerResource) Read() sdk.Reso if props := model.Properties; props != nil { state.Location = location.NormalizeNilable(props.DataSourceInfo.ResourceLocation) - serverId, err := servers.ParseFlexibleServerID(props.DataSourceInfo.ResourceID) + serverId, err := servers.ParseFlexibleServerIDInsensitively(props.DataSourceInfo.ResourceID) if err != nil { return err } state.ServerId = serverId.ID() - backupPolicyId, err := backuppolicies.ParseBackupPolicyID(props.PolicyInfo.PolicyId) + backupPolicyId, err := backuppolicies.ParseBackupPolicyIDInsensitively(props.PolicyInfo.PolicyId) if err != nil { return err } @@ -236,6 +236,9 @@ func (r DataProtectionBackupInstanceMySQLFlexibleServerResource) Update() sdk.Re return fmt.Errorf("reading %s: %+v", *id, err) } + if existing.Model == nil { + return fmt.Errorf("retrieving %s: `model` was nil", id) + } parameters := *existing.Model diff --git a/website/docs/r/data_protection_backup_instance_mysql_flexible_server.html.markdown b/website/docs/r/data_protection_backup_instance_mysql_flexible_server.html.markdown index 60b64498160f..9aa0cf8d055f 100644 --- a/website/docs/r/data_protection_backup_instance_mysql_flexible_server.html.markdown +++ b/website/docs/r/data_protection_backup_instance_mysql_flexible_server.html.markdown @@ -86,11 +86,11 @@ The following arguments are supported: * `location` - (Required) The location of the source database. Changing this forces a new resource to be created. -* `vault_id` - (Required) The ID of the Backup Vault within which the MySQL Flexible Server Backup Instance should exist. Changing this forces a new resource to be created. +* `backup_policy_id` - (Required) The ID of the Backup Policy. * `server_id` - (Required) The ID of the source server. Changing this forces a new resource to be created. -* `backup_policy_id` - (Required) The ID of the Backup Policy. +* `vault_id` - (Required) The ID of the Backup Vault within which the MySQL Flexible Server Backup Instance should exist. Changing this forces a new resource to be created. ## Attributes Reference