Merge branch 'master' of https://github.com/terraform-providers/terraform-provider-google into container_cluster_list_param_multifix

This commit is contained in:
Emily Ye 2018-06-22 10:31:06 -07:00
commit f8c3a10809
21 changed files with 178 additions and 109 deletions

View File

@ -1,11 +1,14 @@
## 1.14.1 (Unreleased) ## 1.15.0 (Unreleased)
FEATURES: FEATURES:
IMPROVEMENTS: IMPROVEMENTS:
* compute: Autogenerate `compute_subnetwork` [GH-1661]
* container: Allow specifying project when importing container_node_pool [GH-1653] * container: Allow specifying project when importing container_node_pool [GH-1653]
* dns: Add update support for `dns_managed_zone` [GH-1617] * dns: Add update support for `dns_managed_zone` [GH-1617]
* project: App Engine application fields can now be updated in-place where possible [GH-1621] * project: App Engine application fields can now be updated in-place where possible [GH-1621]
* storage: Add `project` field for GCS service account data sorce [GH-1677]
* sql: Attempting to shrink an `sql_database_instance`'s disk size will now force recreation of the resource [GH-1684]
BUG FIXES: BUG FIXES:
* all: Check for done operations before waiting on them. This fixes a 403 we were getting when trying to enable already-enabled services. [GH-1632] * all: Check for done operations before waiting on them. This fixes a 403 we were getting when trying to enable already-enabled services. [GH-1632]
@ -14,6 +17,7 @@ BUG FIXES:
* compute: `zone` field in `google_compute_disk` should be optional [GH-1631] * compute: `zone` field in `google_compute_disk` should be optional [GH-1631]
* compute: name_prefix is no longer deprecated for SSL certificates [GH-1622] * compute: name_prefix is no longer deprecated for SSL certificates [GH-1622]
* compute: for global address ip_version, IPV4 and empty are equivalent. [GH-1639] * compute: for global address ip_version, IPV4 and empty are equivalent. [GH-1639]
* container: fix permadiff on `container_cluster`'s `pod_security_policy_config` [GH-1670]
* iam: Fixes issue with consecutive whitespace [GH-1625] * iam: Fixes issue with consecutive whitespace [GH-1625]
* iam: use same mutex for project_iam_policy as the other project_iam resources [GH-1645] * iam: use same mutex for project_iam_policy as the other project_iam resources [GH-1645]
* iam: don't error if service account key is already gone on delete [GH-1659] * iam: don't error if service account key is already gone on delete [GH-1659]

View File

