Skip to content

Commit

Permalink
Set name attribute on compute_subnetwork data source (#1579)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Riley Karson <rileykarson@google.com>
  • Loading branch information
modular-magician and rileykarson committed Jan 3, 2020
1 parent ccafccf commit 0f50289
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions google-beta/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-beta/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 0f50289

Please sign in to comment.