New Resource: azurerm_data_protection_backup_policy_mysql_flexible_server#26955
Conversation
ms-zhenhua
left a comment
There was a problem hiding this comment.
Hi @neil-yechenwei ,
Thanks for this PR - I've taken a look through and left some comments inline. If we can fix those up, this should be good to go 👍
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Outdated
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Outdated
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Outdated
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Outdated
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Outdated
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
|
@ms-zhenhua , thanks for the comments. I updated PR and left suggestions. Please take another look. Below is the latest test result I just now triggered. |
|
@neil-yechenwei, thank you for the update. LGTM~ |
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
| Type: pluginsdk.TypeString, | ||
| Optional: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validation.StringIsNotEmpty, |
There was a problem hiding this comment.
The validation is added per the existing validation.
| MinItems: 1, | ||
| Elem: &pluginsdk.Schema{ | ||
| Type: pluginsdk.TypeString, | ||
| ValidateFunc: validation.StringIsNotEmpty, |
There was a problem hiding this comment.
this should be validated as an ISO duration?
There was a problem hiding this comment.
It's not a standard ISO duration. This is the sample "R/2021-05-23T02:30:00+00:00/P1W". All existing TF resources defined the "backup_repeating_time_intervals" property aren't added validation.
There was a problem hiding this comment.
the documentation says ISO 8601 repeating time format - that is a variation of the standard duration format no?
please create a validation function like ISO8601Duration and add it to the helpers/time.go function and make use of it here/add to the other data protection resources
There was a problem hiding this comment.
The validation is added.
|
@katbyte , thanks for the comments. I updated PR. Please take another look. Thanks. |
| MinItems: 1, | ||
| Elem: &pluginsdk.Schema{ | ||
| Type: pluginsdk.TypeString, | ||
| ValidateFunc: validation.StringIsNotEmpty, |
There was a problem hiding this comment.
the documentation says ISO 8601 repeating time format - that is a variation of the standard duration format no?
please create a validation function like ISO8601Duration and add it to the helpers/time.go function and make use of it here/add to the other data protection resources
...rnal/services/dataprotection/data_protection_backup_policy_mysql_flexible_server_resource.go
Show resolved
Hide resolved
|
@katbyte , thanks for the comments. I updated PR. Please take another look. |
katbyte
left a comment
There was a problem hiding this comment.
Thanks @neil-yechenwei - LGTM 🏰
|
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. |



Community Note
Description
This PR is to support Data Protection Backup Policy for MySQL FS.
API Reference: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01
Overview: https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-backup-restore#long-term-retention-preview
Note: This PR is referring the existing Backup Instances/Backup Policies in RP https://github.com/hashicorp/terraform-provider-azurerm/tree/main/internal/services/dataprotection.
PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_data_protection_backup_policy_mysql_flexible_serverThis is a (please select all that apply):
Note
If this PR changes meaningfully during the course of review please update the title and description as required.