@ -2,10 +2,11 @@ package google
import ( import (
"fmt" "fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"testing"
) )
func TestAccDataSourceDnsManagedZone_basic(t *testing.T) { func TestAccDataSourceDnsManagedZone_basic(t *testing.T) {
@ -61,7 +62,7 @@ func testAccDataSourceDnsManagedZone_basic() string {
return fmt.Sprintf(` return fmt.Sprintf(`
resource "google_dns_managed_zone" "foo" { resource "google_dns_managed_zone" "foo" {
name = "qa-zone-%s" name = "qa-zone-%s"
dns_name = "qa.test.com." dns_name = "qa.tf-test.club."
description = "QA DNS zone" description = "QA DNS zone"
} }

View File

@ -123,43 +123,43 @@ func resourceComputeAddressCreate(d *schema.ResourceData, meta interface{}) erro
addressProp, err := expandComputeAddressAddress(d.Get("address"), d, config) addressProp, err := expandComputeAddressAddress(d.Get("address"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("address"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, addressProp)) { } else if v, ok := d.GetOkExists("address"); !isEmptyValue(reflect.ValueOf(addressProp)) && (ok || !reflect.DeepEqual(v, addressProp)) {
obj["address"] = addressProp obj["address"] = addressProp
} }
addressTypeProp, err := expandComputeAddressAddressType(d.Get("address_type"), d, config) addressTypeProp, err := expandComputeAddressAddressType(d.Get("address_type"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("address_type"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, addressTypeProp)) { } else if v, ok := d.GetOkExists("address_type"); !isEmptyValue(reflect.ValueOf(addressTypeProp)) && (ok || !reflect.DeepEqual(v, addressTypeProp)) {
obj["addressType"] = addressTypeProp obj["addressType"] = addressTypeProp
} }
descriptionProp, err := expandComputeAddressDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeAddressDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeAddressName(d.Get("name"), d, config) nameProp, err := expandComputeAddressName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
networkTierProp, err := expandComputeAddressNetworkTier(d.Get("network_tier"), d, config) networkTierProp, err := expandComputeAddressNetworkTier(d.Get("network_tier"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("network_tier"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkTierProp)) { } else if v, ok := d.GetOkExists("network_tier"); !isEmptyValue(reflect.ValueOf(networkTierProp)) && (ok || !reflect.DeepEqual(v, networkTierProp)) {
obj["networkTier"] = networkTierProp obj["networkTier"] = networkTierProp
} }
subnetworkProp, err := expandComputeAddressSubnetwork(d.Get("subnetwork"), d, config) subnetworkProp, err := expandComputeAddressSubnetwork(d.Get("subnetwork"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("subnetwork"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, subnetworkProp)) { } else if v, ok := d.GetOkExists("subnetwork"); !isEmptyValue(reflect.ValueOf(subnetworkProp)) && (ok || !reflect.DeepEqual(v, subnetworkProp)) {
obj["subnetwork"] = subnetworkProp obj["subnetwork"] = subnetworkProp
} }
regionProp, err := expandComputeAddressRegion(d.Get("region"), d, config) regionProp, err := expandComputeAddressRegion(d.Get("region"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, regionProp)) { } else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(regionProp)) && (ok || !reflect.DeepEqual(v, regionProp)) {
obj["region"] = regionProp obj["region"] = regionProp
} }

View File

@ -90,25 +90,25 @@ func resourceComputeBackendBucketCreate(d *schema.ResourceData, meta interface{}
bucketNameProp, err := expandComputeBackendBucketBucketName(d.Get("bucket_name"), d, config) bucketNameProp, err := expandComputeBackendBucketBucketName(d.Get("bucket_name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("bucket_name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, bucketNameProp)) { } else if v, ok := d.GetOkExists("bucket_name"); !isEmptyValue(reflect.ValueOf(bucketNameProp)) && (ok || !reflect.DeepEqual(v, bucketNameProp)) {
obj["bucketName"] = bucketNameProp obj["bucketName"] = bucketNameProp
} }
descriptionProp, err := expandComputeBackendBucketDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeBackendBucketDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
enableCdnProp, err := expandComputeBackendBucketEnableCdn(d.Get("enable_cdn"), d, config) enableCdnProp, err := expandComputeBackendBucketEnableCdn(d.Get("enable_cdn"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("enable_cdn"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, enableCdnProp)) { } else if v, ok := d.GetOkExists("enable_cdn"); !isEmptyValue(reflect.ValueOf(enableCdnProp)) && (ok || !reflect.DeepEqual(v, enableCdnProp)) {
obj["enableCdn"] = enableCdnProp obj["enableCdn"] = enableCdnProp
} }
nameProp, err := expandComputeBackendBucketName(d.Get("name"), d, config) nameProp, err := expandComputeBackendBucketName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }

View File

@ -439,67 +439,67 @@ func resourceComputeDiskCreate(d *schema.ResourceData, meta interface{}) error {
descriptionProp, err := expandComputeDiskDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeDiskDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
labelsProp, err := expandComputeDiskLabels(d.Get("labels"), d, config) labelsProp, err := expandComputeDiskLabels(d.Get("labels"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("labels"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, labelsProp)) { } else if v, ok := d.GetOkExists("labels"); !isEmptyValue(reflect.ValueOf(labelsProp)) && (ok || !reflect.DeepEqual(v, labelsProp)) {
obj["labels"] = labelsProp obj["labels"] = labelsProp
} }
nameProp, err := expandComputeDiskName(d.Get("name"), d, config) nameProp, err := expandComputeDiskName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
sizeGbProp, err := expandComputeDiskSize(d.Get("size"), d, config) sizeGbProp, err := expandComputeDiskSize(d.Get("size"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("size"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sizeGbProp)) { } else if v, ok := d.GetOkExists("size"); !isEmptyValue(reflect.ValueOf(sizeGbProp)) && (ok || !reflect.DeepEqual(v, sizeGbProp)) {
obj["sizeGb"] = sizeGbProp obj["sizeGb"] = sizeGbProp
} }
sourceImageProp, err := expandComputeDiskImage(d.Get("image"), d, config) sourceImageProp, err := expandComputeDiskImage(d.Get("image"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("image"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sourceImageProp)) { } else if v, ok := d.GetOkExists("image"); !isEmptyValue(reflect.ValueOf(sourceImageProp)) && (ok || !reflect.DeepEqual(v, sourceImageProp)) {
obj["sourceImage"] = sourceImageProp obj["sourceImage"] = sourceImageProp
} }
typeProp, err := expandComputeDiskType(d.Get("type"), d, config) typeProp, err := expandComputeDiskType(d.Get("type"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("type"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, typeProp)) { } else if v, ok := d.GetOkExists("type"); !isEmptyValue(reflect.ValueOf(typeProp)) && (ok || !reflect.DeepEqual(v, typeProp)) {
obj["type"] = typeProp obj["type"] = typeProp
} }
zoneProp, err := expandComputeDiskZone(d.Get("zone"), d, config) zoneProp, err := expandComputeDiskZone(d.Get("zone"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("zone"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, zoneProp)) { } else if v, ok := d.GetOkExists("zone"); !isEmptyValue(reflect.ValueOf(zoneProp)) && (ok || !reflect.DeepEqual(v, zoneProp)) {
obj["zone"] = zoneProp obj["zone"] = zoneProp
} }
diskEncryptionKeyProp, err := expandComputeDiskDiskEncryptionKey(d.Get("disk_encryption_key"), d, config) diskEncryptionKeyProp, err := expandComputeDiskDiskEncryptionKey(d.Get("disk_encryption_key"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("disk_encryption_key"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, diskEncryptionKeyProp)) { } else if v, ok := d.GetOkExists("disk_encryption_key"); !isEmptyValue(reflect.ValueOf(diskEncryptionKeyProp)) && (ok || !reflect.DeepEqual(v, diskEncryptionKeyProp)) {
obj["diskEncryptionKey"] = diskEncryptionKeyProp obj["diskEncryptionKey"] = diskEncryptionKeyProp
} }
sourceImageEncryptionKeyProp, err := expandComputeDiskSourceImageEncryptionKey(d.Get("source_image_encryption_key"), d, config) sourceImageEncryptionKeyProp, err := expandComputeDiskSourceImageEncryptionKey(d.Get("source_image_encryption_key"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("source_image_encryption_key"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sourceImageEncryptionKeyProp)) { } else if v, ok := d.GetOkExists("source_image_encryption_key"); !isEmptyValue(reflect.ValueOf(sourceImageEncryptionKeyProp)) && (ok || !reflect.DeepEqual(v, sourceImageEncryptionKeyProp)) {
obj["sourceImageEncryptionKey"] = sourceImageEncryptionKeyProp obj["sourceImageEncryptionKey"] = sourceImageEncryptionKeyProp
} }
sourceSnapshotProp, err := expandComputeDiskSnapshot(d.Get("snapshot"), d, config) sourceSnapshotProp, err := expandComputeDiskSnapshot(d.Get("snapshot"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("snapshot"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sourceSnapshotProp)) { } else if v, ok := d.GetOkExists("snapshot"); !isEmptyValue(reflect.ValueOf(sourceSnapshotProp)) && (ok || !reflect.DeepEqual(v, sourceSnapshotProp)) {
obj["sourceSnapshot"] = sourceSnapshotProp obj["sourceSnapshot"] = sourceSnapshotProp
} }
sourceSnapshotEncryptionKeyProp, err := expandComputeDiskSourceSnapshotEncryptionKey(d.Get("source_snapshot_encryption_key"), d, config) sourceSnapshotEncryptionKeyProp, err := expandComputeDiskSourceSnapshotEncryptionKey(d.Get("source_snapshot_encryption_key"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("source_snapshot_encryption_key"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sourceSnapshotEncryptionKeyProp)) { } else if v, ok := d.GetOkExists("source_snapshot_encryption_key"); !isEmptyValue(reflect.ValueOf(sourceSnapshotEncryptionKeyProp)) && (ok || !reflect.DeepEqual(v, sourceSnapshotEncryptionKeyProp)) {
obj["sourceSnapshotEncryptionKey"] = sourceSnapshotEncryptionKeyProp obj["sourceSnapshotEncryptionKey"] = sourceSnapshotEncryptionKeyProp
} }

View File

@ -92,19 +92,19 @@ func resourceComputeGlobalAddressCreate(d *schema.ResourceData, meta interface{}
descriptionProp, err := expandComputeGlobalAddressDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeGlobalAddressDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeGlobalAddressName(d.Get("name"), d, config) nameProp, err := expandComputeGlobalAddressName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
ipVersionProp, err := expandComputeGlobalAddressIpVersion(d.Get("ip_version"), d, config) ipVersionProp, err := expandComputeGlobalAddressIpVersion(d.Get("ip_version"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("ip_version"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, ipVersionProp)) { } else if v, ok := d.GetOkExists("ip_version"); !isEmptyValue(reflect.ValueOf(ipVersionProp)) && (ok || !reflect.DeepEqual(v, ipVersionProp)) {
obj["ipVersion"] = ipVersionProp obj["ipVersion"] = ipVersionProp
} }

View File

@ -116,55 +116,55 @@ func resourceComputeHttpHealthCheckCreate(d *schema.ResourceData, meta interface
checkIntervalSecProp, err := expandComputeHttpHealthCheckCheckIntervalSec(d.Get("check_interval_sec"), d, config) checkIntervalSecProp, err := expandComputeHttpHealthCheckCheckIntervalSec(d.Get("check_interval_sec"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("check_interval_sec"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, checkIntervalSecProp)) { } else if v, ok := d.GetOkExists("check_interval_sec"); !isEmptyValue(reflect.ValueOf(checkIntervalSecProp)) && (ok || !reflect.DeepEqual(v, checkIntervalSecProp)) {
obj["checkIntervalSec"] = checkIntervalSecProp obj["checkIntervalSec"] = checkIntervalSecProp
} }
descriptionProp, err := expandComputeHttpHealthCheckDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeHttpHealthCheckDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
healthyThresholdProp, err := expandComputeHttpHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config) healthyThresholdProp, err := expandComputeHttpHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("healthy_threshold"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, healthyThresholdProp)) { } else if v, ok := d.GetOkExists("healthy_threshold"); !isEmptyValue(reflect.ValueOf(healthyThresholdProp)) && (ok || !reflect.DeepEqual(v, healthyThresholdProp)) {
obj["healthyThreshold"] = healthyThresholdProp obj["healthyThreshold"] = healthyThresholdProp
} }
hostProp, err := expandComputeHttpHealthCheckHost(d.Get("host"), d, config) hostProp, err := expandComputeHttpHealthCheckHost(d.Get("host"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("host"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, hostProp)) { } else if v, ok := d.GetOkExists("host"); !isEmptyValue(reflect.ValueOf(hostProp)) && (ok || !reflect.DeepEqual(v, hostProp)) {
obj["host"] = hostProp obj["host"] = hostProp
} }
nameProp, err := expandComputeHttpHealthCheckName(d.Get("name"), d, config) nameProp, err := expandComputeHttpHealthCheckName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
portProp, err := expandComputeHttpHealthCheckPort(d.Get("port"), d, config) portProp, err := expandComputeHttpHealthCheckPort(d.Get("port"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("port"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, portProp)) { } else if v, ok := d.GetOkExists("port"); !isEmptyValue(reflect.ValueOf(portProp)) && (ok || !reflect.DeepEqual(v, portProp)) {
obj["port"] = portProp obj["port"] = portProp
} }
requestPathProp, err := expandComputeHttpHealthCheckRequestPath(d.Get("request_path"), d, config) requestPathProp, err := expandComputeHttpHealthCheckRequestPath(d.Get("request_path"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("request_path"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, requestPathProp)) { } else if v, ok := d.GetOkExists("request_path"); !isEmptyValue(reflect.ValueOf(requestPathProp)) && (ok || !reflect.DeepEqual(v, requestPathProp)) {
obj["requestPath"] = requestPathProp obj["requestPath"] = requestPathProp
} }
timeoutSecProp, err := expandComputeHttpHealthCheckTimeoutSec(d.Get("timeout_sec"), d, config) timeoutSecProp, err := expandComputeHttpHealthCheckTimeoutSec(d.Get("timeout_sec"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("timeout_sec"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, timeoutSecProp)) { } else if v, ok := d.GetOkExists("timeout_sec"); !isEmptyValue(reflect.ValueOf(timeoutSecProp)) && (ok || !reflect.DeepEqual(v, timeoutSecProp)) {
obj["timeoutSec"] = timeoutSecProp obj["timeoutSec"] = timeoutSecProp
} }
unhealthyThresholdProp, err := expandComputeHttpHealthCheckUnhealthyThreshold(d.Get("unhealthy_threshold"), d, config) unhealthyThresholdProp, err := expandComputeHttpHealthCheckUnhealthyThreshold(d.Get("unhealthy_threshold"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("unhealthy_threshold"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, unhealthyThresholdProp)) { } else if v, ok := d.GetOkExists("unhealthy_threshold"); !isEmptyValue(reflect.ValueOf(unhealthyThresholdProp)) && (ok || !reflect.DeepEqual(v, unhealthyThresholdProp)) {
obj["unhealthyThreshold"] = unhealthyThresholdProp obj["unhealthyThreshold"] = unhealthyThresholdProp
} }

View File

@ -116,55 +116,55 @@ func resourceComputeHttpsHealthCheckCreate(d *schema.ResourceData, meta interfac
checkIntervalSecProp, err := expandComputeHttpsHealthCheckCheckIntervalSec(d.Get("check_interval_sec"), d, config) checkIntervalSecProp, err := expandComputeHttpsHealthCheckCheckIntervalSec(d.Get("check_interval_sec"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("check_interval_sec"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, checkIntervalSecProp)) { } else if v, ok := d.GetOkExists("check_interval_sec"); !isEmptyValue(reflect.ValueOf(checkIntervalSecProp)) && (ok || !reflect.DeepEqual(v, checkIntervalSecProp)) {
obj["checkIntervalSec"] = checkIntervalSecProp obj["checkIntervalSec"] = checkIntervalSecProp
} }
descriptionProp, err := expandComputeHttpsHealthCheckDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeHttpsHealthCheckDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
healthyThresholdProp, err := expandComputeHttpsHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config) healthyThresholdProp, err := expandComputeHttpsHealthCheckHealthyThreshold(d.Get("healthy_threshold"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("healthy_threshold"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, healthyThresholdProp)) { } else if v, ok := d.GetOkExists("healthy_threshold"); !isEmptyValue(reflect.ValueOf(healthyThresholdProp)) && (ok || !reflect.DeepEqual(v, healthyThresholdProp)) {
obj["healthyThreshold"] = healthyThresholdProp obj["healthyThreshold"] = healthyThresholdProp
} }
hostProp, err := expandComputeHttpsHealthCheckHost(d.Get("host"), d, config) hostProp, err := expandComputeHttpsHealthCheckHost(d.Get("host"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("host"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, hostProp)) { } else if v, ok := d.GetOkExists("host"); !isEmptyValue(reflect.ValueOf(hostProp)) && (ok || !reflect.DeepEqual(v, hostProp)) {
obj["host"] = hostProp obj["host"] = hostProp
} }
nameProp, err := expandComputeHttpsHealthCheckName(d.Get("name"), d, config) nameProp, err := expandComputeHttpsHealthCheckName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
portProp, err := expandComputeHttpsHealthCheckPort(d.Get("port"), d, config) portProp, err := expandComputeHttpsHealthCheckPort(d.Get("port"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("port"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, portProp)) { } else if v, ok := d.GetOkExists("port"); !isEmptyValue(reflect.ValueOf(portProp)) && (ok || !reflect.DeepEqual(v, portProp)) {
obj["port"] = portProp obj["port"] = portProp
} }
requestPathProp, err := expandComputeHttpsHealthCheckRequestPath(d.Get("request_path"), d, config) requestPathProp, err := expandComputeHttpsHealthCheckRequestPath(d.Get("request_path"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("request_path"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, requestPathProp)) { } else if v, ok := d.GetOkExists("request_path"); !isEmptyValue(reflect.ValueOf(requestPathProp)) && (ok || !reflect.DeepEqual(v, requestPathProp)) {
obj["requestPath"] = requestPathProp obj["requestPath"] = requestPathProp
} }
timeoutSecProp, err := expandComputeHttpsHealthCheckTimeoutSec(d.Get("timeout_sec"), d, config) timeoutSecProp, err := expandComputeHttpsHealthCheckTimeoutSec(d.Get("timeout_sec"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("timeout_sec"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, timeoutSecProp)) { } else if v, ok := d.GetOkExists("timeout_sec"); !isEmptyValue(reflect.ValueOf(timeoutSecProp)) && (ok || !reflect.DeepEqual(v, timeoutSecProp)) {
obj["timeoutSec"] = timeoutSecProp obj["timeoutSec"] = timeoutSecProp
} }
unhealthyThresholdProp, err := expandComputeHttpsHealthCheckUnhealthyThreshold(d.Get("unhealthy_threshold"), d, config) unhealthyThresholdProp, err := expandComputeHttpsHealthCheckUnhealthyThreshold(d.Get("unhealthy_threshold"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("unhealthy_threshold"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, unhealthyThresholdProp)) { } else if v, ok := d.GetOkExists("unhealthy_threshold"); !isEmptyValue(reflect.ValueOf(unhealthyThresholdProp)) && (ok || !reflect.DeepEqual(v, unhealthyThresholdProp)) {
obj["unhealthyThreshold"] = unhealthyThresholdProp obj["unhealthyThreshold"] = unhealthyThresholdProp
} }

View File

@ -135,61 +135,61 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error
destRangeProp, err := expandComputeRouteDestRange(d.Get("dest_range"), d, config) destRangeProp, err := expandComputeRouteDestRange(d.Get("dest_range"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("dest_range"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, destRangeProp)) { } else if v, ok := d.GetOkExists("dest_range"); !isEmptyValue(reflect.ValueOf(destRangeProp)) && (ok || !reflect.DeepEqual(v, destRangeProp)) {
obj["destRange"] = destRangeProp obj["destRange"] = destRangeProp
} }
descriptionProp, err := expandComputeRouteDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeRouteDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeRouteName(d.Get("name"), d, config) nameProp, err := expandComputeRouteName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
networkProp, err := expandComputeRouteNetwork(d.Get("network"), d, config) networkProp, err := expandComputeRouteNetwork(d.Get("network"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkProp)) { } else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
obj["network"] = networkProp obj["network"] = networkProp
} }
priorityProp, err := expandComputeRoutePriority(d.Get("priority"), d, config) priorityProp, err := expandComputeRoutePriority(d.Get("priority"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("priority"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, priorityProp)) { } else if v, ok := d.GetOkExists("priority"); !isEmptyValue(reflect.ValueOf(priorityProp)) && (ok || !reflect.DeepEqual(v, priorityProp)) {
obj["priority"] = priorityProp obj["priority"] = priorityProp
} }
tagsProp, err := expandComputeRouteTags(d.Get("tags"), d, config) tagsProp, err := expandComputeRouteTags(d.Get("tags"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("tags"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, tagsProp)) { } else if v, ok := d.GetOkExists("tags"); !isEmptyValue(reflect.ValueOf(tagsProp)) && (ok || !reflect.DeepEqual(v, tagsProp)) {
obj["tags"] = tagsProp obj["tags"] = tagsProp
} }
nextHopGatewayProp, err := expandComputeRouteNextHopGateway(d.Get("next_hop_gateway"), d, config) nextHopGatewayProp, err := expandComputeRouteNextHopGateway(d.Get("next_hop_gateway"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("next_hop_gateway"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nextHopGatewayProp)) { } else if v, ok := d.GetOkExists("next_hop_gateway"); !isEmptyValue(reflect.ValueOf(nextHopGatewayProp)) && (ok || !reflect.DeepEqual(v, nextHopGatewayProp)) {
obj["nextHopGateway"] = nextHopGatewayProp obj["nextHopGateway"] = nextHopGatewayProp
} }
nextHopInstanceProp, err := expandComputeRouteNextHopInstance(d.Get("next_hop_instance"), d, config) nextHopInstanceProp, err := expandComputeRouteNextHopInstance(d.Get("next_hop_instance"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("next_hop_instance"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nextHopInstanceProp)) { } else if v, ok := d.GetOkExists("next_hop_instance"); !isEmptyValue(reflect.ValueOf(nextHopInstanceProp)) && (ok || !reflect.DeepEqual(v, nextHopInstanceProp)) {
obj["nextHopInstance"] = nextHopInstanceProp obj["nextHopInstance"] = nextHopInstanceProp
} }
nextHopIpProp, err := expandComputeRouteNextHopIp(d.Get("next_hop_ip"), d, config) nextHopIpProp, err := expandComputeRouteNextHopIp(d.Get("next_hop_ip"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("next_hop_ip"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nextHopIpProp)) { } else if v, ok := d.GetOkExists("next_hop_ip"); !isEmptyValue(reflect.ValueOf(nextHopIpProp)) && (ok || !reflect.DeepEqual(v, nextHopIpProp)) {
obj["nextHopIp"] = nextHopIpProp obj["nextHopIp"] = nextHopIpProp
} }
nextHopVpnTunnelProp, err := expandComputeRouteNextHopVpnTunnel(d.Get("next_hop_vpn_tunnel"), d, config) nextHopVpnTunnelProp, err := expandComputeRouteNextHopVpnTunnel(d.Get("next_hop_vpn_tunnel"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("next_hop_vpn_tunnel"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nextHopVpnTunnelProp)) { } else if v, ok := d.GetOkExists("next_hop_vpn_tunnel"); !isEmptyValue(reflect.ValueOf(nextHopVpnTunnelProp)) && (ok || !reflect.DeepEqual(v, nextHopVpnTunnelProp)) {
obj["nextHopVpnTunnel"] = nextHopVpnTunnelProp obj["nextHopVpnTunnel"] = nextHopVpnTunnelProp
} }

