Skip to content

Commit a354122

Browse files
Documentation changes to include "disk" resource type in backup_dr (#13922) (#23197)
[upstream:e29e37ce2360cae0b7cdc0cca3c0863ead6265f5] Signed-off-by: Modular Magician <[email protected]>
1 parent 96cee52 commit a354122

File tree

4 files changed

+56
-11
lines changed

4 files changed

+56
-11
lines changed

google/services/backupdr/resource_backup_dr_backup_plan.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,11 @@ This is required for 'recurrence_type', 'HOURLY' and is not applicable otherwise
206206
Description: `The location for the backup plan`,
207207
},
208208
"resource_type": {
209-
Type: schema.TypeString,
210-
Required: true,
211-
ForceNew: true,
212-
Description: `The resource type to which the 'BackupPlan' will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket".`,
209+
Type: schema.TypeString,
210+
Required: true,
211+
ForceNew: true,
212+
Description: `The resource type to which the 'BackupPlan' will be applied.
213+
Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "storage.googleapis.com/Bucket".`,
213214
},
214215
"description": {
215216
Type: schema.TypeString,

google/services/backupdr/resource_backup_dr_backup_plan_association.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func ResourceBackupDRBackupPlanAssociation() *schema.Resource {
5858
Required: true,
5959
ForceNew: true,
6060
DiffSuppressFunc: tpgresource.ProjectNumberDiffSuppress,
61-
Description: `The BP with which resource needs to be created`,
61+
Description: `The BP with which resource needs to be created
62+
Note:
63+
- A Backup Plan configured for 'compute.googleapis.com/Instance', can only protect instance type resources.
64+
- A Backup Plan configured for 'compute.googleapis.com/Disk' can be used to protect both standard Disks and Regional Disks resources.`,
6265
},
6366
"backup_plan_association_id": {
6467
Type: schema.TypeString,
@@ -79,10 +82,11 @@ func ResourceBackupDRBackupPlanAssociation() *schema.Resource {
7982
Description: `The resource for which BPA needs to be created`,
8083
},
8184
"resource_type": {
82-
Type: schema.TypeString,
83-
Required: true,
84-
ForceNew: true,
85-
Description: `The resource type of workload on which backupplan is applied`,
85+
Type: schema.TypeString,
86+
Required: true,
87+
ForceNew: true,
88+
Description: `The resource type of workload on which backupplan is applied.
89+
Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "compute.googleapis.com/RegionDisk"`,
8690
},
8791
"create_time": {
8892
Type: schema.TypeString,

website/docs/r/backup_dr_backup_plan.html.markdown

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,41 @@ resource "google_backup_dr_backup_plan" "my-backup-plan-1" {
6363
}
6464
}
6565
```
66+
## Example Usage - Backup Dr Backup Plan For Disk Resource
67+
68+
69+
```hcl
70+
resource "google_backup_dr_backup_vault" "my_backup_vault" {
71+
provider = google-beta
72+
location = "us-central1"
73+
backup_vault_id = "backup-vault-disk-test"
74+
backup_minimum_enforced_retention_duration = "100000s"
75+
}
76+
77+
resource "google_backup_dr_backup_plan" "my-disk-backup-plan-1" {
78+
provider = google-beta
79+
location = "us-central1"
80+
backup_plan_id = "backup-plan-disk-test"
81+
resource_type = "compute.googleapis.com/Disk"
82+
backup_vault = google_backup_dr_backup_vault.my_backup_vault.id
83+
84+
backup_rules {
85+
rule_id = "rule-1"
86+
backup_retention_days = 5
87+
88+
standard_schedule {
89+
recurrence_type = "HOURLY"
90+
hourly_frequency = 1
91+
time_zone = "UTC"
92+
93+
backup_window {
94+
start_hour_of_day = 0
95+
end_hour_of_day = 6
96+
}
97+
}
98+
}
99+
}
100+
```
66101

67102
## Argument Reference
68103

@@ -75,7 +110,8 @@ The following arguments are supported:
75110

76111
* `resource_type` -
77112
(Required)
78-
The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket".
113+
The resource type to which the `BackupPlan` will be applied.
114+
Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "storage.googleapis.com/Bucket".
79115

80116
* `backup_rules` -
81117
(Required)

website/docs/r/backup_dr_backup_plan_association.html.markdown

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,14 @@ The following arguments are supported:
117117
* `backup_plan` -
118118
(Required)
119119
The BP with which resource needs to be created
120+
Note:
121+
- A Backup Plan configured for 'compute.googleapis.com/Instance', can only protect instance type resources.
122+
- A Backup Plan configured for 'compute.googleapis.com/Disk' can be used to protect both standard Disks and Regional Disks resources.
120123

121124
* `resource_type` -
122125
(Required)
123-
The resource type of workload on which backupplan is applied
126+
The resource type of workload on which backupplan is applied.
127+
Examples include, "compute.googleapis.com/Instance", "compute.googleapis.com/Disk", and "compute.googleapis.com/RegionDisk"
124128

125129
* `location` -
126130
(Required)

0 commit comments

Comments
 (0)