From e408ab41815f1719cfa4f6d45700b04316f29641 Mon Sep 17 00:00:00 2001 From: Dana Hoffman Date: Fri, 19 Oct 2018 00:18:06 +0000 Subject: [PATCH] Output from magician generating into ga and beta providers --- ...source_google_container_engine_versions.go | 1 - google-beta/iam_compute_subnetwork.go | 25 ++- google-beta/node_config.go | 10 +- .../resource_binaryauthorization_attestor.go | 3 - .../resource_binaryauthorization_policy.go | 3 - google-beta/resource_compute_autoscaler.go | 8 +- .../resource_compute_backend_bucket.go | 8 +- .../resource_compute_backend_service.go | 9 +- google-beta/resource_compute_disk.go | 10 +- ...resource_compute_global_forwarding_rule.go | 9 +- google-beta/resource_compute_health_check.go | 8 +- .../resource_compute_http_health_check.go | 8 +- .../resource_compute_https_health_check.go | 8 +- ...resource_compute_instance_group_manager.go | 18 +- ...rce_compute_instance_group_manager_test.go | 14 -- ...esource_compute_interconnect_attachment.go | 6 +- .../resource_compute_region_autoscaler.go | 8 +- ...e_compute_region_instance_group_manager.go | 16 +- ...pute_region_instance_group_manager_test.go | 15 +- google-beta/resource_compute_route.go | 6 +- google-beta/resource_compute_router.go | 8 +- .../resource_compute_ssl_certificate.go | 6 +- google-beta/resource_compute_ssl_policy.go | 8 +- .../resource_compute_target_http_proxy.go | 8 +- .../resource_compute_target_https_proxy.go | 14 +- .../resource_compute_target_ssl_proxy.go | 14 +- .../resource_compute_target_tcp_proxy.go | 10 +- google-beta/resource_compute_vpn_gateway.go | 6 +- google-beta/resource_container_cluster.go | 36 ++-- google-beta/resource_container_node_pool.go | 16 +- .../resource_containeranalysis_note.go | 3 - google-beta/resource_filestore_instance.go | 3 - google-beta/resource_redis_instance.go | 8 +- ...binaryauthorization_attestor.html.markdown | 20 +-- .../binaryauthorization_policy.html.markdown | 34 ++-- website/docs/r/compute_address.html.markdown | 35 +++- .../docs/r/compute_autoscaler.html.markdown | 5 +- website/docs/r/compute_disk.html.markdown | 10 -- website/docs/r/compute_firewall.html.markdown | 3 +- .../r/compute_forwarding_rule.html.markdown | 9 +- .../r/compute_global_address.html.markdown | 12 +- ...pute_interconnect_attachment.html.markdown | 1 + .../r/compute_region_autoscaler.html.markdown | 5 +- .../r/compute_ssl_certificate.html.markdown | 71 ++++++-- .../r/compute_target_http_proxy.html.markdown | 7 +- .../compute_target_https_proxy.html.markdown | 6 +- .../r/compute_target_ssl_proxy.html.markdown | 18 +- .../r/compute_target_tcp_proxy.html.markdown | 11 +- website/docs/r/compute_url_map.html.markdown | 167 +++++++++++++----- .../docs/r/compute_vpn_gateway.html.markdown | 15 +- .../docs/r/compute_vpn_tunnel.html.markdown | 46 ++--- .../r/containeranalysis_note.html.markdown | 2 - .../docs/r/filestore_instance.html.markdown | 29 ++- .../r/monitoring_alert_policy.html.markdown | 29 ++- website/docs/r/redis_instance.html.markdown | 24 ++- .../docs/r/resourcemanager_lien.html.markdown | 16 +- ...torage_object_access_control.html.markdown | 138 +++++++++++++++ 57 files changed, 631 insertions(+), 415 deletions(-) create mode 100644 website/docs/r/storage_object_access_control.html.markdown diff --git a/google-beta/data_source_google_container_engine_versions.go b/google-beta/data_source_google_container_engine_versions.go index 5e6e420195..6cd4bd945d 100644 --- a/google-beta/data_source_google_container_engine_versions.go +++ b/google-beta/data_source_google_container_engine_versions.go @@ -20,7 +20,6 @@ func dataSourceGoogleContainerEngineVersions() *schema.Resource { Optional: true, }, "region": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", Type: schema.TypeString, Optional: true, ConflictsWith: []string{"zone"}, diff --git a/google-beta/iam_compute_subnetwork.go b/google-beta/iam_compute_subnetwork.go index 7f9eaa4dde..b30a7b1e80 100644 --- a/google-beta/iam_compute_subnetwork.go +++ b/google-beta/iam_compute_subnetwork.go @@ -12,26 +12,23 @@ import ( var IamComputeSubnetworkSchema = map[string]*schema.Schema{ "subnetwork": { - Deprecated: "This resource is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "project": { - Deprecated: "This resource is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, }, "region": { - Deprecated: "This resource is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, }, } diff --git a/google-beta/node_config.go b/google-beta/node_config.go index 948f60db11..bdade3195f 100644 --- a/google-beta/node_config.go +++ b/google-beta/node_config.go @@ -142,7 +142,6 @@ var schemaNodeConfig = &schema.Schema{ }, "taint": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", Type: schema.TypeList, Optional: true, ForceNew: true, @@ -170,11 +169,10 @@ var schemaNodeConfig = &schema.Schema{ }, "workload_metadata_config": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeList, - Optional: true, - ForceNew: true, - MaxItems: 1, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "node_metadata": { diff --git a/google-beta/resource_binaryauthorization_attestor.go b/google-beta/resource_binaryauthorization_attestor.go index 2948b3b90a..8d1d90ede4 100644 --- a/google-beta/resource_binaryauthorization_attestor.go +++ b/google-beta/resource_binaryauthorization_attestor.go @@ -33,9 +33,6 @@ func resourceBinaryAuthorizationAttestor() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceBinaryAuthorizationAttestorImport, }, - DeprecationMessage: `This resource is in beta and will be removed from this provider. -Use the BinaryAuthorizationAttestor resource in the terraform-provider-google-beta provider to continue using it. -See https://terraform.io/docs/providers/google/provider_versions.html for more details on beta resources.`, Schema: map[string]*schema.Schema{ "attestation_authority_note": { diff --git a/google-beta/resource_binaryauthorization_policy.go b/google-beta/resource_binaryauthorization_policy.go index fcac616f9a..5bc0e01417 100644 --- a/google-beta/resource_binaryauthorization_policy.go +++ b/google-beta/resource_binaryauthorization_policy.go @@ -51,9 +51,6 @@ func resourceBinaryAuthorizationPolicy() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceBinaryAuthorizationPolicyImport, }, - DeprecationMessage: `This resource is in beta and will be removed from this provider. -Use the BinaryAuthorizationPolicy resource in the terraform-provider-google-beta provider to continue using it. -See https://terraform.io/docs/providers/google/provider_versions.html for more details on beta resources.`, Schema: map[string]*schema.Schema{ "default_admission_rule": { diff --git a/google-beta/resource_compute_autoscaler.go b/google-beta/resource_compute_autoscaler.go index dac6dddbad..3e0536ed5c 100644 --- a/google-beta/resource_compute_autoscaler.go +++ b/google-beta/resource_compute_autoscaler.go @@ -189,7 +189,7 @@ func resourceComputeAutoscalerCreate(d *schema.ResourceData, meta interface{}) e obj["zone"] = zoneProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/autoscalers") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/autoscalers") if err != nil { return err } @@ -235,7 +235,7 @@ func resourceComputeAutoscalerCreate(d *schema.ResourceData, meta interface{}) e func resourceComputeAutoscalerRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/autoscalers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/autoscalers/{{name}}") if err != nil { return err } @@ -312,7 +312,7 @@ func resourceComputeAutoscalerUpdate(d *schema.ResourceData, meta interface{}) e obj["zone"] = zoneProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/autoscalers?autoscaler={{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/autoscalers?autoscaler={{name}}") if err != nil { return err } @@ -348,7 +348,7 @@ func resourceComputeAutoscalerUpdate(d *schema.ResourceData, meta interface{}) e func resourceComputeAutoscalerDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/autoscalers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/autoscalers/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_backend_bucket.go b/google-beta/resource_compute_backend_bucket.go index 19d2613cd0..a5043b553c 100644 --- a/google-beta/resource_compute_backend_bucket.go +++ b/google-beta/resource_compute_backend_bucket.go @@ -107,7 +107,7 @@ func resourceComputeBackendBucketCreate(d *schema.ResourceData, meta interface{} obj["name"] = nameProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/backendBuckets") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/backendBuckets") if err != nil { return err } @@ -153,7 +153,7 @@ func resourceComputeBackendBucketCreate(d *schema.ResourceData, meta interface{} func resourceComputeBackendBucketRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/backendBuckets/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/backendBuckets/{{name}}") if err != nil { return err } @@ -221,7 +221,7 @@ func resourceComputeBackendBucketUpdate(d *schema.ResourceData, meta interface{} obj["name"] = nameProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/backendBuckets/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/backendBuckets/{{name}}") if err != nil { return err } @@ -257,7 +257,7 @@ func resourceComputeBackendBucketUpdate(d *schema.ResourceData, meta interface{} func resourceComputeBackendBucketDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/backendBuckets/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/backendBuckets/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_backend_service.go b/google-beta/resource_compute_backend_service.go index fd747ed57e..183f763e85 100644 --- a/google-beta/resource_compute_backend_service.go +++ b/google-beta/resource_compute_backend_service.go @@ -159,11 +159,10 @@ func resourceComputeBackendService() *schema.Resource { }, "custom_request_headers": &schema.Schema{ - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeSet, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, }, "description": &schema.Schema{ diff --git a/google-beta/resource_compute_disk.go b/google-beta/resource_compute_disk.go index 576b5c6881..097f72641f 100644 --- a/google-beta/resource_compute_disk.go +++ b/google-beta/resource_compute_disk.go @@ -496,7 +496,7 @@ func resourceComputeDiskCreate(d *schema.ResourceData, meta interface{}) error { return err } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/disks") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/disks") if err != nil { return err } @@ -542,7 +542,7 @@ func resourceComputeDiskCreate(d *schema.ResourceData, meta interface{}) error { func resourceComputeDiskRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/disks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/disks/{{name}}") if err != nil { return err } @@ -645,7 +645,7 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error { obj["labels"] = labelsProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/disks/{{name}}/setLabels") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/disks/{{name}}/setLabels") if err != nil { return err } @@ -684,7 +684,7 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error { obj["sizeGb"] = sizeGbProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/disks/{{name}}/resize") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/disks/{{name}}/resize") if err != nil { return err } @@ -722,7 +722,7 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error { func resourceComputeDiskDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/zones/{{zone}}/disks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/zones/{{zone}}/disks/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_global_forwarding_rule.go b/google-beta/resource_compute_global_forwarding_rule.go index a775861d24..42b3d11fff 100644 --- a/google-beta/resource_compute_global_forwarding_rule.go +++ b/google-beta/resource_compute_global_forwarding_rule.go @@ -56,11 +56,10 @@ func resourceComputeGlobalForwardingRule() *schema.Resource { }, "labels": &schema.Schema{ - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + Type: schema.TypeMap, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, }, "label_fingerprint": &schema.Schema{ diff --git a/google-beta/resource_compute_health_check.go b/google-beta/resource_compute_health_check.go index ff62218f36..a262e61c5d 100644 --- a/google-beta/resource_compute_health_check.go +++ b/google-beta/resource_compute_health_check.go @@ -283,7 +283,7 @@ func resourceComputeHealthCheckCreate(d *schema.ResourceData, meta interface{}) return err } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/healthChecks") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/healthChecks") if err != nil { return err } @@ -329,7 +329,7 @@ func resourceComputeHealthCheckCreate(d *schema.ResourceData, meta interface{}) func resourceComputeHealthCheckRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/healthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/healthChecks/{{name}}") if err != nil { return err } @@ -456,7 +456,7 @@ func resourceComputeHealthCheckUpdate(d *schema.ResourceData, meta interface{}) obj, err = resourceComputeHealthCheckEncoder(d, meta, obj) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/healthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/healthChecks/{{name}}") if err != nil { return err } @@ -492,7 +492,7 @@ func resourceComputeHealthCheckUpdate(d *schema.ResourceData, meta interface{}) func resourceComputeHealthCheckDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/healthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/healthChecks/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_http_health_check.go b/google-beta/resource_compute_http_health_check.go index 5af3a567d4..37d39b468a 100644 --- a/google-beta/resource_compute_http_health_check.go +++ b/google-beta/resource_compute_http_health_check.go @@ -163,7 +163,7 @@ func resourceComputeHttpHealthCheckCreate(d *schema.ResourceData, meta interface obj["unhealthyThreshold"] = unhealthyThresholdProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpHealthChecks") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpHealthChecks") if err != nil { return err } @@ -209,7 +209,7 @@ func resourceComputeHttpHealthCheckCreate(d *schema.ResourceData, meta interface func resourceComputeHttpHealthCheckRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpHealthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpHealthChecks/{{name}}") if err != nil { return err } @@ -322,7 +322,7 @@ func resourceComputeHttpHealthCheckUpdate(d *schema.ResourceData, meta interface obj["unhealthyThreshold"] = unhealthyThresholdProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpHealthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpHealthChecks/{{name}}") if err != nil { return err } @@ -358,7 +358,7 @@ func resourceComputeHttpHealthCheckUpdate(d *schema.ResourceData, meta interface func resourceComputeHttpHealthCheckDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpHealthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpHealthChecks/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_https_health_check.go b/google-beta/resource_compute_https_health_check.go index 7aa6e52928..2f40c4eea6 100644 --- a/google-beta/resource_compute_https_health_check.go +++ b/google-beta/resource_compute_https_health_check.go @@ -163,7 +163,7 @@ func resourceComputeHttpsHealthCheckCreate(d *schema.ResourceData, meta interfac obj["unhealthyThreshold"] = unhealthyThresholdProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpsHealthChecks") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpsHealthChecks") if err != nil { return err } @@ -209,7 +209,7 @@ func resourceComputeHttpsHealthCheckCreate(d *schema.ResourceData, meta interfac func resourceComputeHttpsHealthCheckRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpsHealthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpsHealthChecks/{{name}}") if err != nil { return err } @@ -322,7 +322,7 @@ func resourceComputeHttpsHealthCheckUpdate(d *schema.ResourceData, meta interfac obj["unhealthyThreshold"] = unhealthyThresholdProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpsHealthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpsHealthChecks/{{name}}") if err != nil { return err } @@ -358,7 +358,7 @@ func resourceComputeHttpsHealthCheckUpdate(d *schema.ResourceData, meta interfac func resourceComputeHttpsHealthCheckDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/httpsHealthChecks/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/httpsHealthChecks/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_instance_group_manager.go b/google-beta/resource_compute_instance_group_manager.go index e61e11edec..63139fc17f 100644 --- a/google-beta/resource_compute_instance_group_manager.go +++ b/google-beta/resource_compute_instance_group_manager.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" computeBeta "google.golang.org/api/compute/v0.beta" - compute "google.golang.org/api/compute/v1" + "google.golang.org/api/compute/v1" ) var ( @@ -285,7 +285,6 @@ func resourceComputeInstanceGroupManagerCreate(d *schema.ResourceData, meta inte AutoHealingPolicies: expandAutoHealingPolicies(d.Get("auto_healing_policies").([]interface{})), Versions: expandVersions(d.Get("version").([]interface{})), UpdatePolicy: expandUpdatePolicy(d.Get("update_policy").([]interface{})), - // Force send TargetSize to allow a value of 0. ForceSendFields: []string{"TargetSize"}, } @@ -349,7 +348,6 @@ func flattenFixedOrPercent(fixedOrPercent *computeBeta.FixedOrPercent) []map[str func getManager(d *schema.ResourceData, meta interface{}) (*computeBeta.InstanceGroupManager, error) { config := meta.(*Config) - zonalID, err := parseInstanceGroupManagerId(d.Id()) if err != nil { return nil, err @@ -410,9 +408,14 @@ func resourceComputeInstanceGroupManagerRead(d *schema.ResourceData, meta interf } manager, err := getManager(d, meta) - if err != nil || manager == nil { + if err != nil { return err } + if manager == nil { + log.Printf("[WARN] Instance Group Manager %q not found, removing from state.", d.Id()) + d.SetId("") + return nil + } d.Set("base_instance_name", manager.BaseInstanceName) if err := d.Set("version", flattenVersions(manager.Versions)); err != nil { @@ -432,12 +435,13 @@ func resourceComputeInstanceGroupManagerRead(d *schema.ResourceData, meta interf d.Set("fingerprint", manager.Fingerprint) d.Set("instance_group", ConvertSelfLinkToV1(manager.InstanceGroup)) d.Set("self_link", ConvertSelfLinkToV1(manager.SelfLink)) - if err = d.Set("auto_healing_policies", flattenAutoHealingPolicies(manager.AutoHealingPolicies)); err != nil { - return fmt.Errorf("Error setting auto_healing_policies in state: %s", err.Error()) - } + if err = d.Set("update_policy", flattenUpdatePolicy(manager.UpdatePolicy)); err != nil { return fmt.Errorf("Error setting update_policy in state: %s", err.Error()) } + if err = d.Set("auto_healing_policies", flattenAutoHealingPolicies(manager.AutoHealingPolicies)); err != nil { + return fmt.Errorf("Error setting auto_healing_policies in state: %s", err.Error()) + } if d.Get("wait_for_instances").(bool) { conf := resource.StateChangeConf{ diff --git a/google-beta/resource_compute_instance_group_manager_test.go b/google-beta/resource_compute_instance_group_manager_test.go index 41ea53c877..a08c054581 100644 --- a/google-beta/resource_compute_instance_group_manager_test.go +++ b/google-beta/resource_compute_instance_group_manager_test.go @@ -737,27 +737,22 @@ data "google_compute_image" "my_image" { family = "debian-9" project = "debian-cloud" } - resource "google_compute_instance_template" "igm-rolling-update-policy" { machine_type = "n1-standard-1" can_ip_forward = false tags = ["terraform-testing"] - disk { source_image = "${data.google_compute_image.my_image.self_link}" auto_delete = true boot = true } - network_interface { network = "default" } - lifecycle { create_before_destroy = true } } - resource "google_compute_instance_group_manager" "igm-rolling-update-policy" { description = "Terraform test instance group manager" name = "%s" @@ -788,27 +783,22 @@ data "google_compute_image" "my_image" { family = "debian-9" project = "debian-cloud" } - resource "google_compute_instance_template" "igm-rolling-update-policy" { machine_type = "n1-standard-1" can_ip_forward = false tags = ["terraform-testing"] - disk { source_image = "${data.google_compute_image.my_image.self_link}" auto_delete = true boot = true } - network_interface { network = "default" } - lifecycle { create_before_destroy = true } } - resource "google_compute_instance_group_manager" "igm-rolling-update-policy" { description = "Terraform test instance group manager" name = "%s" @@ -956,7 +946,6 @@ data "google_compute_image" "my_image" { family = "debian-9" project = "debian-cloud" } - resource "google_compute_instance_template" "igm-basic" { name = "%s" machine_type = "n1-standard-1" @@ -977,13 +966,11 @@ resource "google_compute_instance_template" "igm-basic" { scopes = ["userinfo-email", "compute-ro", "storage-ro"] } } - resource "google_compute_target_pool" "igm-basic" { description = "Resource created for Terraform acceptance testing" name = "%s" session_affinity = "CLIENT_IP_PROTO" } - resource "google_compute_instance_group_manager" "igm-basic" { description = "Terraform test instance group manager" name = "%s" @@ -996,7 +983,6 @@ resource "google_compute_instance_group_manager" "igm-basic" { zone = "us-central1-c" target_size = 2 } - resource "google_compute_http_health_check" "zero" { name = "%s" request_path = "/" diff --git a/google-beta/resource_compute_interconnect_attachment.go b/google-beta/resource_compute_interconnect_attachment.go index 09edbff95f..a52183c7fe 100644 --- a/google-beta/resource_compute_interconnect_attachment.go +++ b/google-beta/resource_compute_interconnect_attachment.go @@ -149,7 +149,7 @@ func resourceComputeInterconnectAttachmentCreate(d *schema.ResourceData, meta in obj["region"] = regionProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/interconnectAttachments") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/interconnectAttachments") if err != nil { return err } @@ -195,7 +195,7 @@ func resourceComputeInterconnectAttachmentCreate(d *schema.ResourceData, meta in func resourceComputeInterconnectAttachmentRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}") if err != nil { return err } @@ -252,7 +252,7 @@ func resourceComputeInterconnectAttachmentRead(d *schema.ResourceData, meta inte func resourceComputeInterconnectAttachmentDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_region_autoscaler.go b/google-beta/resource_compute_region_autoscaler.go index 4be06005da..2536e9090d 100644 --- a/google-beta/resource_compute_region_autoscaler.go +++ b/google-beta/resource_compute_region_autoscaler.go @@ -188,7 +188,7 @@ func resourceComputeRegionAutoscalerCreate(d *schema.ResourceData, meta interfac obj["region"] = regionProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/autoscalers") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/autoscalers") if err != nil { return err } @@ -234,7 +234,7 @@ func resourceComputeRegionAutoscalerCreate(d *schema.ResourceData, meta interfac func resourceComputeRegionAutoscalerRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/autoscalers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/autoscalers/{{name}}") if err != nil { return err } @@ -311,7 +311,7 @@ func resourceComputeRegionAutoscalerUpdate(d *schema.ResourceData, meta interfac obj["region"] = regionProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/autoscalers?autoscaler={{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/autoscalers?autoscaler={{name}}") if err != nil { return err } @@ -347,7 +347,7 @@ func resourceComputeRegionAutoscalerUpdate(d *schema.ResourceData, meta interfac func resourceComputeRegionAutoscalerDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/autoscalers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/autoscalers/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_region_instance_group_manager.go b/google-beta/resource_compute_region_instance_group_manager.go index 830c21538e..500f28792b 100644 --- a/google-beta/resource_compute_region_instance_group_manager.go +++ b/google-beta/resource_compute_region_instance_group_manager.go @@ -196,10 +196,10 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource { }, "update_policy": &schema.Schema{ + Computed: true, Type: schema.TypeList, Optional: true, MaxItems: 1, - Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "minimal_action": &schema.Schema{ @@ -283,6 +283,7 @@ func resourceComputeRegionInstanceGroupManagerCreate(d *schema.ResourceData, met } op, err := config.clientComputeBeta.RegionInstanceGroupManagers.Insert(project, region, manager).Do() + if err != nil { return fmt.Errorf("Error creating RegionInstanceGroupManager: %s", err) } @@ -350,7 +351,6 @@ func resourceComputeRegionInstanceGroupManagerRead(d *schema.ResourceData, meta if err != nil { return err } - if manager == nil { log.Printf("[WARN] Region Instance Group Manager %q not found, removing from state.", d.Id()) d.SetId("") @@ -378,23 +378,23 @@ func resourceComputeRegionInstanceGroupManagerRead(d *schema.ResourceData, meta d.Set("project", regionalID.Project) d.Set("target_size", manager.TargetSize) if err := d.Set("target_pools", manager.TargetPools); err != nil { - return err + return fmt.Errorf("Error setting target_pools in state: %s", err.Error()) } if err := d.Set("named_port", flattenNamedPortsBeta(manager.NamedPorts)); err != nil { - return err + return fmt.Errorf("Error setting named_port in state: %s", err.Error()) } d.Set("fingerprint", manager.Fingerprint) d.Set("instance_group", ConvertSelfLinkToV1(manager.InstanceGroup)) if err := d.Set("auto_healing_policies", flattenAutoHealingPolicies(manager.AutoHealingPolicies)); err != nil { - return err - } - if err = d.Set("update_policy", flattenUpdatePolicy(manager.UpdatePolicy)); err != nil { - return fmt.Errorf("Error setting update_policy in state: %s", err.Error()) + return fmt.Errorf("Error setting auto_healing_policies in state: %s", err.Error()) } if err := d.Set("distribution_policy_zones", flattenDistributionPolicy(manager.DistributionPolicy)); err != nil { return err } d.Set("self_link", ConvertSelfLinkToV1(manager.SelfLink)) + if err := d.Set("update_policy", flattenUpdatePolicy(manager.UpdatePolicy)); err != nil { + return fmt.Errorf("Error setting update_policy in state: %s", err.Error()) + } if d.Get("wait_for_instances").(bool) { conf := resource.StateChangeConf{ diff --git a/google-beta/resource_compute_region_instance_group_manager_test.go b/google-beta/resource_compute_region_instance_group_manager_test.go index 643eab80f2..02a6b74c4f 100644 --- a/google-beta/resource_compute_region_instance_group_manager_test.go +++ b/google-beta/resource_compute_region_instance_group_manager_test.go @@ -129,7 +129,7 @@ func TestAccRegionInstanceGroupManager_updateLifecycle(t *testing.T) { }) } -func TestAccRegionInstanceGroupManager_updatePolicy(t *testing.T) { +func TestAccRegionInstanceGroupManager_rollingUpdatePolicy(t *testing.T) { t.Parallel() igm := fmt.Sprintf("igm-test-%s", acctest.RandString(10)) @@ -140,7 +140,7 @@ func TestAccRegionInstanceGroupManager_updatePolicy(t *testing.T) { CheckDestroy: testAccCheckInstanceGroupManagerDestroy, Steps: []resource.TestStep{ { - Config: testAccRegionInstanceGroupManager_updatePolicy(igm), + Config: testAccRegionInstanceGroupManager_rollingUpdatePolicy(igm), }, { ResourceName: "google_compute_region_instance_group_manager.igm-rolling-update-policy", @@ -148,7 +148,7 @@ func TestAccRegionInstanceGroupManager_updatePolicy(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccRegionInstanceGroupManager_updatePolicy2(igm), + Config: testAccRegionInstanceGroupManager_rollingUpdatePolicy2(igm), }, { ResourceName: "google_compute_region_instance_group_manager.igm-rolling-update-policy", @@ -158,7 +158,6 @@ func TestAccRegionInstanceGroupManager_updatePolicy(t *testing.T) { }, }) } - func TestAccRegionInstanceGroupManager_separateRegions(t *testing.T) { t.Parallel() @@ -727,7 +726,6 @@ data "google_compute_image" "my_image" { family = "debian-9" project = "debian-cloud" } - resource "google_compute_instance_template" "igm-basic" { name = "%s" machine_type = "n1-standard-1" @@ -748,13 +746,11 @@ resource "google_compute_instance_template" "igm-basic" { scopes = ["userinfo-email", "compute-ro", "storage-ro"] } } - resource "google_compute_target_pool" "igm-basic" { description = "Resource created for Terraform acceptance testing" name = "%s" session_affinity = "CLIENT_IP_PROTO" } - resource "google_compute_region_instance_group_manager" "igm-basic" { description = "Terraform test instance group manager" name = "%s" @@ -767,7 +763,6 @@ resource "google_compute_region_instance_group_manager" "igm-basic" { region = "us-central1" target_size = 2 } - resource "google_compute_http_health_check" "zero" { name = "%s" request_path = "/" @@ -889,7 +884,7 @@ resource "google_compute_region_instance_group_manager" "igm-basic" { `, template, igm, strings.Join(zones, "\",\"")) } -func testAccRegionInstanceGroupManager_updatePolicy(igm string) string { +func testAccRegionInstanceGroupManager_rollingUpdatePolicy(igm string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { family = "debian-9" @@ -947,7 +942,7 @@ resource "google_compute_region_instance_group_manager" "igm-rolling-update-poli }`, igm) } -func testAccRegionInstanceGroupManager_updatePolicy2(igm string) string { +func testAccRegionInstanceGroupManager_rollingUpdatePolicy2(igm string) string { return fmt.Sprintf(` data "google_compute_image" "my_image" { family = "debian-9" diff --git a/google-beta/resource_compute_route.go b/google-beta/resource_compute_route.go index ecc9f47aa2..61b4fc8065 100644 --- a/google-beta/resource_compute_route.go +++ b/google-beta/resource_compute_route.go @@ -188,7 +188,7 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error obj["nextHopVpnTunnel"] = nextHopVpnTunnelProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/routes") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/routes") if err != nil { return err } @@ -234,7 +234,7 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error func resourceComputeRouteRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/routes/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/routes/{{name}}") if err != nil { return err } @@ -299,7 +299,7 @@ func resourceComputeRouteRead(d *schema.ResourceData, meta interface{}) error { func resourceComputeRouteDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/routes/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/routes/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_router.go b/google-beta/resource_compute_router.go index b00dd5cf6d..d64f583c9c 100644 --- a/google-beta/resource_compute_router.go +++ b/google-beta/resource_compute_router.go @@ -169,7 +169,7 @@ func resourceComputeRouterCreate(d *schema.ResourceData, meta interface{}) error mutexKV.Lock(lockName) defer mutexKV.Unlock(lockName) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/routers") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/routers") if err != nil { return err } @@ -215,7 +215,7 @@ func resourceComputeRouterCreate(d *schema.ResourceData, meta interface{}) error func resourceComputeRouterRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/routers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/routers/{{name}}") if err != nil { return err } @@ -299,7 +299,7 @@ func resourceComputeRouterUpdate(d *schema.ResourceData, meta interface{}) error mutexKV.Lock(lockName) defer mutexKV.Unlock(lockName) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/routers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/routers/{{name}}") if err != nil { return err } @@ -342,7 +342,7 @@ func resourceComputeRouterDelete(d *schema.ResourceData, meta interface{}) error mutexKV.Lock(lockName) defer mutexKV.Unlock(lockName) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/routers/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/routers/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_ssl_certificate.go b/google-beta/resource_compute_ssl_certificate.go index fbd620e15b..1e4521ad74 100644 --- a/google-beta/resource_compute_ssl_certificate.go +++ b/google-beta/resource_compute_ssl_certificate.go @@ -135,7 +135,7 @@ func resourceComputeSslCertificateCreate(d *schema.ResourceData, meta interface{ obj["privateKey"] = privateKeyProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslCertificates") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslCertificates") if err != nil { return err } @@ -181,7 +181,7 @@ func resourceComputeSslCertificateCreate(d *schema.ResourceData, meta interface{ func resourceComputeSslCertificateRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslCertificates/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslCertificates/{{name}}") if err != nil { return err } @@ -223,7 +223,7 @@ func resourceComputeSslCertificateRead(d *schema.ResourceData, meta interface{}) func resourceComputeSslCertificateDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslCertificates/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslCertificates/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_ssl_policy.go b/google-beta/resource_compute_ssl_policy.go index b6313c2763..3379a9dc02 100644 --- a/google-beta/resource_compute_ssl_policy.go +++ b/google-beta/resource_compute_ssl_policy.go @@ -160,7 +160,7 @@ func resourceComputeSslPolicyCreate(d *schema.ResourceData, meta interface{}) er obj["customFeatures"] = customFeaturesProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslPolicies") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslPolicies") if err != nil { return err } @@ -206,7 +206,7 @@ func resourceComputeSslPolicyCreate(d *schema.ResourceData, meta interface{}) er func resourceComputeSslPolicyRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslPolicies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslPolicies/{{name}}") if err != nil { return err } @@ -291,7 +291,7 @@ func resourceComputeSslPolicyUpdate(d *schema.ResourceData, meta interface{}) er obj, err = resourceComputeSslPolicyUpdateEncoder(d, meta, obj) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslPolicies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslPolicies/{{name}}") if err != nil { return err } @@ -327,7 +327,7 @@ func resourceComputeSslPolicyUpdate(d *schema.ResourceData, meta interface{}) er func resourceComputeSslPolicyDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/sslPolicies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/sslPolicies/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_target_http_proxy.go b/google-beta/resource_compute_target_http_proxy.go index 5413776773..43ed77e484 100644 --- a/google-beta/resource_compute_target_http_proxy.go +++ b/google-beta/resource_compute_target_http_proxy.go @@ -103,7 +103,7 @@ func resourceComputeTargetHttpProxyCreate(d *schema.ResourceData, meta interface obj["urlMap"] = urlMapProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpProxies") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpProxies") if err != nil { return err } @@ -149,7 +149,7 @@ func resourceComputeTargetHttpProxyCreate(d *schema.ResourceData, meta interface func resourceComputeTargetHttpProxyRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpProxies/{{name}}") if err != nil { return err } @@ -202,7 +202,7 @@ func resourceComputeTargetHttpProxyUpdate(d *schema.ResourceData, meta interface obj["urlMap"] = urlMapProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/targetHttpProxies/{{name}}/setUrlMap") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/targetHttpProxies/{{name}}/setUrlMap") if err != nil { return err } @@ -240,7 +240,7 @@ func resourceComputeTargetHttpProxyUpdate(d *schema.ResourceData, meta interface func resourceComputeTargetHttpProxyDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpProxies/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_target_https_proxy.go b/google-beta/resource_compute_target_https_proxy.go index e8b5d7aa7c..106bde8cf5 100644 --- a/google-beta/resource_compute_target_https_proxy.go +++ b/google-beta/resource_compute_target_https_proxy.go @@ -140,7 +140,7 @@ func resourceComputeTargetHttpsProxyCreate(d *schema.ResourceData, meta interfac obj["urlMap"] = urlMapProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpsProxies") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpsProxies") if err != nil { return err } @@ -186,7 +186,7 @@ func resourceComputeTargetHttpsProxyCreate(d *schema.ResourceData, meta interfac func resourceComputeTargetHttpsProxyRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpsProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpsProxies/{{name}}") if err != nil { return err } @@ -248,7 +248,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac obj["quicOverride"] = quicOverrideProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpsProxies/{{name}}/setQuicOverride") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpsProxies/{{name}}/setQuicOverride") if err != nil { return err } @@ -286,7 +286,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac obj["sslCertificates"] = sslCertificatesProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/targetHttpsProxies/{{name}}/setSslCertificates") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/targetHttpsProxies/{{name}}/setSslCertificates") if err != nil { return err } @@ -324,7 +324,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac obj["sslPolicy"] = sslPolicyProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpsProxies/{{name}}/setSslPolicy") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpsProxies/{{name}}/setSslPolicy") if err != nil { return err } @@ -362,7 +362,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac obj["urlMap"] = urlMapProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/targetHttpsProxies/{{name}}/setUrlMap") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/targetHttpsProxies/{{name}}/setUrlMap") if err != nil { return err } @@ -400,7 +400,7 @@ func resourceComputeTargetHttpsProxyUpdate(d *schema.ResourceData, meta interfac func resourceComputeTargetHttpsProxyDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetHttpsProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetHttpsProxies/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_target_ssl_proxy.go b/google-beta/resource_compute_target_ssl_proxy.go index 4bc05f0ff5..5198168c65 100644 --- a/google-beta/resource_compute_target_ssl_proxy.go +++ b/google-beta/resource_compute_target_ssl_proxy.go @@ -142,7 +142,7 @@ func resourceComputeTargetSslProxyCreate(d *schema.ResourceData, meta interface{ obj["sslPolicy"] = sslPolicyProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies") if err != nil { return err } @@ -188,7 +188,7 @@ func resourceComputeTargetSslProxyCreate(d *schema.ResourceData, meta interface{ func resourceComputeTargetSslProxyRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies/{{name}}") if err != nil { return err } @@ -250,7 +250,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{ obj["proxyHeader"] = proxyHeaderProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies/{{name}}/setProxyHeader") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies/{{name}}/setProxyHeader") if err != nil { return err } @@ -288,7 +288,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{ obj["service"] = serviceProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies/{{name}}/setBackendService") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies/{{name}}/setBackendService") if err != nil { return err } @@ -326,7 +326,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{ obj["sslCertificates"] = sslCertificatesProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies/{{name}}/setSslCertificates") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies/{{name}}/setSslCertificates") if err != nil { return err } @@ -364,7 +364,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{ obj["sslPolicy"] = sslPolicyProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies/{{name}}/setSslPolicy") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies/{{name}}/setSslPolicy") if err != nil { return err } @@ -402,7 +402,7 @@ func resourceComputeTargetSslProxyUpdate(d *schema.ResourceData, meta interface{ func resourceComputeTargetSslProxyDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetSslProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetSslProxies/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_target_tcp_proxy.go b/google-beta/resource_compute_target_tcp_proxy.go index a750b5ae8d..28262dc7ec 100644 --- a/google-beta/resource_compute_target_tcp_proxy.go +++ b/google-beta/resource_compute_target_tcp_proxy.go @@ -116,7 +116,7 @@ func resourceComputeTargetTcpProxyCreate(d *schema.ResourceData, meta interface{ obj["service"] = serviceProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetTcpProxies") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetTcpProxies") if err != nil { return err } @@ -162,7 +162,7 @@ func resourceComputeTargetTcpProxyCreate(d *schema.ResourceData, meta interface{ func resourceComputeTargetTcpProxyRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetTcpProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetTcpProxies/{{name}}") if err != nil { return err } @@ -218,7 +218,7 @@ func resourceComputeTargetTcpProxyUpdate(d *schema.ResourceData, meta interface{ obj["proxyHeader"] = proxyHeaderProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetTcpProxies/{{name}}/setProxyHeader") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetTcpProxies/{{name}}/setProxyHeader") if err != nil { return err } @@ -256,7 +256,7 @@ func resourceComputeTargetTcpProxyUpdate(d *schema.ResourceData, meta interface{ obj["service"] = serviceProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetTcpProxies/{{name}}/setBackendService") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetTcpProxies/{{name}}/setBackendService") if err != nil { return err } @@ -294,7 +294,7 @@ func resourceComputeTargetTcpProxyUpdate(d *schema.ResourceData, meta interface{ func resourceComputeTargetTcpProxyDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/global/targetTcpProxies/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/global/targetTcpProxies/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_compute_vpn_gateway.go b/google-beta/resource_compute_vpn_gateway.go index e84e6e4d82..7deda9ef9e 100644 --- a/google-beta/resource_compute_vpn_gateway.go +++ b/google-beta/resource_compute_vpn_gateway.go @@ -110,7 +110,7 @@ func resourceComputeVpnGatewayCreate(d *schema.ResourceData, meta interface{}) e obj["region"] = regionProp } - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/targetVpnGateways") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/targetVpnGateways") if err != nil { return err } @@ -156,7 +156,7 @@ func resourceComputeVpnGatewayCreate(d *schema.ResourceData, meta interface{}) e func resourceComputeVpnGatewayRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}}") if err != nil { return err } @@ -198,7 +198,7 @@ func resourceComputeVpnGatewayRead(d *schema.ResourceData, meta interface{}) err func resourceComputeVpnGatewayDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://www.googleapis.com/compute/v1/projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}}") + url, err := replaceVars(d, config, "https://www.googleapis.com/compute/beta/projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}}") if err != nil { return err } diff --git a/google-beta/resource_container_cluster.go b/google-beta/resource_container_cluster.go index 318e465ffa..a1fd532687 100644 --- a/google-beta/resource_container_cluster.go +++ b/google-beta/resource_container_cluster.go @@ -97,7 +97,6 @@ func resourceContainerCluster() *schema.Resource { }, "region": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", Type: schema.TypeString, Optional: true, Computed: true, @@ -202,10 +201,9 @@ func resourceContainerCluster() *schema.Resource { }, "enable_binary_authorization": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeBool, - Optional: true, - Default: false, + Type: schema.TypeBool, + Optional: true, + Default: false, }, "enable_kubernetes_alpha": { @@ -216,11 +214,10 @@ func resourceContainerCluster() *schema.Resource { }, "enable_tpu": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: false, + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Default: false, }, "enable_legacy_abac": { @@ -395,10 +392,9 @@ func resourceContainerCluster() *schema.Resource { }, "pod_security_policy_config": { - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeList, - Optional: true, - MaxItems: 1, + Type: schema.TypeList, + Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "enabled": { @@ -505,12 +501,12 @@ func resourceContainerCluster() *schema.Resource { }, "private_cluster": { + Deprecated: "Use private_cluster_config.enable_private_nodes instead.", + ConflictsWith: []string{"private_cluster_config"}, + Computed: true, Type: schema.TypeBool, Optional: true, ForceNew: true, - Computed: true, - Deprecated: "Use private_cluster_config.enable_private_nodes instead.", - ConflictsWith: []string{"private_cluster_config"}, }, "private_cluster_config": { @@ -551,12 +547,12 @@ func resourceContainerCluster() *schema.Resource { "master_ipv4_cidr_block": { Deprecated: "Use private_cluster_config.master_ipv4_cidr_block instead.", + ConflictsWith: []string{"private_cluster_config"}, + Computed: true, Type: schema.TypeString, Optional: true, ForceNew: true, - Computed: true, ValidateFunc: validation.CIDRNetwork(28, 28), - ConflictsWith: []string{"private_cluster_config"}, }, "resource_labels": { @@ -689,6 +685,7 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er } } } + if v, ok := d.GetOk("private_cluster_config"); ok { cluster.PrivateClusterConfig = expandPrivateClusterConfig(v) } @@ -814,6 +811,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro if err := d.Set("ip_allocation_policy", flattenIPAllocationPolicy(cluster.IpAllocationPolicy)); err != nil { return err } + if err := d.Set("private_cluster_config", flattenPrivateClusterConfig(cluster.PrivateClusterConfig)); err != nil { return err } diff --git a/google-beta/resource_container_node_pool.go b/google-beta/resource_container_node_pool.go index 009fc788d8..50b589db1d 100644 --- a/google-beta/resource_container_node_pool.go +++ b/google-beta/resource_container_node_pool.go @@ -54,10 +54,9 @@ func resourceContainerNodePool() *schema.Resource { ForceNew: true, }, "region": &schema.Schema{ - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, }, }), } @@ -86,11 +85,10 @@ var schemaNodePool = map[string]*schema.Schema{ }, "max_pods_per_node": &schema.Schema{ - Deprecated: "This field is in beta and will be removed from this provider. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", - Type: schema.TypeInt, - Optional: true, - ForceNew: true, - Computed: true, + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, }, "initial_node_count": &schema.Schema{ diff --git a/google-beta/resource_containeranalysis_note.go b/google-beta/resource_containeranalysis_note.go index 1ca490d35c..91527d594d 100644 --- a/google-beta/resource_containeranalysis_note.go +++ b/google-beta/resource_containeranalysis_note.go @@ -33,9 +33,6 @@ func resourceContainerAnalysisNote() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceContainerAnalysisNoteImport, }, - DeprecationMessage: `This resource is in beta and will be removed from this provider. -Use the ContainerAnalysisNote resource in the terraform-provider-google-beta provider to continue using it. -See https://terraform.io/docs/providers/google/provider_versions.html for more details on beta resources.`, Schema: map[string]*schema.Schema{ "attestation_authority": { diff --git a/google-beta/resource_filestore_instance.go b/google-beta/resource_filestore_instance.go index 8ca928a001..8feb58d960 100644 --- a/google-beta/resource_filestore_instance.go +++ b/google-beta/resource_filestore_instance.go @@ -37,9 +37,6 @@ func resourceFilestoreInstance() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceFilestoreInstanceImport, }, - DeprecationMessage: `This resource is in beta and will be removed from this provider. -Use the FilestoreInstance resource in the terraform-provider-google-beta provider to continue using it. -See https://terraform.io/docs/providers/google/provider_versions.html for more details on beta resources.`, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(300 * time.Second), diff --git a/google-beta/resource_redis_instance.go b/google-beta/resource_redis_instance.go index a62ebd43b6..a3395e9c15 100644 --- a/google-beta/resource_redis_instance.go +++ b/google-beta/resource_redis_instance.go @@ -209,7 +209,7 @@ func resourceRedisInstanceCreate(d *schema.ResourceData, meta interface{}) error obj["tier"] = tierProp } - url, err := replaceVars(d, config, "https://redis.googleapis.com/v1/projects/{{project}}/locations/{{region}}/instances?instanceId={{name}}") + url, err := replaceVars(d, config, "https://redis.googleapis.com/v1beta1/projects/{{project}}/locations/{{region}}/instances?instanceId={{name}}") if err != nil { return err } @@ -255,7 +255,7 @@ func resourceRedisInstanceCreate(d *schema.ResourceData, meta interface{}) error func resourceRedisInstanceRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://redis.googleapis.com/v1/projects/{{project}}/locations/{{region}}/instances/{{name}}") + url, err := replaceVars(d, config, "https://redis.googleapis.com/v1beta1/projects/{{project}}/locations/{{region}}/instances/{{name}}") if err != nil { return err } @@ -392,7 +392,7 @@ func resourceRedisInstanceUpdate(d *schema.ResourceData, meta interface{}) error obj["tier"] = tierProp } - url, err := replaceVars(d, config, "https://redis.googleapis.com/v1/projects/{{project}}/locations/{{region}}/instances/{{name}}") + url, err := replaceVars(d, config, "https://redis.googleapis.com/v1beta1/projects/{{project}}/locations/{{region}}/instances/{{name}}") if err != nil { return err } @@ -447,7 +447,7 @@ func resourceRedisInstanceUpdate(d *schema.ResourceData, meta interface{}) error func resourceRedisInstanceDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - url, err := replaceVars(d, config, "https://redis.googleapis.com/v1/projects/{{project}}/locations/{{region}}/instances/{{name}}") + url, err := replaceVars(d, config, "https://redis.googleapis.com/v1beta1/projects/{{project}}/locations/{{region}}/instances/{{name}}") if err != nil { return err } diff --git a/website/docs/r/binaryauthorization_attestor.html.markdown b/website/docs/r/binaryauthorization_attestor.html.markdown index 040ca6fb4f..781c6f8768 100644 --- a/website/docs/r/binaryauthorization_attestor.html.markdown +++ b/website/docs/r/binaryauthorization_attestor.html.markdown @@ -23,8 +23,6 @@ description: |- An attestor that attests to container image artifacts. -~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. -See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta resources. To get more information about Attestor, see: @@ -35,15 +33,6 @@ To get more information about Attestor, see: ## Example Usage ```hcl -resource "google_container_analysis_note" "note" { - name = "test-attestor-note" - attestation_authority { - hint { - human_readable_name = "Attestor Note" - } - } -} - resource "google_binary_authorization_attestor" "attestor" { name = "test-attestor" attestation_authority_note { @@ -69,6 +58,15 @@ EOF } } } + +resource "google_container_analysis_note" "note" { + name = "test-attestor-note" + attestation_authority { + hint { + human_readable_name = "Attestor Note" + } + } +} ``` ## Argument Reference diff --git a/website/docs/r/binaryauthorization_policy.html.markdown b/website/docs/r/binaryauthorization_policy.html.markdown index 409dfc409a..74ea1a3f69 100644 --- a/website/docs/r/binaryauthorization_policy.html.markdown +++ b/website/docs/r/binaryauthorization_policy.html.markdown @@ -23,8 +23,6 @@ description: |- A policy for container image binary authorization. -~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. -See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta resources. To get more information about Policy, see: @@ -35,22 +33,6 @@ To get more information about Policy, see: ## Example Usage ```hcl -resource "google_container_analysis_note" "note" { - name = "test-attestor-note" - attestation_authority { - hint { - human_readable_name = "My attestor" - } - } -} - -resource "google_binary_authorization_attestor" "attestor" { - name = "test-attestor" - attestation_authority_note { - note_reference = "${google_container_analysis_note.note.name}" - } -} - resource "google_binary_authorization_policy" "policy" { admission_whitelist_patterns { name_pattern= "gcr.io/google_containers/*" @@ -68,6 +50,22 @@ resource "google_binary_authorization_policy" "policy" { require_attestations_by = ["${google_binary_authorization_attestor.attestor.name}"] } } + +resource "google_container_analysis_note" "note" { + name = "test-attestor-note" + attestation_authority { + hint { + human_readable_name = "My attestor" + } + } +} + +resource "google_binary_authorization_attestor" "attestor" { + name = "test-attestor" + attestation_authority_note { + note_reference = "${google_container_analysis_note.note.name}" + } +} ``` ## Argument Reference diff --git a/website/docs/r/compute_address.html.markdown b/website/docs/r/compute_address.html.markdown index b757cf00ce..db003f4316 100644 --- a/website/docs/r/compute_address.html.markdown +++ b/website/docs/r/compute_address.html.markdown @@ -70,6 +70,35 @@ resource "google_compute_address" "internal_with_subnet_and_address" { region = "us-central1" } ``` +```hcl +resource "google_compute_address" "static" { + name = "ipv4-address" +} + +data "google_compute_image" "debian_image" { + family = "debian-9" + project = "debian-cloud" +} + +resource "google_compute_instance" "instance_with_ip" { + name = "vm-instance" + machine_type = "f1-micro" + zone = "us-central1-a" + + boot_disk { + initialize_params{ + image = "${data.google_compute_image.debian_image.self_link}" + } + } + + network_interface { + network = "default" + access_config { + nat_ip = "${google_compute_address.static.address}" + } + } +} +``` ## Argument Reference @@ -120,8 +149,7 @@ The following arguments are supported: * `labels` - (Optional) - Labels to apply to this address. A list of key->value pairs. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + Labels to apply to this address. A list of key->value pairs. * `region` - (Optional) @@ -144,8 +172,7 @@ In addition to the arguments listed above, the following computed attributes are * `label_fingerprint` - The fingerprint used for optimistic locking of this resource. Used - internally during updates. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + internally during updates. * `self_link` - The URI of the created resource. diff --git a/website/docs/r/compute_autoscaler.html.markdown b/website/docs/r/compute_autoscaler.html.markdown index e287880cf6..0ed4a7f79a 100644 --- a/website/docs/r/compute_autoscaler.html.markdown +++ b/website/docs/r/compute_autoscaler.html.markdown @@ -85,7 +85,10 @@ resource "google_compute_instance_group_manager" "foobar" { name = "my-igm" zone = "us-central1-f" - instance_template = "${google_compute_instance_template.foobar.self_link}" + version { + instance_template = "${google_compute_instance_template.foobar.self_link}" + name = "primary" + } target_pools = ["${google_compute_target_pool.foobar.self_link}"] base_instance_name = "foobar" } diff --git a/website/docs/r/compute_disk.html.markdown b/website/docs/r/compute_disk.html.markdown index 3f68ccacb6..d0a8dc0c6c 100644 --- a/website/docs/r/compute_disk.html.markdown +++ b/website/docs/r/compute_disk.html.markdown @@ -191,11 +191,6 @@ The `source_snapshot_encryption_key` block supports: The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. -* (Deprecated) `disk_encryption_key_raw`: This is an alias for - `disk_encryption_key.raw_key`. It is deprecated to enhance - consistency with `source_image_encryption_key` and - `source_snapshot_encryption_key`. - ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: @@ -235,11 +230,6 @@ In addition to the arguments listed above, the following computed attributes are * `self_link` - The URI of the created resource. -* (Deprecated) `disk_encryption_key_sha256`: This is an alias for - `disk_encryption_key.sha256`. It is deprecated to enhance - consistency with `source_image_encryption_key` and - `source_snapshot_encryption_key`. - ## Timeouts This resource provides the following diff --git a/website/docs/r/compute_firewall.html.markdown b/website/docs/r/compute_firewall.html.markdown index 5588e14783..b0bff2a0ab 100644 --- a/website/docs/r/compute_firewall.html.markdown +++ b/website/docs/r/compute_firewall.html.markdown @@ -129,8 +129,7 @@ The following arguments are supported: (Optional) This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to - Stackdriver. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + Stackdriver. * `priority` - (Optional) diff --git a/website/docs/r/compute_forwarding_rule.html.markdown b/website/docs/r/compute_forwarding_rule.html.markdown index ada776cd3a..3d99520f0c 100644 --- a/website/docs/r/compute_forwarding_rule.html.markdown +++ b/website/docs/r/compute_forwarding_rule.html.markdown @@ -182,8 +182,7 @@ The following arguments are supported: * `labels` - (Optional) - Labels to apply to this forwarding rule. A list of key->value pairs. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + Labels to apply to this forwarding rule. A list of key->value pairs. * `network_tier` - (Optional) @@ -202,8 +201,7 @@ The following arguments are supported: character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. - This field is only used for internal load balancing. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + This field is only used for internal load balancing. * `region` - (Optional) @@ -227,8 +225,7 @@ In addition to the arguments listed above, the following computed attributes are * `service_name` - The internal fully qualified service name for this Forwarding Rule. - This field is only used for internal load balancing. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + This field is only used for internal load balancing. * `self_link` - The URI of the created resource. diff --git a/website/docs/r/compute_global_address.html.markdown b/website/docs/r/compute_global_address.html.markdown index c092e9d987..7f6106a2c3 100644 --- a/website/docs/r/compute_global_address.html.markdown +++ b/website/docs/r/compute_global_address.html.markdown @@ -65,8 +65,7 @@ The following arguments are supported: * `labels` - (Optional) - Labels to apply to this address. A list of key->value pairs. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + Labels to apply to this address. A list of key->value pairs. * `ip_version` - (Optional) @@ -77,8 +76,7 @@ The following arguments are supported: (Optional) The prefix length of the IP range. If not present, it means the address field is a single IP address. - This field is not applicable to addresses with addressType=EXTERNAL. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + This field is not applicable to addresses with addressType=EXTERNAL. * `address_type` - (Optional) @@ -90,16 +88,14 @@ The following arguments are supported: (Optional) The purpose of the resource. For global internal addresses it can be * VPC_PEERING - for peer networks - This should only be set when using an Internal address. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + This should only be set when using an Internal address. * `network` - (Optional) The URL of the network in which to reserve the IP range. The IP range must be in RFC1918 space. The network cannot be deleted if there are any reserved IP ranges referring to it. - This should only be set when using an Internal address. This property is in beta, and should be used with the terraform-provider-google-beta provider. - See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta fields. + This should only be set when using an Internal address. * `project` - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. diff --git a/website/docs/r/compute_interconnect_attachment.html.markdown b/website/docs/r/compute_interconnect_attachment.html.markdown index a3aa96123a..a104796ca3 100644 --- a/website/docs/r/compute_interconnect_attachment.html.markdown +++ b/website/docs/r/compute_interconnect_attachment.html.markdown @@ -25,6 +25,7 @@ Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. + ## Example Usage ```hcl diff --git a/website/docs/r/compute_region_autoscaler.html.markdown b/website/docs/r/compute_region_autoscaler.html.markdown index 6288c0bc37..d419f5bc90 100644 --- a/website/docs/r/compute_region_autoscaler.html.markdown +++ b/website/docs/r/compute_region_autoscaler.html.markdown @@ -85,7 +85,10 @@ resource "google_compute_region_instance_group_manager" "foobar" { name = "my-region-igm" region = "us-central1" - instance_template = "${google_compute_instance_template.foobar.self_link}" + version { + instance_template = "${google_compute_instance_template.foobar.self_link}" + name = "primary" + } target_pools = ["${google_compute_target_pool.foobar.self_link}"] base_instance_name = "foobar" } diff --git a/website/docs/r/compute_ssl_certificate.html.markdown b/website/docs/r/compute_ssl_certificate.html.markdown index 7f5694cd28..c9129b942d 100644 --- a/website/docs/r/compute_ssl_certificate.html.markdown +++ b/website/docs/r/compute_ssl_certificate.html.markdown @@ -45,20 +45,9 @@ resource "google_compute_ssl_certificate" "default" { create_before_destroy = true } } - +``` +```hcl # You may also want to control name generation explicitly: - -resource "random_id" "certificate" { - byte_length = 4 - prefix = "my-certificate-" - - # For security, do not expose raw certificate values in the output - keepers { - private_key = "${base64sha256(file("path/to/private.key"))}" - certificate = "${base64sha256(file("path/to/certificate.crt"))}" - } -} - resource "google_compute_ssl_certificate" "default" { # The name will contain 8 random hex digits, # e.g. "my-certificate-48ab27cd2a" @@ -70,6 +59,17 @@ resource "google_compute_ssl_certificate" "default" { create_before_destroy = true } } + +resource "random_id" "certificate" { + byte_length = 4 + prefix = "my-certificate-" + + # For security, do not expose raw certificate values in the output + keepers { + private_key = "${base64sha256(file("path/to/private.key"))}" + certificate = "${base64sha256(file("path/to/certificate.crt"))}" + } +} ``` ```hcl // Using with Target HTTPS Proxies @@ -84,7 +84,6 @@ resource "google_compute_ssl_certificate" "default" { resource "google_compute_ssl_certificate" "default" { name_prefix = "my-certificate-" - description = "a description" private_key = "${file("path/to/private.key")}" certificate = "${file("path/to/certificate.crt")}" @@ -93,11 +92,49 @@ resource "google_compute_ssl_certificate" "default" { } } -resource "google_compute_target_https_proxy" "my_proxy" { - name = "public-proxy" - url_map = # ... +resource "google_compute_target_https_proxy" "default" { + name = "test-proxy" + url_map = "${google_compute_url_map.default.self_link}" ssl_certificates = ["${google_compute_ssl_certificate.default.self_link}"] } + +resource "google_compute_url_map" "default" { + name = "url-map" + description = "a description" + + default_service = "${google_compute_backend_service.default.self_link}" + + host_rule { + hosts = ["mysite.com"] + path_matcher = "allpaths" + } + + path_matcher { + name = "allpaths" + default_service = "${google_compute_backend_service.default.self_link}" + + path_rule { + paths = ["/*"] + service = "${google_compute_backend_service.default.self_link}" + } + } +} + +resource "google_compute_backend_service" "default" { + name = "backend-service" + port_name = "http" + protocol = "HTTP" + timeout_sec = 10 + + health_checks = ["${google_compute_http_health_check.default.self_link}"] +} + +resource "google_compute_http_health_check" "default" { + name = "http-health-check" + request_path = "/" + check_interval_sec = 1 + timeout_sec = 1 +} ``` ## Argument Reference diff --git a/website/docs/r/compute_target_http_proxy.html.markdown b/website/docs/r/compute_target_http_proxy.html.markdown index 7d0a02e9c8..b5ea1d41cd 100644 --- a/website/docs/r/compute_target_http_proxy.html.markdown +++ b/website/docs/r/compute_target_http_proxy.html.markdown @@ -37,14 +37,11 @@ To get more information about TargetHttpProxy, see: ```hcl resource "google_compute_target_http_proxy" "default" { name = "test-proxy" - description = "a description" url_map = "${google_compute_url_map.default.self_link}" } resource "google_compute_url_map" "default" { name = "url-map" - description = "a description" - default_service = "${google_compute_backend_service.default.self_link}" host_rule { @@ -64,7 +61,7 @@ resource "google_compute_url_map" "default" { } resource "google_compute_backend_service" "default" { - name = "default-backend" + name = "backend-service" port_name = "http" protocol = "HTTP" timeout_sec = 10 @@ -73,7 +70,7 @@ resource "google_compute_backend_service" "default" { } resource "google_compute_http_health_check" "default" { - name = "test" + name = "http-health-check" request_path = "/" check_interval_sec = 1 timeout_sec = 1 diff --git a/website/docs/r/compute_target_https_proxy.html.markdown b/website/docs/r/compute_target_https_proxy.html.markdown index 222c3b99aa..55c0657d51 100644 --- a/website/docs/r/compute_target_https_proxy.html.markdown +++ b/website/docs/r/compute_target_https_proxy.html.markdown @@ -37,14 +37,12 @@ To get more information about TargetHttpsProxy, see: ```hcl resource "google_compute_target_https_proxy" "default" { name = "test-proxy" - description = "a description" url_map = "${google_compute_url_map.default.self_link}" ssl_certificates = ["${google_compute_ssl_certificate.default.self_link}"] } resource "google_compute_ssl_certificate" "default" { name = "my-certificate" - description = "a description" private_key = "${file("path/to/private.key")}" certificate = "${file("path/to/certificate.crt")}" } @@ -72,7 +70,7 @@ resource "google_compute_url_map" "default" { } resource "google_compute_backend_service" "default" { - name = "default-backend" + name = "backend-service" port_name = "http" protocol = "HTTP" timeout_sec = 10 @@ -81,7 +79,7 @@ resource "google_compute_backend_service" "default" { } resource "google_compute_http_health_check" "default" { - name = "test" + name = "http-health-check" request_path = "/" check_interval_sec = 1 timeout_sec = 1 diff --git a/website/docs/r/compute_target_ssl_proxy.html.markdown b/website/docs/r/compute_target_ssl_proxy.html.markdown index 0518523db3..2dbc2e487b 100644 --- a/website/docs/r/compute_target_ssl_proxy.html.markdown +++ b/website/docs/r/compute_target_ssl_proxy.html.markdown @@ -38,27 +38,27 @@ To get more information about TargetSslProxy, see: ```hcl resource "google_compute_target_ssl_proxy" "default" { - name = "test" - backend_service = "${google_compute_backend_service.default.self_link}" + name = "test-proxy" + backend_service = "${google_compute_backend_service.default.self_link}" ssl_certificates = ["${google_compute_ssl_certificate.default.self_link}"] } resource "google_compute_ssl_certificate" "default" { - name = "default-cert" - private_key = "${file("path/to/test.key")}" - certificate = "${file("path/to/test.crt")}" + name = "default-cert" + private_key = "${file("path/to/private.key")}" + certificate = "${file("path/to/certificate.crt")}" } resource "google_compute_backend_service" "default" { - name = "default-backend" - protocol = "SSL" + name = "backend-service" + protocol = "SSL" health_checks = ["${google_compute_health_check.default.self_link}"] } resource "google_compute_health_check" "default" { - name = "default-health-check" + name = "health-check" check_interval_sec = 1 - timeout_sec = 1 + timeout_sec = 1 tcp_health_check { port = "443" } diff --git a/website/docs/r/compute_target_tcp_proxy.html.markdown b/website/docs/r/compute_target_tcp_proxy.html.markdown index eb526e58bd..b7be94c6e7 100644 --- a/website/docs/r/compute_target_tcp_proxy.html.markdown +++ b/website/docs/r/compute_target_tcp_proxy.html.markdown @@ -38,21 +38,20 @@ To get more information about TargetTcpProxy, see: ```hcl resource "google_compute_target_tcp_proxy" "default" { - name = "test" - description = "test" + name = "test-proxy" backend_service = "${google_compute_backend_service.default.self_link}" } resource "google_compute_backend_service" "default" { - name = "default-backend" - protocol = "TCP" - timeout_sec = 10 + name = "backend-service" + protocol = "TCP" + timeout_sec = 10 health_checks = ["${google_compute_health_check.default.self_link}"] } resource "google_compute_health_check" "default" { - name = "default" + name = "health-check" timeout_sec = 1 check_interval_sec = 1 diff --git a/website/docs/r/compute_url_map.html.markdown b/website/docs/r/compute_url_map.html.markdown index 35114b2924..5e0ea595d8 100644 --- a/website/docs/r/compute_url_map.html.markdown +++ b/website/docs/r/compute_url_map.html.markdown @@ -1,23 +1,36 @@ --- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- layout: "google" page_title: "Google: google_compute_url_map" sidebar_current: "docs-google-compute-url-map" description: |- - Manages a URL Map resource in GCE. + UrlMaps are used to route requests to a backend service based on rules + that you define for the host and path of an incoming URL. --- # google\_compute\_url\_map -Manages a URL Map resource within GCE. For more information see -[the official documentation](https://cloud.google.com/compute/docs/load-balancing/http/url-map) -and -[API](https://cloud.google.com/compute/docs/reference/latest/urlMaps). +UrlMaps are used to route requests to a backend service based on rules +that you define for the host and path of an incoming URL. + ## Example Usage ```hcl -resource "google_compute_url_map" "foobar" { +resource "google_compute_url_map" "urlmap" { name = "urlmap" description = "a description" @@ -56,7 +69,7 @@ resource "google_compute_url_map" "foobar" { } resource "google_compute_backend_service" "login" { - name = "login-backend" + name = "login" port_name = "http" protocol = "HTTP" timeout_sec = 10 @@ -65,7 +78,7 @@ resource "google_compute_backend_service" "login" { } resource "google_compute_backend_service" "home" { - name = "home-backend" + name = "home" port_name = "http" protocol = "HTTP" timeout_sec = 10 @@ -74,7 +87,7 @@ resource "google_compute_backend_service" "home" { } resource "google_compute_http_health_check" "default" { - name = "test" + name = "health-check" request_path = "/" check_interval_sec = 1 timeout_sec = 1 @@ -96,78 +109,148 @@ resource "google_storage_bucket" "static" { The following arguments are supported: -* `default_service` - (Required) The backend service or backend bucket to use when none of the given rules match. -* `name` - (Required) A unique name for the resource, required by GCE. - Changing this forces a new resource to be created. +* `default_service` - + (Required) + The backend service or backend bucket to use when none of the given rules match. + +* `name` - + (Required) + Name of the resource. Provided by the client when the resource is + created. The name must be 1-63 characters long, and comply with + RFC1035. Specifically, the name must be 1-63 characters long and match + the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + first character must be a lowercase letter, and all following + characters must be a dash, lowercase letter, or digit, except the last + character, which cannot be a dash. + - - - -* `description` - (Optional) A brief description of this resource. -* `host_rule` - (Optional) A list of host rules. Multiple blocks of this type are permitted. Structure is documented below. +* `description` - + (Optional) + An optional description of this resource. Provide this property when + you create the resource. -* `path_matcher` - (Optional) A list of paths to match. Structure is documented below. +* `host_rule` - + (Optional) + The list of HostRules to use against the URL. Structure is documented below. -* `project` - (Optional) The ID of the project in which the resource belongs. If it - is not provided, the provider project is used. +* `path_matcher` - + (Optional) + The list of named PathMatchers to use against the URL. Structure is documented below. + +* `test` - + (Optional) + The list of expected URL mappings. Requests to update this UrlMap will + succeed only if all of the test cases pass. Structure is documented below. +* `project` - (Optional) The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. -* `test` - (Optional) The test to perform. Multiple blocks of this type are permitted. Structure is documented below. The `host_rule` block supports: -* `hosts` (Required) - The list of [host patterns](https://cloud.google.com/compute/docs/reference/latest/urlMaps#hostRules.hosts) - to match. +* `description` - + (Optional) + An optional description of this HostRule. Provide this property + when you create the resource. -* `description` - (Optional) An optional description of the host rule. +* `hosts` - + (Required) + The list of host patterns to match. They must be valid + hostnames, except * will match any string of ([a-z0-9-.]*). In + that case, * must be the first character and must be followed in + the pattern by either - or .. -* `path_matcher` - (Required) The name of the `path_matcher` to apply this host rule to. +* `path_matcher` - + (Required) + The name of the PathMatcher to use to match the path portion of + the URL if the hostRule matches the URL's host portion. The `path_matcher` block supports: -* `name` - (Required) The name of the `path_matcher` resource. +* `default_service` - + (Required) + The backend service or backend bucket to use when none of the given paths match. + +* `description` - + (Optional) + An optional description of this resource. -* `default_service` - (Required) The backend service or backend bucket to use if none of the given paths match. +* `name` - + (Required) + The name to which this PathMatcher is referred by the HostRule. -* `description` - (Optional) An optional description of the host rule. +* `path_rule` - + (Optional) + The list of path rules. Structure is documented below. -* `path_rule` - (Optional) A list of path rules. Multiple blocks of this type are permitted. Structure is documented below. The `path_rule` block supports: -* `paths` - (Required) The list of [paths](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatchers.pathRules.paths) - to match against. +* `paths` - + (Required) + The list of path patterns to match. Each must start with / + and the only place a * is allowed is at the end following + a /. The string fed to the path matcher does not include + any text after the first ? or #, and those chars are not + allowed here. -* `service` - (Required) The backend service or backend bucket to use if any of the given paths match. +* `service` - + (Required) + The backend service or backend bucket to use if any of the given paths match. The `test` block supports: -* `service` - (Required) The backend service or backend bucket link that should be matched by this test. +* `description` - + (Optional) + Description of this test case. -* `host` - (Required) The host component of the URL being tested. +* `host` - + (Required) + Host portion of the URL. -* `path` - (Required) The path component of the URL being tested. +* `path` - + (Required) + Path portion of the URL. -* `description` - (Optional) An optional description of this test. +* `service` - + (Required) + The backend service or backend bucket link that should be matched by this test. ## Attributes Reference -In addition to the arguments listed above, the following computed attributes are -exported: +In addition to the arguments listed above, the following computed attributes are exported: + -* `fingerprint` - The unique fingerprint for this resource. +* `creation_timestamp` - + Creation timestamp in RFC3339 text format. -* `map_id` - The GCE assigned ID of the resource. +* `map_id` - + The unique identifier for the resource. +* `fingerprint` - + Fingerprint of this resource. This field is used internally during + updates of this resource. * `self_link` - The URI of the created resource. + +## Timeouts + +This resource provides the following +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - Default is 4 minutes. +- `update` - Default is 4 minutes. +- `delete` - Default is 4 minutes. + ## Import -URL Map can be imported using the `name`, e.g. +UrlMap can be imported using any of these accepted formats: ``` -$ terraform import google_compute_url_map.html.foobar foobar +$ terraform import google_compute_url_map.default projects/{{project}}/global/urlMaps/{{name}} +$ terraform import google_compute_url_map.default {{project}}/{{name}} +$ terraform import google_compute_url_map.default {{name}} ``` - - -Currently `host_rule`, `path_matcher` and `test` importing is not yet supported. diff --git a/website/docs/r/compute_vpn_gateway.html.markdown b/website/docs/r/compute_vpn_gateway.html.markdown index 23531696a5..ce0ba1b407 100644 --- a/website/docs/r/compute_vpn_gateway.html.markdown +++ b/website/docs/r/compute_vpn_gateway.html.markdown @@ -32,25 +32,21 @@ To get more information about VpnGateway, see: ## Example Usage ```hcl -resource "google_compute_network" "network1" { - name = "network1" - ipv4_range = "10.120.0.0/16" -} - resource "google_compute_vpn_gateway" "target_gateway" { name = "vpn1" network = "${google_compute_network.network1.self_link}" - region = "${var.region}" +} + +resource "google_compute_network" "network1" { + name = "network1" } resource "google_compute_address" "vpn_static_ip" { name = "vpn-static-ip" - region = "${var.region}" } resource "google_compute_forwarding_rule" "fr_esp" { name = "fr-esp" - region = "${var.region}" ip_protocol = "ESP" ip_address = "${google_compute_address.vpn_static_ip.address}" target = "${google_compute_vpn_gateway.target_gateway.self_link}" @@ -58,7 +54,6 @@ resource "google_compute_forwarding_rule" "fr_esp" { resource "google_compute_forwarding_rule" "fr_udp500" { name = "fr-udp500" - region = "${var.region}" ip_protocol = "UDP" port_range = "500" ip_address = "${google_compute_address.vpn_static_ip.address}" @@ -67,7 +62,6 @@ resource "google_compute_forwarding_rule" "fr_udp500" { resource "google_compute_forwarding_rule" "fr_udp4500" { name = "fr-udp4500" - region = "${var.region}" ip_protocol = "UDP" port_range = "4500" ip_address = "${google_compute_address.vpn_static_ip.address}" @@ -76,7 +70,6 @@ resource "google_compute_forwarding_rule" "fr_udp4500" { resource "google_compute_vpn_tunnel" "tunnel1" { name = "tunnel1" - region = "${var.region}" peer_ip = "15.0.0.120" shared_secret = "a secret message" diff --git a/website/docs/r/compute_vpn_tunnel.html.markdown b/website/docs/r/compute_vpn_tunnel.html.markdown index 1283d5ef77..773abe0294 100644 --- a/website/docs/r/compute_vpn_tunnel.html.markdown +++ b/website/docs/r/compute_vpn_tunnel.html.markdown @@ -38,26 +38,31 @@ state as plain-text. ## Example Usage ```hcl -resource "google_compute_network" "network1" { - name = "network1" -} +resource "google_compute_vpn_tunnel" "tunnel1" { + name = "tunnel1" + peer_ip = "15.0.0.120" + shared_secret = "a secret message" + + target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}" -resource "google_compute_subnetwork" "subnet1" { - name = "subnet1" - network = "${google_compute_network.network1.self_link}" - ip_cidr_range = "10.120.0.0/16" - region = "us-central1" + depends_on = [ + "google_compute_forwarding_rule.fr_esp", + "google_compute_forwarding_rule.fr_udp500", + "google_compute_forwarding_rule.fr_udp4500", + ] } resource "google_compute_vpn_gateway" "target_gateway" { name = "vpn1" network = "${google_compute_network.network1.self_link}" - region = "${google_compute_subnetwork.subnet1.region}" +} + +resource "google_compute_network" "network1" { + name = "network1" } resource "google_compute_address" "vpn_static_ip" { name = "vpn-static-ip" - region = "${google_compute_subnetwork.subnet1.region}" } resource "google_compute_forwarding_rule" "fr_esp" { @@ -70,7 +75,7 @@ resource "google_compute_forwarding_rule" "fr_esp" { resource "google_compute_forwarding_rule" "fr_udp500" { name = "fr-udp500" ip_protocol = "UDP" - port_range = "500-500" + port_range = "500" ip_address = "${google_compute_address.vpn_static_ip.address}" target = "${google_compute_vpn_gateway.target_gateway.self_link}" } @@ -78,28 +83,11 @@ resource "google_compute_forwarding_rule" "fr_udp500" { resource "google_compute_forwarding_rule" "fr_udp4500" { name = "fr-udp4500" ip_protocol = "UDP" - port_range = "4500-4500" + port_range = "4500" ip_address = "${google_compute_address.vpn_static_ip.address}" target = "${google_compute_vpn_gateway.target_gateway.self_link}" } -resource "google_compute_vpn_tunnel" "tunnel1" { - name = "tunnel1" - peer_ip = "15.0.0.120" - shared_secret = "a secret message" - - target_vpn_gateway = "${google_compute_vpn_gateway.target_gateway.self_link}" - - local_traffic_selector = ["${google_compute_subnetwork.subnet1.ip_cidr_range}"] - remote_traffic_selector = ["172.16.0.0/12"] - - depends_on = [ - "google_compute_forwarding_rule.fr_esp", - "google_compute_forwarding_rule.fr_udp500", - "google_compute_forwarding_rule.fr_udp4500", - ] -} - resource "google_compute_route" "route1" { name = "route1" network = "${google_compute_network.network1.name}" diff --git a/website/docs/r/containeranalysis_note.html.markdown b/website/docs/r/containeranalysis_note.html.markdown index 9e50ffdd1f..7a204bfd2c 100644 --- a/website/docs/r/containeranalysis_note.html.markdown +++ b/website/docs/r/containeranalysis_note.html.markdown @@ -23,8 +23,6 @@ description: |- Provides a detailed description of a Note. -~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. -See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta resources. To get more information about Note, see: diff --git a/website/docs/r/filestore_instance.html.markdown b/website/docs/r/filestore_instance.html.markdown index dc82fd61a4..1354e02bae 100644 --- a/website/docs/r/filestore_instance.html.markdown +++ b/website/docs/r/filestore_instance.html.markdown @@ -23,8 +23,6 @@ description: |- A Google Cloud Filestore instance. -~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. -See [Provider Versions](https://terraform.io/docs/provider/google/provider_versions.html) for more details on beta resources. To get more information about Instance, see: @@ -36,21 +34,22 @@ To get more information about Instance, see: ## Example Usage -### Basic Usage ```hcl - resource "google_file_instance" "instance" { - name = "test-instance" - zone = "us-central1-b" - file_shares { - capacity_gb = 2660 - name = "share1" - } - networks { - network = "default" - modes = ["MODE_IPV4"] - } - tier = "PREMIUM" +resource "google_filestore_instance" "instance" { + name = "test-instance" + zone = "us-central1-b" + tier = "PREMIUM" + + file_shares { + capacity_gb = 2660 + name = "share1" } + + networks { + network = "default" + modes = ["MODE_IPV4"] + } +} ``` ## Argument Reference diff --git a/website/docs/r/monitoring_alert_policy.html.markdown b/website/docs/r/monitoring_alert_policy.html.markdown index ea2be90093..55c48a892c 100644 --- a/website/docs/r/monitoring_alert_policy.html.markdown +++ b/website/docs/r/monitoring_alert_policy.html.markdown @@ -77,10 +77,6 @@ The following arguments are supported: How to combine the results of multiple conditions to determine if an incident should be opened. -* `enabled` - - (Required) - Whether or not the policy is enabled. - * `conditions` - (Required) A list of conditions for the policy. The conditions are combined by @@ -573,6 +569,10 @@ The `aggregations` block supports: - - - +* `enabled` - + (Optional) + Whether or not the policy is enabled. The default is true. + * `notification_channels` - (Optional) Identifies the notification channels to which notifications should be @@ -586,10 +586,31 @@ The `aggregations` block supports: * `labels` - (Optional) User-supplied key/value data to be used for organizing AlertPolicy objects. + +* `documentation` - + (Optional) + A short name or phrase used to identify the policy in dashboards, + notifications, and incidents. To avoid confusion, don't use the same + display name for multiple policies in the same project. The name is + limited to 512 Unicode characters. Structure is documented below. * `project` - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. +The `documentation` block supports: + +* `content` - + (Optional) + The text of the documentation, interpreted according to mimeType. + The content may not exceed 8,192 Unicode characters and may not + exceed more than 10,240 bytes when encoded in UTF-8 format, + whichever is smaller. + +* `mime_type` - + (Optional) + The format of the content field. Presently, only the value + "text/markdown" is supported. + ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: diff --git a/website/docs/r/redis_instance.html.markdown b/website/docs/r/redis_instance.html.markdown index a33cbfaa0a..bf639dabe9 100644 --- a/website/docs/r/redis_instance.html.markdown +++ b/website/docs/r/redis_instance.html.markdown @@ -32,30 +32,22 @@ To get more information about Instance, see: ## Example Usage -### Basic Usage ```hcl -resource "google_redis_instance" "test" { - name = "%s" +resource "google_redis_instance" "cache" { + name = "memory-cache" memory_size_gb = 1 } ``` - -### Full Usage ```hcl -resource "google_compute_network" "test" { - name = "%s" -} - -resource "google_redis_instance" "test" { - name = "%s" +resource "google_redis_instance" "cache" { + name = "ha-memory-cache" tier = "STANDARD_HA" memory_size_gb = 1 - region = "us-central1" location_id = "us-central1-a" alternative_location_id = "us-central1-f" - - authorized_network = "${google_compute_network.test.self_link}" + + authorized_network = "${google_compute_network.auto-network.self_link}" redis_version = "REDIS_3_2" display_name = "Terraform Test Instance" @@ -66,6 +58,10 @@ resource "google_redis_instance" "test" { other_key = "other_val" } } + +resource "google_compute_network" "auto-network" { + name = "authorized-network" +} ``` ## Argument Reference diff --git a/website/docs/r/resourcemanager_lien.html.markdown b/website/docs/r/resourcemanager_lien.html.markdown index aa7a1f77cb..667a1aa964 100644 --- a/website/docs/r/resourcemanager_lien.html.markdown +++ b/website/docs/r/resourcemanager_lien.html.markdown @@ -28,20 +28,16 @@ A Lien represents an encumbrance on the actions that can be performed on a resou ## Example Usage ```hcl -resource "random_id" "r" { - byte_length = 8 -} - -resource "google_project" "project" { - project_id = "project-${random_id.r.hex}" - name = "A very important project!" -} - resource "google_resource_manager_lien" "lien" { parent = "projects/${google_project.project.number}" restrictions = ["resourcemanager.projects.delete"] origin = "machine-readable-explanation" - reason = "This project is very important to me!" + reason = "This project is an important environment" +} + +resource "google_project" "project" { + project_id = "staging-project" + name = "A very important project!" } ``` diff --git a/website/docs/r/storage_object_access_control.html.markdown b/website/docs/r/storage_object_access_control.html.markdown new file mode 100644 index 0000000000..e6c1b923e2 --- /dev/null +++ b/website/docs/r/storage_object_access_control.html.markdown @@ -0,0 +1,138 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- +layout: "google" +page_title: "Google: google_storage_object_access_control" +sidebar_current: "docs-google-storage-object-access-control" +description: |- + The ObjectAccessControls resources represent the Access Control Lists + (ACLs) for objects within Google Cloud Storage. +--- + +# google\_storage\_object\_access\_control + +The ObjectAccessControls resources represent the Access Control Lists +(ACLs) for objects within Google Cloud Storage. ACLs let you specify +who has access to your data and to what extent. + +There are two roles that can be assigned to an entity: + +READERs can get an object, though the acl property will not be revealed. +OWNERs are READERs, and they can get the acl property, update an object, +and call all objectAccessControls methods on the object. The owner of an +object is always an OWNER. +For more information, see Access Control, with the caveat that this API +uses READER and OWNER instead of READ and FULL_CONTROL. + + +To get more information about ObjectAccessControl, see: + +* [API documentation](https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls) +* How-to Guides + * [Official Documentation](https://cloud.google.com/storage/docs/access-control/create-manage-lists) + +## Example Usage + +```hcl +resource "google_storage_object_access_control" "public_rule" { + object = "${google_storage_bucket_object.object.name}" + bucket = "${google_storage_bucket.bucket.name}" + role = "READER" + entity = "allUsers" +} + +resource "google_storage_bucket" "bucket" { + name = "static-content-bucket" +} + + resource "google_storage_bucket_object" "object" { + name = "public-object" + bucket = "${google_storage_bucket.bucket.name}" + source = "../static/img/header-logo.jpg" +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `bucket` - + (Required) + The name of the bucket. + +* `entity` - + (Required) + The entity holding the permission, in one of the following forms: + * user-{{userId}} + * user-{{email}} (such as "user-liz@example.com") + * group-{{groupId}} + * group-{{email}} (such as "group-example@googlegroups.com") + * domain-{{domain}} (such as "domain-example.com") + * project-team-{{projectId}} + * allUsers + * allAuthenticatedUsers + +* `object` - + (Required) + The name of the object to apply the access control to. + +* `role` - + (Required) + The access permission for the entity. + + +- - - + + + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are exported: + + +* `domain` - + The domain associated with the entity. + +* `email` - + The email address associated with the entity. + +* `entity_id` - + The ID for the entity + +* `generation` - + The content generation of the object, if applied to an object. + +* `project_team` - + The project team associated with the entity Structure is documented below. + + +The `project_team` block contains: + +* `project_number` - + (Optional) + The project team associated with the entity + +* `team` - + (Optional) + The team. + + +## Import + +ObjectAccessControl can be imported using any of these accepted formats: + +``` +$ terraform import google_storage_object_access_control.default {{bucket}}/{{object}}/{{entity}} +```