From 32df87176705e1a5c00f134e22d2f6b87ef92bac Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Mon, 2 Mar 2020 14:25:08 -0800 Subject: [PATCH] Add missing fields to instance template's network_interfaces schema --- .../resources/resource_compute_instance.go | 8 +++---- .../resource_compute_instance_template.go | 22 ++++++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/third_party/terraform/resources/resource_compute_instance.go b/third_party/terraform/resources/resource_compute_instance.go index 6759aecd3b4e..a43f5e260bb2 100644 --- a/third_party/terraform/resources/resource_compute_instance.go +++ b/third_party/terraform/resources/resource_compute_instance.go @@ -230,15 +230,15 @@ func resourceComputeInstance() *schema.Resource { ForceNew: true, }, - "name": { + "network_ip": { Type: schema.TypeString, + Optional: true, + ForceNew: true, Computed: true, }, - "network_ip": { + "name": { Type: schema.TypeString, - Optional: true, - ForceNew: true, Computed: true, }, diff --git a/third_party/terraform/resources/resource_compute_instance_template.go b/third_party/terraform/resources/resource_compute_instance_template.go index 18469c738a7c..1d38e6c9c598 100644 --- a/third_party/terraform/resources/resource_compute_instance_template.go +++ b/third_party/terraform/resources/resource_compute_instance_template.go @@ -246,12 +246,6 @@ func resourceComputeInstanceTemplate() *schema.Resource { DiffSuppressFunc: compareSelfLinkOrResourceName, }, - "network_ip": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "subnetwork": { Type: schema.TypeString, Optional: true, @@ -267,6 +261,17 @@ func resourceComputeInstanceTemplate() *schema.Resource { Computed: true, }, + "network_ip": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "name": { + Type: schema.TypeString, + Computed: true, + }, + "access_config": { Type: schema.TypeList, Optional: true, @@ -285,6 +290,11 @@ func resourceComputeInstanceTemplate() *schema.Resource { Computed: true, ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false), }, + // Possibly configurable- this was added so we don't break if it's inadvertently set + "public_ptr_domain_name": { + Type: schema.TypeString, + Computed: true, + }, }, }, },