From c4d50f15a405839435c1d2154a3912599354f0f0 Mon Sep 17 00:00:00 2001 From: William Yardley Date: Fri, 15 Nov 2024 12:54:34 -0800 Subject: [PATCH] Switch back to string for now --- mmv1/products/compute/Network.yaml | 2 +- .../compute/data_source_google_compute_network.go.tmpl | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mmv1/products/compute/Network.yaml b/mmv1/products/compute/Network.yaml index 543aef71d84a..4a722c4b3193 100644 --- a/mmv1/products/compute/Network.yaml +++ b/mmv1/products/compute/Network.yaml @@ -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 diff --git a/mmv1/third_party/terraform/services/compute/data_source_google_compute_network.go.tmpl b/mmv1/third_party/terraform/services/compute/data_source_google_compute_network.go.tmpl index a14833d30964..da19428452ad 100644 --- a/mmv1/third_party/terraform/services/compute/data_source_google_compute_network.go.tmpl +++ b/mmv1/third_party/terraform/services/compute/data_source_google_compute_network.go.tmpl @@ -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" @@ -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, }, @@ -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 {