From 9946228c3a368047385178dd0c33e804d1536b87 Mon Sep 17 00:00:00 2001 From: megan07 Date: Thu, 24 Oct 2019 14:49:17 -0500 Subject: [PATCH] handle legacy network deprecation (#2508) --- products/compute/terraform.yaml | 1 - templates/terraform/encoders/network.erb | 5 ----- templates/terraform/extra_schema_entry/network.erb | 2 +- .../website/docs/guides/version_3_upgrade.html.markdown | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 templates/terraform/encoders/network.erb diff --git a/products/compute/terraform.yaml b/products/compute/terraform.yaml index 3dc9f3f4cbf2..54e2c63999f8 100644 --- a/products/compute/terraform.yaml +++ b/products/compute/terraform.yaml @@ -936,7 +936,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides custom_code: !ruby/object:Provider::Terraform::CustomCode post_create: templates/terraform/post_create/compute_network_delete_default_route.erb extra_schema_entry: templates/terraform/extra_schema_entry/network.erb - encoder: templates/terraform/encoders/network.erb NetworkEndpoint: !ruby/object:Overrides::Terraform::ResourceOverride id_format: "{{project}}/{{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}" mutex: networkEndpoint/{{project}}/{{zone}}/{{network_endpoint_group}} diff --git a/templates/terraform/encoders/network.erb b/templates/terraform/encoders/network.erb deleted file mode 100644 index e5e725c1ed67..000000000000 --- a/templates/terraform/encoders/network.erb +++ /dev/null @@ -1,5 +0,0 @@ -if _, ok := d.GetOk("ipv4_range"); !ok { - obj["autoCreateSubnetworks"] = d.Get("auto_create_subnetworks") -} - -return obj, nil diff --git a/templates/terraform/extra_schema_entry/network.erb b/templates/terraform/extra_schema_entry/network.erb index b69aa20b0079..a47523c01cca 100644 --- a/templates/terraform/extra_schema_entry/network.erb +++ b/templates/terraform/extra_schema_entry/network.erb @@ -14,6 +14,6 @@ -%> "ipv4_range": { Type: schema.TypeString, - Optional: true, + Computed: true, Removed: "Legacy Networks are deprecated and you will no longer be able to create them using this field from Feb 1, 2020 onwards.", }, \ No newline at end of file diff --git a/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown b/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown index d14cb8d1d52d..1be62e506eab 100644 --- a/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown +++ b/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown @@ -282,7 +282,7 @@ documentation. ### `ipv4_range` is now removed -Legacy Networks are deprecated and you will no longer be able to create them +Legacy Networks are removed and you will no longer be able to create them using this field from Feb 1, 2020 onwards. ## Resource: `google_compute_network_peering`