View File

@ -137,31 +137,31 @@ func resourceComputeSslPolicyCreate(d *schema.ResourceData, meta interface{}) er
descriptionProp, err := expandComputeSslPolicyDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeSslPolicyDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeSslPolicyName(d.Get("name"), d, config) nameProp, err := expandComputeSslPolicyName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
profileProp, err := expandComputeSslPolicyProfile(d.Get("profile"), d, config) profileProp, err := expandComputeSslPolicyProfile(d.Get("profile"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("profile"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, profileProp)) { } else if v, ok := d.GetOkExists("profile"); !isEmptyValue(reflect.ValueOf(profileProp)) && (ok || !reflect.DeepEqual(v, profileProp)) {
obj["profile"] = profileProp obj["profile"] = profileProp
} }
minTlsVersionProp, err := expandComputeSslPolicyMinTlsVersion(d.Get("min_tls_version"), d, config) minTlsVersionProp, err := expandComputeSslPolicyMinTlsVersion(d.Get("min_tls_version"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("min_tls_version"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, minTlsVersionProp)) { } else if v, ok := d.GetOkExists("min_tls_version"); !isEmptyValue(reflect.ValueOf(minTlsVersionProp)) && (ok || !reflect.DeepEqual(v, minTlsVersionProp)) {
obj["minTlsVersion"] = minTlsVersionProp obj["minTlsVersion"] = minTlsVersionProp
} }
customFeaturesProp, err := expandComputeSslPolicyCustomFeatures(d.Get("custom_features"), d, config) customFeaturesProp, err := expandComputeSslPolicyCustomFeatures(d.Get("custom_features"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("custom_features"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, customFeaturesProp)) { } else if v, ok := d.GetOkExists("custom_features"); !isEmptyValue(reflect.ValueOf(customFeaturesProp)) && (ok || !reflect.DeepEqual(v, customFeaturesProp)) {
obj["customFeatures"] = customFeaturesProp obj["customFeatures"] = customFeaturesProp
} }

