-
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
New Resource: azurerm_data_protection_backup_policy_mysql_flexible_server
#26955
New Resource: azurerm_data_protection_backup_policy_mysql_flexible_server
#26955
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we validate this?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be validated as an ISO duration?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
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 @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_server
This 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.