Skip to content

Commit

Permalink
Switch back to string for now
Browse files Browse the repository at this point in the history
  • Loading branch information
wyardley committed Nov 15, 2024
1 parent de35f3b commit c4d50f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mmv1/products/compute/Network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ properties:
validation:
function: 'verify.ValidateGCEName'
- name: 'numericId'
type: Integer
type: String
description: |
The unique identifier for the resource. This identifier is defined by the server.
output: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package compute

import (
"fmt"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-google/google/tpgresource"
Expand All @@ -23,8 +24,11 @@ func DataSourceGoogleComputeNetwork() *schema.Resource {
Computed: true,
},

// TODO: this should eventually be TypeInt, but leaving as
// string for now to match the resource and to avoid a
// breaking change.
"numeric_id": {
Type: schema.TypeInt,
Type: schema.TypeString,
Computed: true,
},

Expand Down Expand Up @@ -100,7 +104,7 @@ func dataSourceGoogleComputeNetworkRead(d *schema.ResourceData, meta interface{}
if err := d.Set("description", network.Description); err != nil {
return fmt.Errorf("Error setting description: %s", err)
}
if err := d.Set("numeric_id", network.Id); err != nil {
if err := d.Set("numeric_id", strconv.Itoa(int(network.Id))); err != nil {
return fmt.Errorf("Error setting numeric_id: %s", err)
}
if err := d.Set("subnetworks_self_links", network.Subnetworks); err != nil {
Expand Down

0 comments on commit c4d50f1

Please sign in to comment.