View File

@ -169,25 +169,25 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
descriptionProp, err := expandComputeSubnetworkDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeSubnetworkDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
ipCidrRangeProp, err := expandComputeSubnetworkIpCidrRange(d.Get("ip_cidr_range"), d, config) ipCidrRangeProp, err := expandComputeSubnetworkIpCidrRange(d.Get("ip_cidr_range"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("ip_cidr_range"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, ipCidrRangeProp)) { } else if v, ok := d.GetOkExists("ip_cidr_range"); !isEmptyValue(reflect.ValueOf(ipCidrRangeProp)) && (ok || !reflect.DeepEqual(v, ipCidrRangeProp)) {
obj["ipCidrRange"] = ipCidrRangeProp obj["ipCidrRange"] = ipCidrRangeProp
} }
nameProp, err := expandComputeSubnetworkName(d.Get("name"), d, config) nameProp, err := expandComputeSubnetworkName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
networkProp, err := expandComputeSubnetworkNetwork(d.Get("network"), d, config) networkProp, err := expandComputeSubnetworkNetwork(d.Get("network"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkProp)) { } else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
obj["network"] = networkProp obj["network"] = networkProp
} }
enableFlowLogsProp, err := expandComputeSubnetworkEnableFlowLogs(d.Get("enable_flow_logs"), d, config) enableFlowLogsProp, err := expandComputeSubnetworkEnableFlowLogs(d.Get("enable_flow_logs"), d, config)
@ -199,19 +199,19 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
secondaryIpRangesProp, err := expandComputeSubnetworkSecondaryIpRange(d.Get("secondary_ip_range"), d, config) secondaryIpRangesProp, err := expandComputeSubnetworkSecondaryIpRange(d.Get("secondary_ip_range"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("secondary_ip_range"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, secondaryIpRangesProp)) { } else if v, ok := d.GetOkExists("secondary_ip_range"); !isEmptyValue(reflect.ValueOf(secondaryIpRangesProp)) && (ok || !reflect.DeepEqual(v, secondaryIpRangesProp)) {
obj["secondaryIpRanges"] = secondaryIpRangesProp obj["secondaryIpRanges"] = secondaryIpRangesProp
} }
privateIpGoogleAccessProp, err := expandComputeSubnetworkPrivateIpGoogleAccess(d.Get("private_ip_google_access"), d, config) privateIpGoogleAccessProp, err := expandComputeSubnetworkPrivateIpGoogleAccess(d.Get("private_ip_google_access"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("private_ip_google_access"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, privateIpGoogleAccessProp)) { } else if v, ok := d.GetOkExists("private_ip_google_access"); !isEmptyValue(reflect.ValueOf(privateIpGoogleAccessProp)) && (ok || !reflect.DeepEqual(v, privateIpGoogleAccessProp)) {
obj["privateIpGoogleAccess"] = privateIpGoogleAccessProp obj["privateIpGoogleAccess"] = privateIpGoogleAccessProp
} }
regionProp, err := expandComputeSubnetworkRegion(d.Get("region"), d, config) regionProp, err := expandComputeSubnetworkRegion(d.Get("region"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, regionProp)) { } else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(regionProp)) && (ok || !reflect.DeepEqual(v, regionProp)) {
obj["region"] = regionProp obj["region"] = regionProp
} }

