Skip to content

Commit e4bd9cf

Browse files
Promoting BackupDR Resources to GA. (#13091) (#9357)
[upstream:a87ff8de35f728aac66b828a03195000f374f6b4] Signed-off-by: Modular Magician <[email protected]>
1 parent dccd014 commit e4bd9cf

9 files changed

+14
-39
lines changed

.changelog/13091.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
Marking BackupDR resources GA
3+
```

google-beta/services/backupdr/data_source_backup_dr_backup_plan_association_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestAccDataSourceGoogleBackupDRBackupPlanAssociation_basic(t *testing.T) {
1515
}
1616
acctest.VcrTest(t, resource.TestCase{
1717
PreCheck: func() { acctest.AccTestPreCheck(t) },
18-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
18+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
1919
Steps: []resource.TestStep{
2020
{
2121
Config: testAccDataSourceGoogleBackupDRBackupPlanAssociation_basic(context),
@@ -34,13 +34,11 @@ func testAccDataSourceGoogleBackupDRBackupPlanAssociation_basic(context map[stri
3434
return acctest.Nprintf(`
3535
3636
resource "google_service_account" "default" {
37-
provider = google-beta
3837
account_id = "tf-test-my-custom-%{random_suffix}"
3938
display_name = "Custom SA for VM Instance"
4039
}
4140
4241
resource "google_compute_instance" "default" {
43-
provider = google-beta
4442
name = "tf-test-compute-instance-%{random_suffix}"
4543
machine_type = "n2-standard-2"
4644
zone = "us-central1-a"
@@ -70,7 +68,6 @@ resource "google_compute_instance" "default" {
7068
}
7169
}
7270
resource "google_backup_dr_backup_vault" "my-backup-vault" {
73-
provider = google-beta
7471
location ="us-central1"
7572
backup_vault_id = "tf-test-bv-%{random_suffix}"
7673
description = "This is a second backup vault built by Terraform."
@@ -89,7 +86,6 @@ resource "google_backup_dr_backup_vault" "my-backup-vault" {
8986
}
9087
9188
resource "google_backup_dr_backup_plan" "foo" {
92-
provider = google-beta
9389
location = "us-central1"
9490
backup_plan_id = "tf-test-bp-test-%{random_suffix}"
9591
resource_type = "compute.googleapis.com/Instance"
@@ -113,7 +109,6 @@ resource "google_backup_dr_backup_plan" "foo" {
113109
}
114110
115111
resource "google_backup_dr_backup_plan_association" "bpa" {
116-
provider = google-beta
117112
location = "us-central1"
118113
backup_plan_association_id = "tf-test-bpa-test-%{random_suffix}"
119114
resource = google_compute_instance.default.id
@@ -122,7 +117,6 @@ resource "google_backup_dr_backup_plan_association" "bpa" {
122117
}
123118
124119
data "google_backup_dr_backup_plan_association" "bpa-test" {
125-
provider = google-beta
126120
location = "us-central1"
127121
backup_plan_association_id="tf-test-bpa-test-%{random_suffix}"
128122
depends_on= [ google_backup_dr_backup_plan_association.bpa ]

google-beta/services/backupdr/data_source_backup_dr_management_server.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ func DataSourceGoogleCloudBackupDRService() *schema.Resource {
2020
Schema: dsSchema,
2121
}
2222
}
23-
func flattenBackupDRManagementServerName(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
24-
return v
25-
}
2623

2724
func flattenBackupDRManagementServerResourceResp(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) map[string]interface{} {
2825
if v == nil {
@@ -50,6 +47,10 @@ func flattenBackupDRManagementServerResource(v interface{}, d *schema.ResourceDa
5047
return transformed
5148
}
5249

50+
func flattenBackupDRManagementServerName(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
51+
return v
52+
}
53+
5354
func dataSourceGoogleCloudBackupDRServiceRead(d *schema.ResourceData, meta interface{}) error {
5455
config := meta.(*transport_tpg.Config)
5556
userAgent, err := tpgresource.GenerateUserAgentString(d, config.UserAgent)
@@ -61,7 +62,7 @@ func dataSourceGoogleCloudBackupDRServiceRead(d *schema.ResourceData, meta inter
6162
return err
6263
}
6364
billingProject := project
64-
url, err := tpgresource.ReplaceVars(d, config, "{{BackupDRBasePath}}projects/{{project}}/locations/{{location}}/managementServers")
65+
url, err := tpgresource.ReplaceVars(d, config, `{{BackupDRBasePath}}projects/{{project}}/locations/{{location}}/managementServers`)
6566
if err != nil {
6667
return err
6768
}
@@ -78,7 +79,8 @@ func dataSourceGoogleCloudBackupDRServiceRead(d *schema.ResourceData, meta inter
7879
if err != nil {
7980
return fmt.Errorf("Error reading ManagementServer: %s", err)
8081
}
81-
resourceResponse := flattenBackupDRManagementServerResourceResp(res["managementServers"], d, config)
82+
managementServersResponse := res["managementServers"]
83+
resourceResponse := flattenBackupDRManagementServerResourceResp(managementServersResponse, d, config)
8284
if err := d.Set("project", project); err != nil {
8385
return fmt.Errorf("Error reading ManagementServer: %s", err)
8486
}

google-beta/services/backupdr/data_source_backup_dr_management_server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func testAccCheckBackupDRManagementServerDestroyProducer(t *testing.T) func(s *t
4848

4949
config := acctest.GoogleProviderConfig(t)
5050

51-
url, err := tpgresource.ReplaceVarsForTest(config, rs, "{{BackupDRBasePath}}projects/{{project}}/locations/{{location}}/managementServers/{{name}}")
51+
url, err := tpgresource.ReplaceVarsForTest(config, rs, `{{BackupDRBasePath}}projects/{{project}}/locations/{{location}}/managementServers`)
5252
if err != nil {
5353
return err
5454
}

google-beta/services/backupdr/resource_backup_dr_backup_plan_association_generated_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestAccBackupDRBackupPlanAssociation_backupDrBpaExample(t *testing.T) {
4141

4242
acctest.VcrTest(t, resource.TestCase{
4343
PreCheck: func() { acctest.AccTestPreCheck(t) },
44-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
44+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
4545
CheckDestroy: testAccCheckBackupDRBackupPlanAssociationDestroyProducer(t),
4646
Steps: []resource.TestStep{
4747
{
@@ -60,13 +60,11 @@ func TestAccBackupDRBackupPlanAssociation_backupDrBpaExample(t *testing.T) {
6060
func testAccBackupDRBackupPlanAssociation_backupDrBpaExample(context map[string]interface{}) string {
6161
return acctest.Nprintf(`
6262
resource "google_service_account" "mySA" {
63-
provider = google-beta
6463
account_id = "tf-test-my-custom%{random_suffix}"
6564
display_name = "Custom SA for VM Instance"
6665
}
6766
6867
resource "google_compute_instance" "myinstance" {
69-
provider = google-beta
7068
name = "tf-test-test-instance%{random_suffix}"
7169
machine_type = "n2-standard-2"
7270
zone = "us-central1-a"
@@ -95,15 +93,13 @@ resource "google_compute_instance" "myinstance" {
9593
}
9694
9795
resource "google_backup_dr_backup_vault" "bv1" {
98-
provider = google-beta
9996
location = "us-central1"
10097
backup_vault_id = "tf-test-bv-bpa%{random_suffix}"
10198
backup_minimum_enforced_retention_duration = "100000s"
10299
force_delete = "true"
103100
}
104101
105102
resource "google_backup_dr_backup_plan" "bp1" {
106-
provider = google-beta
107103
location = "us-central1"
108104
backup_plan_id = "tf-test-bp-bpa-test%{random_suffix}"
109105
resource_type = "compute.googleapis.com/Instance"
@@ -126,7 +122,6 @@ resource "google_backup_dr_backup_plan" "bp1" {
126122
}
127123
}
128124
resource "google_backup_dr_backup_plan_association" "my-backup-plan-association" {
129-
provider = google-beta
130125
location = "us-central1"
131126
resource_type= "compute.googleapis.com/Instance"
132127
backup_plan_association_id = "tf-test-my-bpa%{random_suffix}"

google-beta/services/backupdr/resource_backup_dr_backup_plan_generated_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestAccBackupDRBackupPlan_backupDrBackupPlanSimpleExample(t *testing.T) {
3939

4040
acctest.VcrTest(t, resource.TestCase{
4141
PreCheck: func() { acctest.AccTestPreCheck(t) },
42-
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
42+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
4343
CheckDestroy: testAccCheckBackupDRBackupPlanDestroyProducer(t),
4444
Steps: []resource.TestStep{
4545
{
@@ -58,14 +58,12 @@ func TestAccBackupDRBackupPlan_backupDrBackupPlanSimpleExample(t *testing.T) {
5858
func testAccBackupDRBackupPlan_backupDrBackupPlanSimpleExample(context map[string]interface{}) string {
5959
return acctest.Nprintf(`
6060
resource "google_backup_dr_backup_vault" "my_backup_vault" {
61-
provider = google-beta
6261
location = "us-central1"
6362
backup_vault_id = "tf-test-backup-vault-simple-test%{random_suffix}"
6463
backup_minimum_enforced_retention_duration = "100000s"
6564
}
6665
6766
resource "google_backup_dr_backup_plan" "my-backup-plan-1" {
68-
provider = google-beta
6967
location = "us-central1"
7068
backup_plan_id = "tf-test-backup-plan-simple-test%{random_suffix}"
7169
resource_type = "compute.googleapis.com/Instance"

website/docs/r/backup_dr_backup_plan.html.markdown

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ description: |-
2323

2424
A backup plan defines when and how to back up a resource, including the backup's schedule, retention, and location.
2525

26-
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
27-
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
2826

2927
To get more information about BackupPlan, see:
3028

@@ -37,14 +35,12 @@ To get more information about BackupPlan, see:
3735

3836
```hcl
3937
resource "google_backup_dr_backup_vault" "my_backup_vault" {
40-
provider = google-beta
4138
location = "us-central1"
4239
backup_vault_id = "backup-vault-simple-test"
4340
backup_minimum_enforced_retention_duration = "100000s"
4441
}
4542
4643
resource "google_backup_dr_backup_plan" "my-backup-plan-1" {
47-
provider = google-beta
4844
location = "us-central1"
4945
backup_plan_id = "backup-plan-simple-test"
5046
resource_type = "compute.googleapis.com/Instance"

website/docs/r/backup_dr_backup_plan_association.html.markdown

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ description: |-
2323

2424
A Backup and DR BackupPlanAssociation.
2525

26-
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
27-
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
2826

2927
To get more information about BackupPlanAssociation, see:
3028

@@ -37,13 +35,11 @@ To get more information about BackupPlanAssociation, see:
3735

3836
```hcl
3937
resource "google_service_account" "mySA" {
40-
provider = google-beta
4138
account_id = "my-custom"
4239
display_name = "Custom SA for VM Instance"
4340
}
4441
4542
resource "google_compute_instance" "myinstance" {
46-
provider = google-beta
4743
name = "test-instance"
4844
machine_type = "n2-standard-2"
4945
zone = "us-central1-a"
@@ -72,15 +68,13 @@ resource "google_compute_instance" "myinstance" {
7268
}
7369
7470
resource "google_backup_dr_backup_vault" "bv1" {
75-
provider = google-beta
7671
location = "us-central1"
7772
backup_vault_id = "bv-bpa"
7873
backup_minimum_enforced_retention_duration = "100000s"
7974
force_delete = "true"
8075
}
8176
8277
resource "google_backup_dr_backup_plan" "bp1" {
83-
provider = google-beta
8478
location = "us-central1"
8579
backup_plan_id = "bp-bpa-test"
8680
resource_type = "compute.googleapis.com/Instance"
@@ -103,7 +97,6 @@ resource "google_backup_dr_backup_plan" "bp1" {
10397
}
10498
}
10599
resource "google_backup_dr_backup_plan_association" "my-backup-plan-association" {
106-
provider = google-beta
107100
location = "us-central1"
108101
resource_type= "compute.googleapis.com/Instance"
109102
backup_plan_association_id = "my-bpa"

website/docs/r/backup_dr_management_server.html.markdown

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ description: |-
2323

2424
A Backup and DR Management Server (Also referred as Management Console)
2525

26-
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
27-
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
2826

2927
To get more information about ManagementServer, see:
3028

@@ -37,12 +35,10 @@ To get more information about ManagementServer, see:
3735

3836
```hcl
3937
resource "google_compute_network" "default" {
40-
provider = google-beta
4138
name = "vpc-network"
4239
}
4340
4441
resource "google_compute_global_address" "private_ip_address" {
45-
provider = google-beta
4642
name = "vpc-network"
4743
address_type = "INTERNAL"
4844
purpose = "VPC_PEERING"
@@ -51,14 +47,12 @@ resource "google_compute_global_address" "private_ip_address" {
5147
}
5248
5349
resource "google_service_networking_connection" "default" {
54-
provider = google-beta
5550
network = google_compute_network.default.id
5651
service = "servicenetworking.googleapis.com"
5752
reserved_peering_ranges = [google_compute_global_address.private_ip_address.name]
5853
}
5954
6055
resource "google_backup_dr_management_server" "ms-console" {
61-
provider = google-beta
6256
location = "us-central1"
6357
name = "ms-console"
6458
type = "BACKUP_RESTORE"

0 commit comments

Comments
 (0)