Skip to content

Commit

Permalink
Making additional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
niharika-98 committed Sep 11, 2023
1 parent 17e313f commit 1994a12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions mmv1/third_party/terraform/provider/provider.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_alloydb_supported_database_flags": alloydb.DataSourceAlloydbSupportedDatabaseFlags(),
"google_artifact_registry_repository": artifactregistry.DataSourceArtifactRegistryRepository(),
"google_app_engine_default_service_account": appengine.DataSourceGoogleAppEngineDefaultServiceAccount(),
"google_backup_dr_management_server": backupdr.DataSourceGoogleCloudBackupDRService(),
"google_beyondcorp_app_connection": beyondcorp.DataSourceGoogleBeyondcorpAppConnection(),
"google_beyondcorp_app_connector": beyondcorp.DataSourceGoogleBeyondcorpAppConnector(),
"google_beyondcorp_app_gateway": beyondcorp.DataSourceGoogleBeyondcorpAppGateway(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import (
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
)

func dataSourceGoogleCloudBackupDRService() *schema.Resource {
func DataSourceGoogleCloudBackupDRService() *schema.Resource {

dsSchema := tpgresource.DatasourceSchemaFromResourceSchema(ResourceBackupDRManagementServer().Schema)
tpgresource.AddRequiredFieldsToSchema(dsSchema, "name", "location", "network")
tpgresource.AddOptionalFieldsToSchema(dsSchema, "project")
tpgresource.AddRequiredFieldsToSchema(dsSchema, "project","location")

return &schema.Resource{
Read: dataSourceGoogleCloudBackupDRServiceRead,
Expand All @@ -22,7 +21,7 @@ func dataSourceGoogleCloudBackupDRService() *schema.Resource {
func dataSourceGoogleCloudBackupDRServiceRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*transport_tpg.Config)

id, err := tpgresource.ReplaceVars(d, config, "projects/{{project}}/locations/{{location}}/managementServers/{{name}}")
id, err := tpgresource.ReplaceVars(d, config, "projects/{{project}}/locations/{{location}}/managementServers")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package backupdr_test

import (
"testing"
Expand Down Expand Up @@ -63,9 +63,7 @@ func testAccDataSourceGoogleBackupDRManagementServer_basic(context map[string]in
}
depends_on = [ google_service_networking_connection.default ]
}
data "ggoogle_backup_dr_management_server" "foo" {
location = google_backup_dr_management_server.foo.location
data "google_backup_dr_management_server" "foo" {
}
`, context)
}

0 comments on commit 1994a12

Please sign in to comment.