View File

@ -92,19 +92,19 @@ func resourceComputeTargetHttpProxyCreate(d *schema.ResourceData, meta interface
descriptionProp, err := expandComputeTargetHttpProxyDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeTargetHttpProxyDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeTargetHttpProxyName(d.Get("name"), d, config) nameProp, err := expandComputeTargetHttpProxyName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
urlMapProp, err := expandComputeTargetHttpProxyUrlMap(d.Get("url_map"), d, config) urlMapProp, err := expandComputeTargetHttpProxyUrlMap(d.Get("url_map"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("url_map"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, urlMapProp)) { } else if v, ok := d.GetOkExists("url_map"); !isEmptyValue(reflect.ValueOf(urlMapProp)) && (ok || !reflect.DeepEqual(v, urlMapProp)) {
obj["urlMap"] = urlMapProp obj["urlMap"] = urlMapProp
} }

View File

@ -105,31 +105,31 @@ func resourceComputeTargetHttpsProxyCreate(d *schema.ResourceData, meta interfac
descriptionProp, err := expandComputeTargetHttpsProxyDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeTargetHttpsProxyDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeTargetHttpsProxyName(d.Get("name"), d, config) nameProp, err := expandComputeTargetHttpsProxyName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
sslCertificatesProp, err := expandComputeTargetHttpsProxySslCertificates(d.Get("ssl_certificates"), d, config) sslCertificatesProp, err := expandComputeTargetHttpsProxySslCertificates(d.Get("ssl_certificates"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("ssl_certificates"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sslCertificatesProp)) { } else if v, ok := d.GetOkExists("ssl_certificates"); !isEmptyValue(reflect.ValueOf(sslCertificatesProp)) && (ok || !reflect.DeepEqual(v, sslCertificatesProp)) {
obj["sslCertificates"] = sslCertificatesProp obj["sslCertificates"] = sslCertificatesProp
} }
urlMapProp, err := expandComputeTargetHttpsProxyUrlMap(d.Get("url_map"), d, config) urlMapProp, err := expandComputeTargetHttpsProxyUrlMap(d.Get("url_map"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("url_map"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, urlMapProp)) { } else if v, ok := d.GetOkExists("url_map"); !isEmptyValue(reflect.ValueOf(urlMapProp)) && (ok || !reflect.DeepEqual(v, urlMapProp)) {
obj["urlMap"] = urlMapProp obj["urlMap"] = urlMapProp
} }
sslPolicyProp, err := expandComputeTargetHttpsProxySslPolicy(d.Get("ssl_policy"), d, config) sslPolicyProp, err := expandComputeTargetHttpsProxySslPolicy(d.Get("ssl_policy"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("ssl_policy"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sslPolicyProp)) { } else if v, ok := d.GetOkExists("ssl_policy"); !isEmptyValue(reflect.ValueOf(sslPolicyProp)) && (ok || !reflect.DeepEqual(v, sslPolicyProp)) {
obj["sslPolicy"] = sslPolicyProp obj["sslPolicy"] = sslPolicyProp
} }

View File

@ -113,37 +113,37 @@ func resourceComputeTargetSslProxyCreate(d *schema.ResourceData, meta interface{
descriptionProp, err := expandComputeTargetSslProxyDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeTargetSslProxyDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeTargetSslProxyName(d.Get("name"), d, config) nameProp, err := expandComputeTargetSslProxyName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
proxyHeaderProp, err := expandComputeTargetSslProxyProxyHeader(d.Get("proxy_header"), d, config) proxyHeaderProp, err := expandComputeTargetSslProxyProxyHeader(d.Get("proxy_header"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("proxy_header"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, proxyHeaderProp)) { } else if v, ok := d.GetOkExists("proxy_header"); !isEmptyValue(reflect.ValueOf(proxyHeaderProp)) && (ok || !reflect.DeepEqual(v, proxyHeaderProp)) {
obj["proxyHeader"] = proxyHeaderProp obj["proxyHeader"] = proxyHeaderProp
} }
serviceProp, err := expandComputeTargetSslProxyBackendService(d.Get("backend_service"), d, config) serviceProp, err := expandComputeTargetSslProxyBackendService(d.Get("backend_service"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("backend_service"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, serviceProp)) { } else if v, ok := d.GetOkExists("backend_service"); !isEmptyValue(reflect.ValueOf(serviceProp)) && (ok || !reflect.DeepEqual(v, serviceProp)) {
obj["service"] = serviceProp obj["service"] = serviceProp
} }
sslCertificatesProp, err := expandComputeTargetSslProxySslCertificates(d.Get("ssl_certificates"), d, config) sslCertificatesProp, err := expandComputeTargetSslProxySslCertificates(d.Get("ssl_certificates"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("ssl_certificates"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sslCertificatesProp)) { } else if v, ok := d.GetOkExists("ssl_certificates"); !isEmptyValue(reflect.ValueOf(sslCertificatesProp)) && (ok || !reflect.DeepEqual(v, sslCertificatesProp)) {
obj["sslCertificates"] = sslCertificatesProp obj["sslCertificates"] = sslCertificatesProp
} }
sslPolicyProp, err := expandComputeTargetSslProxySslPolicy(d.Get("ssl_policy"), d, config) sslPolicyProp, err := expandComputeTargetSslProxySslPolicy(d.Get("ssl_policy"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("ssl_policy"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, sslPolicyProp)) { } else if v, ok := d.GetOkExists("ssl_policy"); !isEmptyValue(reflect.ValueOf(sslPolicyProp)) && (ok || !reflect.DeepEqual(v, sslPolicyProp)) {
obj["sslPolicy"] = sslPolicyProp obj["sslPolicy"] = sslPolicyProp
} }

View File

@ -99,25 +99,25 @@ func resourceComputeTargetTcpProxyCreate(d *schema.ResourceData, meta interface{
descriptionProp, err := expandComputeTargetTcpProxyDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeTargetTcpProxyDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeTargetTcpProxyName(d.Get("name"), d, config) nameProp, err := expandComputeTargetTcpProxyName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
proxyHeaderProp, err := expandComputeTargetTcpProxyProxyHeader(d.Get("proxy_header"), d, config) proxyHeaderProp, err := expandComputeTargetTcpProxyProxyHeader(d.Get("proxy_header"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("proxy_header"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, proxyHeaderProp)) { } else if v, ok := d.GetOkExists("proxy_header"); !isEmptyValue(reflect.ValueOf(proxyHeaderProp)) && (ok || !reflect.DeepEqual(v, proxyHeaderProp)) {
obj["proxyHeader"] = proxyHeaderProp obj["proxyHeader"] = proxyHeaderProp
} }
serviceProp, err := expandComputeTargetTcpProxyBackendService(d.Get("backend_service"), d, config) serviceProp, err := expandComputeTargetTcpProxyBackendService(d.Get("backend_service"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("backend_service"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, serviceProp)) { } else if v, ok := d.GetOkExists("backend_service"); !isEmptyValue(reflect.ValueOf(serviceProp)) && (ok || !reflect.DeepEqual(v, serviceProp)) {
obj["service"] = serviceProp obj["service"] = serviceProp
} }

View File

@ -93,25 +93,25 @@ func resourceComputeVpnGatewayCreate(d *schema.ResourceData, meta interface{}) e
descriptionProp, err := expandComputeVpnGatewayDescription(d.Get("description"), d, config) descriptionProp, err := expandComputeVpnGatewayDescription(d.Get("description"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) { } else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp obj["description"] = descriptionProp
} }
nameProp, err := expandComputeVpnGatewayName(d.Get("name"), d, config) nameProp, err := expandComputeVpnGatewayName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
networkProp, err := expandComputeVpnGatewayNetwork(d.Get("network"), d, config) networkProp, err := expandComputeVpnGatewayNetwork(d.Get("network"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkProp)) { } else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) {
obj["network"] = networkProp obj["network"] = networkProp
} }
regionProp, err := expandComputeVpnGatewayRegion(d.Get("region"), d, config) regionProp, err := expandComputeVpnGatewayRegion(d.Get("region"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, regionProp)) { } else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(regionProp)) && (ok || !reflect.DeepEqual(v, regionProp)) {
obj["region"] = regionProp obj["region"] = regionProp
} }

View File

@ -144,67 +144,67 @@ func resourceRedisInstanceCreate(d *schema.ResourceData, meta interface{}) error
alternativeLocationIdProp, err := expandRedisInstanceAlternativeLocationId(d.Get("alternative_location_id"), d, config) alternativeLocationIdProp, err := expandRedisInstanceAlternativeLocationId(d.Get("alternative_location_id"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("alternative_location_id"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, alternativeLocationIdProp)) { } else if v, ok := d.GetOkExists("alternative_location_id"); !isEmptyValue(reflect.ValueOf(alternativeLocationIdProp)) && (ok || !reflect.DeepEqual(v, alternativeLocationIdProp)) {
obj["alternativeLocationId"] = alternativeLocationIdProp obj["alternativeLocationId"] = alternativeLocationIdProp
} }
authorizedNetworkProp, err := expandRedisInstanceAuthorizedNetwork(d.Get("authorized_network"), d, config) authorizedNetworkProp, err := expandRedisInstanceAuthorizedNetwork(d.Get("authorized_network"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("authorized_network"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, authorizedNetworkProp)) { } else if v, ok := d.GetOkExists("authorized_network"); !isEmptyValue(reflect.ValueOf(authorizedNetworkProp)) && (ok || !reflect.DeepEqual(v, authorizedNetworkProp)) {
obj["authorizedNetwork"] = authorizedNetworkProp obj["authorizedNetwork"] = authorizedNetworkProp
} }
displayNameProp, err := expandRedisInstanceDisplayName(d.Get("display_name"), d, config) displayNameProp, err := expandRedisInstanceDisplayName(d.Get("display_name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("display_name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, displayNameProp)) { } else if v, ok := d.GetOkExists("display_name"); !isEmptyValue(reflect.ValueOf(displayNameProp)) && (ok || !reflect.DeepEqual(v, displayNameProp)) {
obj["displayName"] = displayNameProp obj["displayName"] = displayNameProp
} }
labelsProp, err := expandRedisInstanceLabels(d.Get("labels"), d, config) labelsProp, err := expandRedisInstanceLabels(d.Get("labels"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("labels"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, labelsProp)) { } else if v, ok := d.GetOkExists("labels"); !isEmptyValue(reflect.ValueOf(labelsProp)) && (ok || !reflect.DeepEqual(v, labelsProp)) {
obj["labels"] = labelsProp obj["labels"] = labelsProp
} }
locationIdProp, err := expandRedisInstanceLocationId(d.Get("location_id"), d, config) locationIdProp, err := expandRedisInstanceLocationId(d.Get("location_id"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("location_id"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, locationIdProp)) { } else if v, ok := d.GetOkExists("location_id"); !isEmptyValue(reflect.ValueOf(locationIdProp)) && (ok || !reflect.DeepEqual(v, locationIdProp)) {
obj["locationId"] = locationIdProp obj["locationId"] = locationIdProp
} }
nameProp, err := expandRedisInstanceName(d.Get("name"), d, config) nameProp, err := expandRedisInstanceName(d.Get("name"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, nameProp)) { } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp obj["name"] = nameProp
} }
memorySizeGbProp, err := expandRedisInstanceMemorySizeGb(d.Get("memory_size_gb"), d, config) memorySizeGbProp, err := expandRedisInstanceMemorySizeGb(d.Get("memory_size_gb"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("memory_size_gb"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, memorySizeGbProp)) { } else if v, ok := d.GetOkExists("memory_size_gb"); !isEmptyValue(reflect.ValueOf(memorySizeGbProp)) && (ok || !reflect.DeepEqual(v, memorySizeGbProp)) {
obj["memorySizeGb"] = memorySizeGbProp obj["memorySizeGb"] = memorySizeGbProp
} }
redisVersionProp, err := expandRedisInstanceRedisVersion(d.Get("redis_version"), d, config) redisVersionProp, err := expandRedisInstanceRedisVersion(d.Get("redis_version"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("redis_version"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, redisVersionProp)) { } else if v, ok := d.GetOkExists("redis_version"); !isEmptyValue(reflect.ValueOf(redisVersionProp)) && (ok || !reflect.DeepEqual(v, redisVersionProp)) {
obj["redisVersion"] = redisVersionProp obj["redisVersion"] = redisVersionProp
} }
reservedIpRangeProp, err := expandRedisInstanceReservedIpRange(d.Get("reserved_ip_range"), d, config) reservedIpRangeProp, err := expandRedisInstanceReservedIpRange(d.Get("reserved_ip_range"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("reserved_ip_range"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, reservedIpRangeProp)) { } else if v, ok := d.GetOkExists("reserved_ip_range"); !isEmptyValue(reflect.ValueOf(reservedIpRangeProp)) && (ok || !reflect.DeepEqual(v, reservedIpRangeProp)) {
obj["reservedIpRange"] = reservedIpRangeProp obj["reservedIpRange"] = reservedIpRangeProp
} }
tierProp, err := expandRedisInstanceTier(d.Get("tier"), d, config) tierProp, err := expandRedisInstanceTier(d.Get("tier"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("tier"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, tierProp)) { } else if v, ok := d.GetOkExists("tier"); !isEmptyValue(reflect.ValueOf(tierProp)) && (ok || !reflect.DeepEqual(v, tierProp)) {
obj["tier"] = tierProp obj["tier"] = tierProp
} }
regionProp, err := expandRedisInstanceRegion(d.Get("region"), d, config) regionProp, err := expandRedisInstanceRegion(d.Get("region"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, regionProp)) { } else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(regionProp)) && (ok || !reflect.DeepEqual(v, regionProp)) {
obj["region"] = regionProp obj["region"] = regionProp
} }

