From e2c5e9a1d5ed8fd8538ff3f7234c80abd3521bbb Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Sun, 10 Apr 2016 17:34:15 -0400 Subject: [PATCH] Update documentation to include new "project" attribute This commit also normalizes the format we display attributes. --- resource_compute_address.go | 10 +- resource_compute_autoscaler.go | 26 ++-- resource_compute_backend_service.go | 80 +++++------ resource_compute_disk.go | 26 ++-- resource_compute_firewall.go | 32 ++--- resource_compute_forwarding_rule.go | 58 ++++---- resource_compute_global_address.go | 10 +- resource_compute_global_forwarding_rule.go | 44 +++--- resource_compute_http_health_check.go | 24 ++-- resource_compute_https_health_check.go | 24 ++-- resource_compute_instance.go | 152 ++++++++++----------- resource_compute_instance_group.go | 44 +++--- resource_compute_instance_group_manager.go | 57 ++++---- resource_compute_instance_template.go | 122 ++++++++--------- resource_compute_network.go | 26 ++-- resource_compute_route.go | 36 ++--- resource_compute_ssl_certificate.go | 20 +-- resource_compute_subnetwork.go | 53 ++++--- resource_compute_target_http_proxy.go | 32 ++--- resource_compute_target_https_proxy.go | 22 +-- resource_compute_target_pool.go | 26 ++-- resource_compute_url_map.go | 32 ++--- resource_compute_vpn_gateway.go | 25 ++-- resource_compute_vpn_tunnel.go | 38 ++++-- resource_container_cluster.go | 120 ++++++++-------- resource_dns_managed_zone.go | 4 +- resource_dns_record_set.go | 26 ++-- resource_pubsub_subscription.go | 24 ++-- resource_sql_database.go | 11 +- resource_sql_database_instance.go | 55 ++++---- resource_sql_user.go | 22 +-- resource_storage_bucket.go | 42 +++--- resource_storage_bucket_acl.go | 11 +- resource_storage_bucket_object.go | 30 ++-- resource_storage_object_acl.go | 13 +- 35 files changed, 711 insertions(+), 666 deletions(-) diff --git a/resource_compute_address.go b/resource_compute_address.go index 4567e428..427f2461 100644 --- a/resource_compute_address.go +++ b/resource_compute_address.go @@ -27,9 +27,10 @@ func resourceComputeAddress() *schema.Resource { Computed: true, }, - "self_link": &schema.Schema{ + "project": &schema.Schema{ Type: schema.TypeString, - Computed: true, + Optional: true, + ForceNew: true, }, "region": &schema.Schema{ @@ -38,10 +39,9 @@ func resourceComputeAddress() *schema.Resource { ForceNew: true, }, - "project": &schema.Schema{ + "self_link": &schema.Schema{ Type: schema.TypeString, - Optional: true, - ForceNew: true, + Computed: true, }, }, } diff --git a/resource_compute_autoscaler.go b/resource_compute_autoscaler.go index 7fd8819d..cb6834b5 100644 --- a/resource_compute_autoscaler.go +++ b/resource_compute_autoscaler.go @@ -23,16 +23,17 @@ func resourceComputeAutoscaler() *schema.Resource { Required: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "target": &schema.Schema{ Type: schema.TypeString, Required: true, }, + "zone": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "autoscaling_policy": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -105,15 +106,9 @@ func resourceComputeAutoscaler() *schema.Resource { }, }, - "zone": &schema.Schema{ + "description": &schema.Schema{ Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, + Optional: true, }, "project": &schema.Schema{ @@ -121,6 +116,11 @@ func resourceComputeAutoscaler() *schema.Resource { Optional: true, ForceNew: true, }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/resource_compute_backend_service.go b/resource_compute_backend_service.go index f0402478..94bc2343 100644 --- a/resource_compute_backend_service.go +++ b/resource_compute_backend_service.go @@ -20,10 +20,36 @@ func resourceComputeBackendService() *schema.Resource { Delete: resourceComputeBackendServiceDelete, Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + re := `^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$` + if !regexp.MustCompile(re).MatchString(value) { + errors = append(errors, fmt.Errorf( + "%q (%q) doesn't match regexp %q", k, value, re)) + } + return + }, + }, + + "health_checks": &schema.Schema{ + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Required: true, + Set: schema.HashString, + }, + "backend": &schema.Schema{ Type: schema.TypeSet, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "group": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, "balancing_mode": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -38,10 +64,6 @@ func resourceComputeBackendService() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "group": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, "max_rate": &schema.Schema{ Type: schema.TypeInt, Optional: true, @@ -66,32 +88,9 @@ func resourceComputeBackendService() *schema.Resource { Optional: true, }, - "region": &schema.Schema{ + "fingerprint": &schema.Schema{ Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - - "health_checks": &schema.Schema{ - Type: schema.TypeSet, - Elem: &schema.Schema{Type: schema.TypeString}, - Required: true, - Set: schema.HashString, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - re := `^(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)$` - if !regexp.MustCompile(re).MatchString(value) { - errors = append(errors, fmt.Errorf( - "%q (%q) doesn't match regexp %q", k, value, re)) - } - return - }, + Computed: true, }, "port_name": &schema.Schema{ @@ -100,21 +99,22 @@ func resourceComputeBackendService() *schema.Resource { Computed: true, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "protocol": &schema.Schema{ Type: schema.TypeString, Optional: true, Computed: true, }, - "timeout_sec": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - - "fingerprint": &schema.Schema{ + "region": &schema.Schema{ Type: schema.TypeString, - Computed: true, + Optional: true, + ForceNew: true, }, "self_link": &schema.Schema{ @@ -122,10 +122,10 @@ func resourceComputeBackendService() *schema.Resource { Computed: true, }, - "project": &schema.Schema{ - Type: schema.TypeString, + "timeout_sec": &schema.Schema{ + Type: schema.TypeInt, Optional: true, - ForceNew: true, + Computed: true, }, }, } diff --git a/resource_compute_disk.go b/resource_compute_disk.go index 62d0ea3e..b307505f 100644 --- a/resource_compute_disk.go +++ b/resource_compute_disk.go @@ -34,30 +34,30 @@ func resourceComputeDisk() *schema.Resource { ForceNew: true, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "size": &schema.Schema{ Type: schema.TypeInt, Optional: true, ForceNew: true, }, - "type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "snapshot": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "self_link": &schema.Schema{ Type: schema.TypeString, Computed: true, }, - "project": &schema.Schema{ + "snapshot": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "type": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, diff --git a/resource_compute_firewall.go b/resource_compute_firewall.go index 1676b22a..a4776c34 100644 --- a/resource_compute_firewall.go +++ b/resource_compute_firewall.go @@ -26,11 +26,6 @@ func resourceComputeFirewall() *schema.Resource { ForceNew: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "network": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -58,6 +53,22 @@ func resourceComputeFirewall() *schema.Resource { Set: resourceComputeFirewallAllowHash, }, + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, + + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "source_ranges": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -78,17 +89,6 @@ func resourceComputeFirewall() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_forwarding_rule.go b/resource_compute_forwarding_rule.go index 0f716273..af6b267d 100644 --- a/resource_compute_forwarding_rule.go +++ b/resource_compute_forwarding_rule.go @@ -17,6 +17,24 @@ func resourceComputeForwardingRule() *schema.Resource { Update: resourceComputeForwardingRuleUpdate, Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "target": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: false, + }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "ip_address": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -31,46 +49,28 @@ func resourceComputeForwardingRule() *schema.Resource { Computed: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "port_range": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "target": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: false, - }, - - "region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "region": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/resource_compute_global_address.go b/resource_compute_global_address.go index 55490223..6c2da4fc 100644 --- a/resource_compute_global_address.go +++ b/resource_compute_global_address.go @@ -27,16 +27,16 @@ func resourceComputeGlobalAddress() *schema.Resource { Computed: true, }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/resource_compute_global_forwarding_rule.go b/resource_compute_global_forwarding_rule.go index 5c41675e..e098a993 100644 --- a/resource_compute_global_forwarding_rule.go +++ b/resource_compute_global_forwarding_rule.go @@ -17,6 +17,23 @@ func resourceComputeGlobalForwardingRule() *schema.Resource { Delete: resourceComputeGlobalForwardingRuleDelete, Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "target": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "ip_address": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -31,32 +48,16 @@ func resourceComputeGlobalForwardingRule() *schema.Resource { Computed: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "port_range": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, - "self_link": &schema.Schema{ + "project": &schema.Schema{ Type: schema.TypeString, - Computed: true, - }, - - "target": &schema.Schema{ - Type: schema.TypeString, - Required: true, + Optional: true, + ForceNew: true, }, "region": &schema.Schema{ @@ -66,10 +67,9 @@ func resourceComputeGlobalForwardingRule() *schema.Resource { Deprecated: "Please remove this attribute (it was never used)", }, - "project": &schema.Schema{ + "self_link": &schema.Schema{ Type: schema.TypeString, - Optional: true, - ForceNew: true, + Computed: true, }, }, } diff --git a/resource_compute_http_health_check.go b/resource_compute_http_health_check.go index 0d8eaed0..b9114273 100644 --- a/resource_compute_http_health_check.go +++ b/resource_compute_http_health_check.go @@ -17,6 +17,12 @@ func resourceComputeHttpHealthCheck() *schema.Resource { Update: resourceComputeHttpHealthCheckUpdate, Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "check_interval_sec": &schema.Schema{ Type: schema.TypeInt, Optional: true, @@ -39,18 +45,18 @@ func resourceComputeHttpHealthCheck() *schema.Resource { Optional: true, }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "port": &schema.Schema{ Type: schema.TypeInt, Optional: true, Default: 80, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "request_path": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -73,12 +79,6 @@ func resourceComputeHttpHealthCheck() *schema.Resource { Optional: true, Default: 2, }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_https_health_check.go b/resource_compute_https_health_check.go index 64b50483..a52fa186 100644 --- a/resource_compute_https_health_check.go +++ b/resource_compute_https_health_check.go @@ -17,6 +17,12 @@ func resourceComputeHttpsHealthCheck() *schema.Resource { Update: resourceComputeHttpsHealthCheckUpdate, Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "check_interval_sec": &schema.Schema{ Type: schema.TypeInt, Optional: true, @@ -39,18 +45,18 @@ func resourceComputeHttpsHealthCheck() *schema.Resource { Optional: true, }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "port": &schema.Schema{ Type: schema.TypeInt, Optional: true, Default: 443, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "request_path": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -73,12 +79,6 @@ func resourceComputeHttpsHealthCheck() *schema.Resource { Optional: true, Default: 2, }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_instance.go b/resource_compute_instance.go index a50e1c10..bc0c0d24 100644 --- a/resource_compute_instance.go +++ b/resource_compute_instance.go @@ -26,30 +26,6 @@ func resourceComputeInstance() *schema.Resource { MigrateState: resourceComputeInstanceMigrateState, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "machine_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "zone": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "disk": &schema.Schema{ Type: schema.TypeList, Required: true, @@ -103,6 +79,55 @@ func resourceComputeInstance() *schema.Resource { }, }, + "machine_type": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "zone": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "can_ip_forward": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "metadata": &schema.Schema{ + Type: schema.TypeMap, + Optional: true, + Elem: schema.TypeString, + ValidateFunc: validateInstanceMetadata, + }, + + "metadata_startup_script": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "metadata_fingerprint": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "network_interface": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -189,24 +214,38 @@ func resourceComputeInstance() *schema.Resource { }, }, - "can_ip_forward": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - - "metadata_startup_script": &schema.Schema{ + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, - "metadata": &schema.Schema{ - Type: schema.TypeMap, - Optional: true, - Elem: schema.TypeString, - ValidateFunc: validateInstanceMetadata, + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "scheduling": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "on_host_maintenance": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, + + "automatic_restart": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + }, + + "preemptible": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + }, + }, + }, }, "service_account": &schema.Schema{ @@ -237,29 +276,6 @@ func resourceComputeInstance() *schema.Resource { }, }, - "scheduling": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "on_host_maintenance": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - - "automatic_restart": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - }, - - "preemptible": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - }, - }, - }, - }, - "tags": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -267,26 +283,10 @@ func resourceComputeInstance() *schema.Resource { Set: schema.HashString, }, - "metadata_fingerprint": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "tags_fingerprint": &schema.Schema{ Type: schema.TypeString, Computed: true, }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_instance_group.go b/resource_compute_instance_group.go index cd6d3108..4bbbc4e4 100644 --- a/resource_compute_instance_group.go +++ b/resource_compute_instance_group.go @@ -25,12 +25,24 @@ func resourceComputeInstanceGroup() *schema.Resource { ForceNew: true, }, + "zone": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "description": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + "instances": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "named_port": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -49,38 +61,26 @@ func resourceComputeInstanceGroup() *schema.Resource { }, }, - "instances": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "network": &schema.Schema{ Type: schema.TypeString, Computed: true, }, - "size": &schema.Schema{ - Type: schema.TypeInt, - Computed: true, - }, - - "zone": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "size": &schema.Schema{ + Type: schema.TypeInt, + Computed: true, + }, }, } } diff --git a/resource_compute_instance_group_manager.go b/resource_compute_instance_group_manager.go index 970722ae..21deac9d 100644 --- a/resource_compute_instance_group_manager.go +++ b/resource_compute_instance_group_manager.go @@ -19,24 +19,35 @@ func resourceComputeInstanceGroupManager() *schema.Resource { Delete: resourceComputeInstanceGroupManagerDelete, Schema: map[string]*schema.Schema{ + "base_instance_name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "instance_template": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, + "zone": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "description": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, - "base_instance_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "fingerprint": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -47,17 +58,11 @@ func resourceComputeInstanceGroupManager() *schema.Resource { Computed: true, }, - "instance_template": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "named_port": &schema.Schema{ Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -71,6 +76,17 @@ func resourceComputeInstanceGroupManager() *schema.Resource { }, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "update_strategy": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -89,23 +105,6 @@ func resourceComputeInstanceGroupManager() *schema.Resource { Computed: true, Optional: true, }, - - "zone": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_instance_template.go b/resource_compute_instance_template.go index 5805fd2b..d836b977 100644 --- a/resource_compute_instance_template.go +++ b/resource_compute_instance_template.go @@ -16,37 +16,6 @@ func resourceComputeInstanceTemplate() *schema.Resource { Delete: resourceComputeInstanceTemplateDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "can_ip_forward": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, - - "instance_description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "machine_type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "disk": &schema.Schema{ Type: schema.TypeList, Required: true, @@ -123,12 +92,56 @@ func resourceComputeInstanceTemplate() *schema.Resource { }, }, + "machine_type": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "automatic_restart": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Default: true, + ForceNew: true, + Deprecated: "Please use `scheduling.automatic_restart` instead", + }, + + "can_ip_forward": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "instance_description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "metadata": &schema.Schema{ Type: schema.TypeMap, Optional: true, ForceNew: true, }, + "metadata_fingerprint": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "network_interface": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -164,14 +177,6 @@ func resourceComputeInstanceTemplate() *schema.Resource { }, }, - "automatic_restart": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, - Deprecated: "Please use `scheduling.automatic_restart` instead", - }, - "on_host_maintenance": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -179,6 +184,18 @@ func resourceComputeInstanceTemplate() *schema.Resource { Deprecated: "Please use `scheduling.on_host_maintenance` instead", }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "region": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "scheduling": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -207,6 +224,11 @@ func resourceComputeInstanceTemplate() *schema.Resource { }, }, + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "service_account": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -242,32 +264,10 @@ func resourceComputeInstanceTemplate() *schema.Resource { Set: schema.HashString, }, - "metadata_fingerprint": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "tags_fingerprint": &schema.Schema{ Type: schema.TypeString, Computed: true, }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "region": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_network.go b/resource_compute_network.go index b3182ab1..3a08f7c4 100644 --- a/resource_compute_network.go +++ b/resource_compute_network.go @@ -22,18 +22,6 @@ func resourceComputeNetwork() *schema.Resource { ForceNew: true, }, - "ipv4_range": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Deprecated: "Please use google_compute_subnetwork resources instead.", - }, - - "gateway_ipv4": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "auto_create_subnetworks": &schema.Schema{ Type: schema.TypeBool, Optional: true, @@ -52,16 +40,28 @@ func resourceComputeNetwork() *schema.Resource { ForceNew: true, }, - "self_link": &schema.Schema{ + "gateway_ipv4": &schema.Schema{ Type: schema.TypeString, Computed: true, }, + "ipv4_range": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Deprecated: "Please use google_compute_subnetwork resources instead.", + }, + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/resource_compute_route.go b/resource_compute_route.go index 0e177c89..82ea1806 100644 --- a/resource_compute_route.go +++ b/resource_compute_route.go @@ -16,13 +16,13 @@ func resourceComputeRoute() *schema.Resource { Delete: resourceComputeRouteDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "dest_range": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "dest_range": &schema.Schema{ + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, @@ -34,7 +34,13 @@ func resourceComputeRoute() *schema.Resource { ForceNew: true, }, - "next_hop_ip": &schema.Schema{ + "priority": &schema.Schema{ + Type: schema.TypeInt, + Required: true, + ForceNew: true, + }, + + "next_hop_gateway": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, @@ -52,7 +58,7 @@ func resourceComputeRoute() *schema.Resource { ForceNew: true, }, - "next_hop_gateway": &schema.Schema{ + "next_hop_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, @@ -69,12 +75,17 @@ func resourceComputeRoute() *schema.Resource { ForceNew: true, }, - "priority": &schema.Schema{ - Type: schema.TypeInt, - Required: true, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, ForceNew: true, }, + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "tags": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -82,17 +93,6 @@ func resourceComputeRoute() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_ssl_certificate.go b/resource_compute_ssl_certificate.go index 8d7a4048..8310b440 100644 --- a/resource_compute_ssl_certificate.go +++ b/resource_compute_ssl_certificate.go @@ -17,19 +17,13 @@ func resourceComputeSslCertificate() *schema.Resource { Delete: resourceComputeSslCertificateDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "certificate": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "certificate": &schema.Schema{ + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, @@ -41,9 +35,10 @@ func resourceComputeSslCertificate() *schema.Resource { ForceNew: true, }, - "self_link": &schema.Schema{ + "description": &schema.Schema{ Type: schema.TypeString, - Computed: true, + Optional: true, + ForceNew: true, }, "id": &schema.Schema{ @@ -56,6 +51,11 @@ func resourceComputeSslCertificate() *schema.Resource { Optional: true, ForceNew: true, }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/resource_compute_subnetwork.go b/resource_compute_subnetwork.go index 9a0d2b42..88ef4255 100644 --- a/resource_compute_subnetwork.go +++ b/resource_compute_subnetwork.go @@ -18,30 +18,24 @@ func resourceComputeSubnetwork() *schema.Resource { Delete: resourceComputeSubnetworkDelete, Schema: map[string]*schema.Schema{ + "ip_cidr_range": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "region": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "network": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "ip_cidr_range": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "description": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -53,16 +47,22 @@ func resourceComputeSubnetwork() *schema.Resource { Computed: true, }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "region": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -81,6 +81,11 @@ func splitSubnetID(id string) (region string, name string) { func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) + region, err := getRegion(d, config) + if err != nil { + return err + } + project, err := getProject(d, config) if err != nil { return err @@ -93,7 +98,6 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e IpCidrRange: d.Get("ip_cidr_range").(string), Network: d.Get("network").(string), } - region := d.Get("region").(string) log.Printf("[DEBUG] Subnetwork insert request: %#v", subnetwork) op, err := config.clientCompute.Subnetworks.Insert( @@ -122,13 +126,17 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e func resourceComputeSubnetworkRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) + region, err := getRegion(d, config) + if err != nil { + return err + } + project, err := getProject(d, config) if err != nil { return err } name := d.Get("name").(string) - region := d.Get("region").(string) subnetwork, err := config.clientCompute.Subnetworks.Get( project, region, name).Do() @@ -153,12 +161,15 @@ func resourceComputeSubnetworkRead(d *schema.ResourceData, meta interface{}) err func resourceComputeSubnetworkDelete(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) - project, err := getProject(d, config) + region, err := getRegion(d, config) if err != nil { return err } - region := d.Get("region").(string) + project, err := getProject(d, config) + if err != nil { + return err + } // Delete the subnetwork op, err := config.clientCompute.Subnetworks.Delete( diff --git a/resource_compute_target_http_proxy.go b/resource_compute_target_http_proxy.go index cec71954..a85cddb5 100644 --- a/resource_compute_target_http_proxy.go +++ b/resource_compute_target_http_proxy.go @@ -24,32 +24,32 @@ func resourceComputeTargetHttpProxy() *schema.Resource { ForceNew: true, }, + "url_map": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "description": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "self_link": &schema.Schema{ Type: schema.TypeString, Computed: true, }, - - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "url_map": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_target_https_proxy.go b/resource_compute_target_https_proxy.go index b505b022..041ae4b6 100644 --- a/resource_compute_target_https_proxy.go +++ b/resource_compute_target_https_proxy.go @@ -24,6 +24,17 @@ func resourceComputeTargetHttpsProxy() *schema.Resource { ForceNew: true, }, + "ssl_certificates": &schema.Schema{ + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "url_map": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "description": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -40,17 +51,6 @@ func resourceComputeTargetHttpsProxy() *schema.Resource { Computed: true, }, - "url_map": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - - "ssl_certificates": &schema.Schema{ - Type: schema.TypeList, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "project": &schema.Schema{ Type: schema.TypeString, Optional: true, diff --git a/resource_compute_target_pool.go b/resource_compute_target_pool.go index 8ececab4..810f292f 100644 --- a/resource_compute_target_pool.go +++ b/resource_compute_target_pool.go @@ -18,6 +18,12 @@ func resourceComputeTargetPool() *schema.Resource { Update: resourceComputeTargetPoolUpdate, Schema: map[string]*schema.Schema{ + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "backup_pool": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -50,18 +56,7 @@ func resourceComputeTargetPool() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, }, - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "session_affinity": &schema.Schema{ + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, @@ -73,7 +68,12 @@ func resourceComputeTargetPool() *schema.Resource { ForceNew: true, }, - "project": &schema.Schema{ + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "session_affinity": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, diff --git a/resource_compute_url_map.go b/resource_compute_url_map.go index 381ad920..303ff668 100644 --- a/resource_compute_url_map.go +++ b/resource_compute_url_map.go @@ -18,22 +18,17 @@ func resourceComputeUrlMap() *schema.Resource { Delete: resourceComputeUrlMapDelete, Schema: map[string]*schema.Schema{ + "default_service": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "default_service": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "description": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -68,6 +63,11 @@ func resourceComputeUrlMap() *schema.Resource { }, }, + "id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "path_matcher": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -110,6 +110,12 @@ func resourceComputeUrlMap() *schema.Resource { }, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "self_link": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -142,12 +148,6 @@ func resourceComputeUrlMap() *schema.Resource { }, }, }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_compute_vpn_gateway.go b/resource_compute_vpn_gateway.go index 1e7de64b..1a10ec52 100644 --- a/resource_compute_vpn_gateway.go +++ b/resource_compute_vpn_gateway.go @@ -24,29 +24,34 @@ func resourceComputeVpnGateway() *schema.Resource { Required: true, ForceNew: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, + "network": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "self_link": &schema.Schema{ + + "description": &schema.Schema{ Type: schema.TypeString, - Computed: true, + Optional: true, + ForceNew: true, }, + + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "region": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, - "project": &schema.Schema{ + + "self_link": &schema.Schema{ Type: schema.TypeString, - Optional: true, - ForceNew: true, + Computed: true, }, }, } diff --git a/resource_compute_vpn_tunnel.go b/resource_compute_vpn_tunnel.go index 4e94e4f0..96ff15d4 100644 --- a/resource_compute_vpn_tunnel.go +++ b/resource_compute_vpn_tunnel.go @@ -26,33 +26,44 @@ func resourceComputeVpnTunnel() *schema.Resource { Required: true, ForceNew: true, }, - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, + "peer_ip": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, ValidateFunc: validatePeerAddr, }, + "shared_secret": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, + "target_vpn_gateway": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "detailed_status": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "ike_version": &schema.Schema{ Type: schema.TypeInt, Optional: true, Default: 2, ForceNew: true, }, + "local_traffic_selector": &schema.Schema{ Type: schema.TypeSet, Optional: true, @@ -60,23 +71,22 @@ func resourceComputeVpnTunnel() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, - "detailed_status": &schema.Schema{ + + "project": &schema.Schema{ Type: schema.TypeString, - Computed: true, - }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, + Optional: true, + ForceNew: true, }, + "region": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, - "project": &schema.Schema{ + + "self_link": &schema.Schema{ Type: schema.TypeString, - Optional: true, - ForceNew: true, + Computed: true, }, }, } diff --git a/resource_container_cluster.go b/resource_container_cluster.go index 08dddaf2..e68fadff 100644 --- a/resource_container_cluster.go +++ b/resource_container_cluster.go @@ -21,60 +21,12 @@ func resourceContainerCluster() *schema.Resource { Delete: resourceContainerClusterDelete, Schema: map[string]*schema.Schema{ - "zone": &schema.Schema{ - Type: schema.TypeString, + "initial_node_count": &schema.Schema{ + Type: schema.TypeInt, Required: true, ForceNew: true, }, - "node_version": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "cluster_ipv4_cidr": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { - value := v.(string) - _, ipnet, err := net.ParseCIDR(value) - - if err != nil || ipnet == nil || value != ipnet.String() { - errors = append(errors, fmt.Errorf( - "%q must contain a valid CIDR", k)) - } - return - }, - }, - - "description": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "endpoint": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "logging_service": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - - "monitoring_service": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "master_auth": &schema.Schema{ Type: schema.TypeList, Required: true, @@ -93,13 +45,11 @@ func resourceContainerCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "password": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "username": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -136,6 +86,60 @@ func resourceContainerCluster() *schema.Resource { }, }, + "zone": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "cluster_ipv4_cidr": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + _, ipnet, err := net.ParseCIDR(value) + + if err != nil || ipnet == nil || value != ipnet.String() { + errors = append(errors, fmt.Errorf( + "%q must contain a valid CIDR", k)) + } + return + }, + }, + + "description": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "endpoint": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "instance_group_urls": &schema.Schema{ + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "logging_service": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "monitoring_service": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "network": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -184,16 +188,10 @@ func resourceContainerCluster() *schema.Resource { }, }, - "initial_node_count": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - - "instance_group_urls": &schema.Schema{ - Type: schema.TypeList, + "node_version": &schema.Schema{ + Type: schema.TypeString, + Optional: true, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, }, "project": &schema.Schema{ diff --git a/resource_dns_managed_zone.go b/resource_dns_managed_zone.go index 91335359..8181e278 100644 --- a/resource_dns_managed_zone.go +++ b/resource_dns_managed_zone.go @@ -16,13 +16,13 @@ func resourceDnsManagedZone() *schema.Resource { Delete: resourceDnsManagedZoneDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "dns_name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "dns_name": &schema.Schema{ + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, diff --git a/resource_dns_record_set.go b/resource_dns_record_set.go index 5f0b7a51..22f9c60c 100644 --- a/resource_dns_record_set.go +++ b/resource_dns_record_set.go @@ -17,30 +17,18 @@ func resourceDnsRecordSet() *schema.Resource { Delete: resourceDnsRecordSetDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "managed_zone": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "type": &schema.Schema{ + "name": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "ttl": &schema.Schema{ - Type: schema.TypeInt, - Required: true, - ForceNew: true, - }, - "rrdatas": &schema.Schema{ Type: schema.TypeList, Required: true, @@ -50,6 +38,18 @@ func resourceDnsRecordSet() *schema.Resource { }, }, + "ttl": &schema.Schema{ + Type: schema.TypeInt, + Required: true, + ForceNew: true, + }, + + "type": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, diff --git a/resource_pubsub_subscription.go b/resource_pubsub_subscription.go index 19f3f38e..432d48ee 100644 --- a/resource_pubsub_subscription.go +++ b/resource_pubsub_subscription.go @@ -20,12 +20,24 @@ func resourcePubsubSubscription() *schema.Resource { ForceNew: true, }, + "topic": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "ack_deadline_seconds": &schema.Schema{ Type: schema.TypeInt, Optional: true, ForceNew: true, }, + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "push_config": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -47,18 +59,6 @@ func resourcePubsubSubscription() *schema.Resource { }, }, }, - - "topic": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_sql_database.go b/resource_sql_database.go index 8ef245b1..c15e49ce 100644 --- a/resource_sql_database.go +++ b/resource_sql_database.go @@ -22,20 +22,23 @@ func resourceSqlDatabase() *schema.Resource { Required: true, ForceNew: true, }, + "instance": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } diff --git a/resource_sql_database_instance.go b/resource_sql_database_instance.go index a8945caa..b8cc8730 100644 --- a/resource_sql_database_instance.go +++ b/resource_sql_database_instance.go @@ -19,32 +19,12 @@ func resourceSqlDatabaseInstance() *schema.Resource { Delete: resourceSqlDatabaseInstanceDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "master_instance_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "database_version": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "MYSQL_5_5", - ForceNew: true, - }, "region": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, + "settings": &schema.Schema{ Type: schema.TypeList, Required: true, @@ -170,6 +150,14 @@ func resourceSqlDatabaseInstance() *schema.Resource { }, }, }, + + "database_version": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Default: "MYSQL_5_5", + ForceNew: true, + }, + "ip_address": &schema.Schema{ Type: schema.TypeList, Computed: true, @@ -187,6 +175,26 @@ func resourceSqlDatabaseInstance() *schema.Resource { }, }, }, + + "name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "master_instance_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "replica_configuration": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -246,10 +254,9 @@ func resourceSqlDatabaseInstance() *schema.Resource { }, }, - "project": &schema.Schema{ + "self_link": &schema.Schema{ Type: schema.TypeString, - Optional: true, - ForceNew: true, + Computed: true, }, }, } diff --git a/resource_sql_user.go b/resource_sql_user.go index b787ed04..2aaf1bd7 100644 --- a/resource_sql_user.go +++ b/resource_sql_user.go @@ -18,17 +18,6 @@ func resourceSqlUser() *schema.Resource { Delete: resourceSqlUserDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "password": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, - "host": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -41,6 +30,17 @@ func resourceSqlUser() *schema.Resource { ForceNew: true, }, + "name": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "password": &schema.Schema{ + Type: schema.TypeString, + Required: true, + }, + "project": &schema.Schema{ Type: schema.TypeString, Optional: true, diff --git a/resource_storage_bucket.go b/resource_storage_bucket.go index 10543076..8da47cab 100644 --- a/resource_storage_bucket.go +++ b/resource_storage_bucket.go @@ -24,23 +24,38 @@ func resourceStorageBucket() *schema.Resource { Required: true, ForceNew: true, }, - "predefined_acl": &schema.Schema{ - Type: schema.TypeString, - Deprecated: "Please use resource \"storage_bucket_acl.predefined_acl\" instead.", - Optional: true, - ForceNew: true, + + "force_destroy": &schema.Schema{ + Type: schema.TypeBool, + Optional: true, + Default: false, }, + "location": &schema.Schema{ Type: schema.TypeString, Default: "US", Optional: true, ForceNew: true, }, - "force_destroy": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, + + "predefined_acl": &schema.Schema{ + Type: schema.TypeString, + Deprecated: "Please use resource \"storage_bucket_acl.predefined_acl\" instead.", + Optional: true, + ForceNew: true, }, + + "project": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + + "self_link": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "website": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -57,15 +72,6 @@ func resourceStorageBucket() *schema.Resource { }, }, }, - "self_link": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - "project": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, }, } } diff --git a/resource_storage_bucket_acl.go b/resource_storage_bucket_acl.go index 488fd85f..aa996cb9 100644 --- a/resource_storage_bucket_acl.go +++ b/resource_storage_bucket_acl.go @@ -24,20 +24,23 @@ func resourceStorageBucketAcl() *schema.Resource { Required: true, ForceNew: true, }, + + "default_acl": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, + "predefined_acl": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + "role_entity": &schema.Schema{ Type: schema.TypeList, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "default_acl": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, }, } } diff --git a/resource_storage_bucket_object.go b/resource_storage_bucket_object.go index 679c7e74..a129f73c 100644 --- a/resource_storage_bucket_object.go +++ b/resource_storage_bucket_object.go @@ -32,13 +32,6 @@ func resourceStorageBucketObject() *schema.Resource { ForceNew: true, }, - "source": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"content"}, - }, - "content": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -46,6 +39,16 @@ func resourceStorageBucketObject() *schema.Resource { ConflictsWith: []string{"source"}, }, + "crc32c": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + + "md5hash": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "predefined_acl": &schema.Schema{ Type: schema.TypeString, Deprecated: "Please use resource \"storage_object_acl.predefined_acl\" instead.", @@ -53,14 +56,11 @@ func resourceStorageBucketObject() *schema.Resource { ForceNew: true, }, - "md5hash": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "crc32c": &schema.Schema{ - Type: schema.TypeString, - Computed: true, + "source": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"content"}, }, }, } diff --git a/resource_storage_object_acl.go b/resource_storage_object_acl.go index e4968265..a73e34b3 100644 --- a/resource_storage_object_acl.go +++ b/resource_storage_object_acl.go @@ -23,21 +23,24 @@ func resourceStorageObjectAcl() *schema.Resource { Required: true, ForceNew: true, }, + "object": &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, }, - "role_entity": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "predefined_acl": &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, }, + + "role_entity": &schema.Schema{ + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, }, } }