Skip to content

Commit

Permalink
resource/alicloud_polardb_backup_policy:Data_level1_backup_retention_…
Browse files Browse the repository at this point in the history
…period support 3-30.
  • Loading branch information
tortoise-daddy committed Dec 11, 2023
1 parent 64cf27a commit 1c13f6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 3 additions & 5 deletions alicloud/resource_alicloud_polardb_backup_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func resourceAlicloudPolarDBBackupPolicy() *schema.Resource {
"data_level1_backup_retention_period": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: IntBetween(3, 14),
ValidateFunc: IntBetween(3, 30),
Computed: true,
},
"data_level2_backup_retention_period": {
Expand Down Expand Up @@ -138,10 +138,8 @@ func resourceAlicloudPolarDBBackupPolicy() *schema.Resource {
IntBetween(30, 7300)),
},
"enable_backup_log": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: IntInSlice([]int{0, 1}),
Computed: true,
Type: schema.TypeInt,
Computed: true,
},
},
}
Expand Down
6 changes: 4 additions & 2 deletions alicloud/resource_alicloud_polardb_backup_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccAlicloudPolarDBBackupPolicy(t *testing.T) {
func TestAccAliCloudPolarDBBackupPolicy(t *testing.T) {
var v *polardb.DescribeBackupPolicyResponse
resourceId := "alicloud_polardb_backup_policy.default"
serverFunc := func() interface{} {
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestAccAlicloudPolarDBBackupPolicy(t *testing.T) {
})
}

func TestAccAlicloudPolarDBNewBackupPolicy(t *testing.T) {
func TestAccAliCloudPolarDBNewBackupPolicy(t *testing.T) {
var v *polardb.DescribeBackupPolicyResponse
resourceId := "alicloud_polardb_backup_policy.default"
serverFunc := func() interface{} {
Expand Down Expand Up @@ -147,12 +147,14 @@ func TestAccAlicloudPolarDBNewBackupPolicy(t *testing.T) {
{
Config: testAccConfig(map[string]interface{}{
"data_level1_backup_retention_period": "7",
"backup_retention_period": "7",
"data_level1_backup_time": "10:00Z-11:00Z",
"data_level1_backup_period": []string{"Tuesday", "Wednesday"},
}),
Check: resource.ComposeTestCheckFunc(
testAccCheck(map[string]string{
"data_level1_backup_retention_period": "7",
"backup_retention_period": "7",
"data_level1_backup_time": "10:00Z-11:00Z",
"data_level1_backup_period.#": "2",
}),
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/polardb_backup_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ The following arguments are supported:
* `log_backup_another_region_region` - (Optional, Available in 1.207.0+) The region in which you want to store cross-region log backups. For information about regions that support the cross-region backup feature, see [Overview.](https://www.alibabacloud.com/help/en/polardb/latest/backup-and-restoration-overview)
* `log_backup_another_region_retention_period` - (Optional, Available in 1.207.0+) The retention period of cross-region log backups. Default value: OFF. Valid values are `0`, `30 to 7300`, `-1`.
-> **NOTE:** Note When you create a cluster, the default value of this parameter is 0.
* `enable_backup_log` - (Optional, Available in 1.207.0+) Indicates whether the log backup feature was enabled. Valid values are `0`, `1`. `1` By default, the log backup feature is enabled and cannot be disabled.
* `backup_retention_period` - (Optional) Cluster backup retention days, Fixed for 7 days, not modified.

## Attributes Reference

The following attributes are exported:

* `id` - The current backup policy resource ID. It is same as 'db_cluster_id'.
* `enable_backup_log` - Indicates whether the log backup feature was enabled. Valid values are `0`, `1`. `1` By default, the log backup feature is enabled and cannot be disabled.

## Import

Expand Down

0 comments on commit 1c13f6f

Please sign in to comment.