View File

@ -77,25 +77,25 @@ func resourceResourceManagerLienCreate(d *schema.ResourceData, meta interface{})
reasonProp, err := expandResourceManagerLienReason(d.Get("reason"), d, config) reasonProp, err := expandResourceManagerLienReason(d.Get("reason"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("reason"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, reasonProp)) { } else if v, ok := d.GetOkExists("reason"); !isEmptyValue(reflect.ValueOf(reasonProp)) && (ok || !reflect.DeepEqual(v, reasonProp)) {
obj["reason"] = reasonProp obj["reason"] = reasonProp
} }
originProp, err := expandResourceManagerLienOrigin(d.Get("origin"), d, config) originProp, err := expandResourceManagerLienOrigin(d.Get("origin"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("origin"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, originProp)) { } else if v, ok := d.GetOkExists("origin"); !isEmptyValue(reflect.ValueOf(originProp)) && (ok || !reflect.DeepEqual(v, originProp)) {
obj["origin"] = originProp obj["origin"] = originProp
} }
parentProp, err := expandResourceManagerLienParent(d.Get("parent"), d, config) parentProp, err := expandResourceManagerLienParent(d.Get("parent"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("parent"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, parentProp)) { } else if v, ok := d.GetOkExists("parent"); !isEmptyValue(reflect.ValueOf(parentProp)) && (ok || !reflect.DeepEqual(v, parentProp)) {
obj["parent"] = parentProp obj["parent"] = parentProp
} }
restrictionsProp, err := expandResourceManagerLienRestrictions(d.Get("restrictions"), d, config) restrictionsProp, err := expandResourceManagerLienRestrictions(d.Get("restrictions"), d, config)
if err != nil { if err != nil {
return err return err
} else if v, ok := d.GetOkExists("restrictions"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, restrictionsProp)) { } else if v, ok := d.GetOkExists("restrictions"); !isEmptyValue(reflect.ValueOf(restrictionsProp)) && (ok || !reflect.DeepEqual(v, restrictionsProp)) {
obj["restrictions"] = restrictionsProp obj["restrictions"] = restrictionsProp
} }

