Skip to content

Commit

Permalink
Set name attribute on compute_subnetwork data source (#5288)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeaumont authored and rileykarson committed Jan 3, 2020
1 parent d7987fd commit b3e83db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions google/data_source_google_compute_subnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func dataSourceGoogleComputeSubnetworkRead(d *schema.ResourceData, meta interfac
d.Set("network", subnetwork.Network)
d.Set("project", project)
d.Set("region", region)
d.Set("name", name)
d.Set("secondary_ip_range", flattenSecondaryRanges(subnetwork.SecondaryIpRanges))

d.SetId(fmt.Sprintf("projects/%s/regions/%s/subnetworks/%s", project, region, name))
Expand Down
1 change: 1 addition & 0 deletions google/data_source_google_compute_subnetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestAccDataSourceGoogleSubnetwork(t *testing.T) {
Config: testAccDataSourceGoogleSubnetwork(),
Check: resource.ComposeTestCheckFunc(
testAccDataSourceGoogleSubnetworkCheck("data.google_compute_subnetwork.my_subnetwork", "google_compute_subnetwork.foobar"),
testAccDataSourceGoogleSubnetworkCheck("data.google_compute_subnetwork.my_subnetwork_self_link", "google_compute_subnetwork.foobar"),
),
},
},
Expand Down

0 comments on commit b3e83db

Please sign in to comment.