View File

@ -7,6 +7,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/hashicorp/terraform/helper/customdiff"
"github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation" "github.com/hashicorp/terraform/helper/validation"
@ -48,6 +49,9 @@ func resourceSqlDatabaseInstance() *schema.Resource {
Delete: schema.DefaultTimeout(10 * time.Minute), Delete: schema.DefaultTimeout(10 * time.Minute),
}, },
CustomizeDiff: customdiff.All(
customdiff.ForceNewIfChange("settings.0.disk_size", isDiskShrinkage)),
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"region": &schema.Schema{ "region": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,

View File

@ -17,6 +17,7 @@ func resourceStorageBucketAcl() *schema.Resource {
Read: resourceStorageBucketAclRead, Read: resourceStorageBucketAclRead,
Update: resourceStorageBucketAclUpdate, Update: resourceStorageBucketAclUpdate,
Delete: resourceStorageBucketAclDelete, Delete: resourceStorageBucketAclDelete,
CustomizeDiff: resourceStorageBucketAclCustomizeDiff,
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
"bucket": &schema.Schema{ "bucket": &schema.Schema{
@ -40,6 +41,7 @@ func resourceStorageBucketAcl() *schema.Resource {
"role_entity": &schema.Schema{ "role_entity": &schema.Schema{
Type: schema.TypeList, Type: schema.TypeList,
Optional: true, Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString}, Elem: &schema.Schema{Type: schema.TypeString},
ConflictsWith: []string{"predefined_acl"}, ConflictsWith: []string{"predefined_acl"},
}, },
@ -47,6 +49,33 @@ func resourceStorageBucketAcl() *schema.Resource {
} }
} }
func resourceStorageBucketAclCustomizeDiff(diff *schema.ResourceDiff, meta interface{}) error {
keys := diff.GetChangedKeysPrefix("role_entity")
if len(keys) < 1 {
return nil
}
count := diff.Get("role_entity.#").(int)
if count < 1 {
return nil
}
state := map[string]struct{}{}
conf := map[string]struct{}{}
for i := 0; i < count; i++ {
old, new := diff.GetChange(fmt.Sprintf("role_entity.%d", i))
state[old.(string)] = struct{}{}
conf[new.(string)] = struct{}{}
}
if len(state) != len(conf) {
return nil
}
for k, _ := range state {
if _, ok := conf[k]; !ok {
return nil
}
}
return diff.Clear("role_entity")
}
type RoleEntity struct { type RoleEntity struct {
Role string Role string
Entity string Entity string

View File

@ -138,6 +138,24 @@ func TestAccStorageBucketAcl_predefined(t *testing.T) {
}) })
} }
// Test that we allow the API to reorder our role entities without perma-diffing.
func TestAccStorageBucketAcl_unordered(t *testing.T) {
t.Parallel()
bucketName := testBucketName()
skipIfEnvNotSet(t, "GOOGLE_PROJECT_NUMBER")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccStorageBucketAclDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testGoogleStorageBucketsAclUnordered(bucketName),
},
},
})
}
func testAccCheckGoogleStorageBucketAclDelete(bucket, roleEntityS string) resource.TestCheckFunc { func testAccCheckGoogleStorageBucketAclDelete(bucket, roleEntityS string) resource.TestCheckFunc {
return func(s *terraform.State) error { return func(s *terraform.State) error {
roleEntity, _ := getRoleEntityPair(roleEntityS) roleEntity, _ := getRoleEntityPair(roleEntityS)
@ -244,6 +262,19 @@ resource "google_storage_bucket_acl" "acl" {
`, bucketName, roleEntityOwners, roleEntityEditors, roleEntityViewers, roleEntityBasic2, roleEntityBasic3_reader) `, bucketName, roleEntityOwners, roleEntityEditors, roleEntityViewers, roleEntityBasic2, roleEntityBasic3_reader)
} }
func testGoogleStorageBucketsAclUnordered(bucketName string) string {
return fmt.Sprintf(`
resource "google_storage_bucket" "bucket" {
name = "%s"
}
resource "google_storage_bucket_acl" "acl" {
bucket = "${google_storage_bucket.bucket.name}"
role_entity = ["%s", "%s", "%s", "%s", "%s"]
}
`, bucketName, roleEntityBasic1, roleEntityViewers, roleEntityOwners, roleEntityBasic2, roleEntityEditors)
}
func testGoogleStorageBucketsAclPredefined(bucketName string) string { func testGoogleStorageBucketsAclPredefined(bucketName string) string {
return fmt.Sprintf(` return fmt.Sprintf(`
resource "google_storage_bucket" "bucket" { resource "google_storage_bucket" "bucket" {