From e305ea190bba220a2678d3648c37e5d5d372e35b Mon Sep 17 00:00:00 2001 From: Jeffrey Cline Date: Tue, 11 Dec 2018 14:55:10 -0800 Subject: [PATCH] Change all references from NoZeroValues to NoEmptyStrings (#2477) * Change all references to NoZerValues to NoEmptyStrings * correcting imports * Testing line endings * Fixing line endings * Fix lint errors * Permission to merge per KT --- azurerm/data_source_monitor_action_group.go | 4 ++-- azurerm/data_source_public_ip.go | 4 ++-- azurerm/data_source_subnet.go | 6 ++--- azurerm/data_source_virtual_network.go | 4 ++-- .../data_source_virtual_network_gateway.go | 4 ++-- azurerm/helpers/azure/key_vault_child.go | 4 ++-- azurerm/helpers/validate/base64.go | 3 +-- azurerm/resource_arm_api_management.go | 6 ++--- ...source_arm_automation_dsc_configuration.go | 5 ++-- ...ce_arm_automation_dsc_nodeconfiguration.go | 8 +++---- azurerm/resource_arm_automation_module.go | 6 ++--- azurerm/resource_arm_autoscale_setting.go | 9 +++---- azurerm/resource_arm_azuread_application.go | 3 +-- azurerm/resource_arm_container_group.go | 7 +++--- azurerm/resource_arm_container_registry.go | 3 ++- azurerm/resource_arm_databricks_workspace.go | 3 ++- azurerm/resource_arm_dev_test_policy.go | 2 +- azurerm/resource_arm_devspace_controller.go | 2 +- azurerm/resource_arm_firewall.go | 4 ++-- ...ce_arm_firewall_network_rule_collection.go | 3 ++- azurerm/resource_arm_loadbalancer.go | 8 +++---- ...e_arm_loadbalancer_backend_address_pool.go | 8 +++---- azurerm/resource_arm_loadbalancer_nat_pool.go | 4 ++-- azurerm/resource_arm_loadbalancer_nat_rule.go | 4 ++-- azurerm/resource_arm_loadbalancer_probe.go | 4 ++-- azurerm/resource_arm_loadbalancer_rule.go | 2 +- .../resource_arm_log_analytics_solution.go | 6 ++--- ..._log_analytics_workspace_linked_service.go | 4 ++-- azurerm/resource_arm_mariadb_server.go | 4 ++-- azurerm/resource_arm_monitor_action_group.go | 17 ++++++------- ...resource_arm_monitor_activity_log_alert.go | 5 ++-- ...resource_arm_monitor_diagnostic_setting.go | 3 ++- azurerm/resource_arm_monitor_log_profile.go | 4 ++-- azurerm/resource_arm_monitor_metric_alert.go | 9 +++---- ...resource_arm_mysql_virtual_network_rule.go | 3 +-- azurerm/resource_arm_network_interface.go | 8 +++---- ...terface_application_gateway_association.go | 4 ++-- ...erface_backend_address_pool_association.go | 4 ++-- ..._network_interface_nat_rule_association.go | 4 ++-- ...rce_arm_postgresql_virtual_network_rule.go | 3 +-- azurerm/resource_arm_public_ip.go | 2 +- azurerm/resource_arm_route.go | 9 +++---- azurerm/resource_arm_scheduler_job.go | 24 +++++++++---------- .../resource_arm_security_center_contact.go | 6 ++--- .../resource_arm_security_center_workspace.go | 4 ++-- azurerm/resource_arm_sql_database.go | 6 ++--- .../resource_arm_virtual_machine_scale_set.go | 15 ++++++------ azurerm/resource_arm_virtual_network.go | 12 +++++----- .../resource_arm_virtual_network_gateway.go | 2 +- ..._arm_virtual_network_gateway_connection.go | 5 ++-- 50 files changed, 146 insertions(+), 137 deletions(-) diff --git a/azurerm/data_source_monitor_action_group.go b/azurerm/data_source_monitor_action_group.go index bac1c74dff4f..647ec1cdfd33 100644 --- a/azurerm/data_source_monitor_action_group.go +++ b/azurerm/data_source_monitor_action_group.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -15,7 +15,7 @@ func dataSourceArmMonitorActionGroup() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameForDataSourceSchema(), diff --git a/azurerm/data_source_public_ip.go b/azurerm/data_source_public_ip.go index 9e7f462369c0..395ace5e0f8b 100644 --- a/azurerm/data_source_public_ip.go +++ b/azurerm/data_source_public_ip.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -15,7 +15,7 @@ func dataSourceArmPublicIP() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameForDataSourceSchema(), diff --git a/azurerm/data_source_subnet.go b/azurerm/data_source_subnet.go index 933c308c0077..7a7e0e50b8fc 100644 --- a/azurerm/data_source_subnet.go +++ b/azurerm/data_source_subnet.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -15,13 +15,13 @@ func dataSourceArmSubnet() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "virtual_network_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameForDataSourceSchema(), diff --git a/azurerm/data_source_virtual_network.go b/azurerm/data_source_virtual_network.go index d9c5fe15e3d9..f665bad715fa 100644 --- a/azurerm/data_source_virtual_network.go +++ b/azurerm/data_source_virtual_network.go @@ -5,7 +5,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -16,7 +16,7 @@ func dataSourceArmVirtualNetwork() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameForDataSourceSchema(), diff --git a/azurerm/data_source_virtual_network_gateway.go b/azurerm/data_source_virtual_network_gateway.go index 365874dc34cf..d3928013f7c3 100644 --- a/azurerm/data_source_virtual_network_gateway.go +++ b/azurerm/data_source_virtual_network_gateway.go @@ -8,7 +8,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -20,7 +20,7 @@ func dataSourceArmVirtualNetworkGateway() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameForDataSourceSchema(), diff --git a/azurerm/helpers/azure/key_vault_child.go b/azurerm/helpers/azure/key_vault_child.go index e265cf114eb4..261b88bb974c 100644 --- a/azurerm/helpers/azure/key_vault_child.go +++ b/azurerm/helpers/azure/key_vault_child.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" ) type KeyVaultChildID struct { @@ -55,7 +55,7 @@ func ValidateKeyVaultChildName(v interface{}, k string) (warnings []string, erro // Unfortunately this can't (easily) go in the Validate package // since there's a circular reference on this package func ValidateKeyVaultChildId(i interface{}, k string) (warnings []string, errors []error) { - if warnings, errors = validation.NoZeroValues(i, k); len(errors) > 0 { + if warnings, errors = validate.NoEmptyStrings(i, k); len(errors) > 0 { return warnings, errors } diff --git a/azurerm/helpers/validate/base64.go b/azurerm/helpers/validate/base64.go index 8a5774a2e9b3..c5752ef05d75 100644 --- a/azurerm/helpers/validate/base64.go +++ b/azurerm/helpers/validate/base64.go @@ -5,13 +5,12 @@ import ( "fmt" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" ) func Base64String() schema.SchemaValidateFunc { return func(i interface{}, k string) (warnings []string, errors []error) { // Empty string is not allowed - if warnings, errors = validation.NoZeroValues(i, k); len(errors) > 0 { + if warnings, errors = NoEmptyStrings(i, k); len(errors) > 0 { return } diff --git a/azurerm/resource_arm_api_management.go b/azurerm/resource_arm_api_management.go index 93d90cd0d4d9..19d4a07f7223 100644 --- a/azurerm/resource_arm_api_management.go +++ b/azurerm/resource_arm_api_management.go @@ -777,7 +777,7 @@ func apiManagementResourceHostnameSchema(schemaName string) map[string]*schema.S "host_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "key_vault_id": { @@ -794,7 +794,7 @@ func apiManagementResourceHostnameSchema(schemaName string) map[string]*schema.S Type: schema.TypeString, Optional: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, ConflictsWith: []string{ fmt.Sprintf("hostname_configuration.0.%s.0.key_vault_id", schemaName), }, @@ -804,7 +804,7 @@ func apiManagementResourceHostnameSchema(schemaName string) map[string]*schema.S Type: schema.TypeString, Optional: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, ConflictsWith: []string{ fmt.Sprintf("hostname_configuration.0.%s.0.key_vault_id", schemaName), }, diff --git a/azurerm/resource_arm_automation_dsc_configuration.go b/azurerm/resource_arm_automation_dsc_configuration.go index 340131167078..e3600a288d44 100644 --- a/azurerm/resource_arm_automation_dsc_configuration.go +++ b/azurerm/resource_arm_automation_dsc_configuration.go @@ -9,6 +9,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -38,13 +39,13 @@ func resourceArmAutomationDscConfiguration() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "content_embedded": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), diff --git a/azurerm/resource_arm_automation_dsc_nodeconfiguration.go b/azurerm/resource_arm_automation_dsc_nodeconfiguration.go index 1b5e60eb1488..5f46bcf78983 100644 --- a/azurerm/resource_arm_automation_dsc_nodeconfiguration.go +++ b/azurerm/resource_arm_automation_dsc_nodeconfiguration.go @@ -7,7 +7,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -27,14 +27,14 @@ func resourceArmAutomationDscNodeConfiguration() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "automation_account_name": { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -42,7 +42,7 @@ func resourceArmAutomationDscNodeConfiguration() *schema.Resource { "content_embedded": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "configuration_name": { diff --git a/azurerm/resource_arm_automation_module.go b/azurerm/resource_arm_automation_module.go index 1745cae11a65..64bd5f2fb523 100644 --- a/azurerm/resource_arm_automation_module.go +++ b/azurerm/resource_arm_automation_module.go @@ -6,7 +6,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -26,14 +26,14 @@ func resourceArmAutomationModule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "automation_account_name": { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), diff --git a/azurerm/resource_arm_autoscale_setting.go b/azurerm/resource_arm_autoscale_setting.go index b532616172c4..93a35491a4c5 100644 --- a/azurerm/resource_arm_autoscale_setting.go +++ b/azurerm/resource_arm_autoscale_setting.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -30,7 +31,7 @@ func resourceArmAutoScaleSetting() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -59,7 +60,7 @@ func resourceArmAutoScaleSetting() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "capacity": { Type: schema.TypeList, @@ -100,7 +101,7 @@ func resourceArmAutoScaleSetting() *schema.Resource { "metric_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "metric_resource_id": { Type: schema.TypeString, @@ -320,7 +321,7 @@ func resourceArmAutoScaleSetting() *schema.Resource { "service_uri": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "properties": { Type: schema.TypeMap, diff --git a/azurerm/resource_arm_azuread_application.go b/azurerm/resource_arm_azuread_application.go index 5e7b9d0b522a..f93b5484f51c 100644 --- a/azurerm/resource_arm_azuread_application.go +++ b/azurerm/resource_arm_azuread_application.go @@ -4,7 +4,6 @@ import ( "fmt" "log" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac" @@ -26,7 +25,7 @@ func resourceArmActiveDirectoryApplication() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "homepage": { diff --git a/azurerm/resource_arm_container_group.go b/azurerm/resource_arm_container_group.go index 6d6adc9bd71b..7e67a1b76333 100644 --- a/azurerm/resource_arm_container_group.go +++ b/azurerm/resource_arm_container_group.go @@ -8,6 +8,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -62,14 +63,14 @@ func resourceArmContainerGroup() *schema.Resource { "server": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, ForceNew: true, }, "username": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, ForceNew: true, }, @@ -77,7 +78,7 @@ func resourceArmContainerGroup() *schema.Resource { Type: schema.TypeString, Required: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, ForceNew: true, }, }, diff --git a/azurerm/resource_arm_container_registry.go b/azurerm/resource_arm_container_registry.go index 30872d889f7c..a89e0df80241 100644 --- a/azurerm/resource_arm_container_registry.go +++ b/azurerm/resource_arm_container_registry.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -63,7 +64,7 @@ func resourceArmContainerRegistry() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: azureRMHashLocation, }, diff --git a/azurerm/resource_arm_databricks_workspace.go b/azurerm/resource_arm_databricks_workspace.go index 90f5ecc8a3a2..04cee6797a40 100644 --- a/azurerm/resource_arm_databricks_workspace.go +++ b/azurerm/resource_arm_databricks_workspace.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -51,7 +52,7 @@ func resourceArmDatabricksWorkspace() *schema.Resource { Optional: true, ForceNew: true, Computed: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "managed_resource_group_id": { diff --git a/azurerm/resource_arm_dev_test_policy.go b/azurerm/resource_arm_dev_test_policy.go index b933df19b014..f1a5a9a2adc3 100644 --- a/azurerm/resource_arm_dev_test_policy.go +++ b/azurerm/resource_arm_dev_test_policy.go @@ -58,7 +58,7 @@ func resourceArmDevTestPolicy() *schema.Resource { "threshold": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "evaluator_type": { diff --git a/azurerm/resource_arm_devspace_controller.go b/azurerm/resource_arm_devspace_controller.go index c1cf445002ab..18b5a140fddc 100644 --- a/azurerm/resource_arm_devspace_controller.go +++ b/azurerm/resource_arm_devspace_controller.go @@ -65,7 +65,7 @@ func resourceArmDevSpaceController() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "target_container_host_resource_id": { diff --git a/azurerm/resource_arm_firewall.go b/azurerm/resource_arm_firewall.go index 841351d88071..fc9d09549a57 100644 --- a/azurerm/resource_arm_firewall.go +++ b/azurerm/resource_arm_firewall.go @@ -7,8 +7,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -45,7 +45,7 @@ func resourceArmFirewall() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "subnet_id": { Type: schema.TypeString, diff --git a/azurerm/resource_arm_firewall_network_rule_collection.go b/azurerm/resource_arm_firewall_network_rule_collection.go index 8b27fdd3222c..51978a00b2c6 100644 --- a/azurerm/resource_arm_firewall_network_rule_collection.go +++ b/azurerm/resource_arm_firewall_network_rule_collection.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -62,7 +63,7 @@ func resourceArmFirewallNetworkRuleCollection() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "description": { Type: schema.TypeString, diff --git a/azurerm/resource_arm_loadbalancer.go b/azurerm/resource_arm_loadbalancer.go index 31f66cd4fa4c..5a780fbde681 100644 --- a/azurerm/resource_arm_loadbalancer.go +++ b/azurerm/resource_arm_loadbalancer.go @@ -46,7 +46,7 @@ func resourceArmLoadBalancer() *schema.Resource { string(network.LoadBalancerSkuNameBasic), string(network.LoadBalancerSkuNameStandard), }, true), - DiffSuppressFunc: ignoreCaseDiffSuppressFunc, + DiffSuppressFunc: suppress.CaseDifference, }, "frontend_ip_configuration": { @@ -58,7 +58,7 @@ func resourceArmLoadBalancer() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "subnet_id": { @@ -99,7 +99,7 @@ func resourceArmLoadBalancer() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, @@ -109,7 +109,7 @@ func resourceArmLoadBalancer() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, diff --git a/azurerm/resource_arm_loadbalancer_backend_address_pool.go b/azurerm/resource_arm_loadbalancer_backend_address_pool.go index 732aa4d807f8..0b6e6860367c 100644 --- a/azurerm/resource_arm_loadbalancer_backend_address_pool.go +++ b/azurerm/resource_arm_loadbalancer_backend_address_pool.go @@ -8,8 +8,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -27,7 +27,7 @@ func resourceArmLoadBalancerBackendAddressPool() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "location": deprecatedLocationSchema(), @@ -46,7 +46,7 @@ func resourceArmLoadBalancerBackendAddressPool() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, @@ -56,7 +56,7 @@ func resourceArmLoadBalancerBackendAddressPool() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, diff --git a/azurerm/resource_arm_loadbalancer_nat_pool.go b/azurerm/resource_arm_loadbalancer_nat_pool.go index 44f743d6148f..fbe036028cd8 100644 --- a/azurerm/resource_arm_loadbalancer_nat_pool.go +++ b/azurerm/resource_arm_loadbalancer_nat_pool.go @@ -30,7 +30,7 @@ func resourceArmLoadBalancerNatPool() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "location": deprecatedLocationSchema(), @@ -77,7 +77,7 @@ func resourceArmLoadBalancerNatPool() *schema.Resource { "frontend_ip_configuration_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "frontend_ip_configuration_id": { diff --git a/azurerm/resource_arm_loadbalancer_nat_rule.go b/azurerm/resource_arm_loadbalancer_nat_rule.go index 68ecaa7d0b18..a385ce0043b6 100644 --- a/azurerm/resource_arm_loadbalancer_nat_rule.go +++ b/azurerm/resource_arm_loadbalancer_nat_rule.go @@ -31,7 +31,7 @@ func resourceArmLoadBalancerNatRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "location": deprecatedLocationSchema(), @@ -78,7 +78,7 @@ func resourceArmLoadBalancerNatRule() *schema.Resource { "frontend_ip_configuration_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "frontend_ip_configuration_id": { diff --git a/azurerm/resource_arm_loadbalancer_probe.go b/azurerm/resource_arm_loadbalancer_probe.go index 9f71c5e5b1dc..3b95ccc59331 100644 --- a/azurerm/resource_arm_loadbalancer_probe.go +++ b/azurerm/resource_arm_loadbalancer_probe.go @@ -30,7 +30,7 @@ func resourceArmLoadBalancerProbe() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "location": deprecatedLocationSchema(), @@ -86,7 +86,7 @@ func resourceArmLoadBalancerProbe() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, diff --git a/azurerm/resource_arm_loadbalancer_rule.go b/azurerm/resource_arm_loadbalancer_rule.go index 8f5ce2dd0aff..01191cdcca58 100644 --- a/azurerm/resource_arm_loadbalancer_rule.go +++ b/azurerm/resource_arm_loadbalancer_rule.go @@ -49,7 +49,7 @@ func resourceArmLoadBalancerRule() *schema.Resource { "frontend_ip_configuration_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "frontend_ip_configuration_id": { diff --git a/azurerm/resource_arm_log_analytics_solution.go b/azurerm/resource_arm_log_analytics_solution.go index 154f955665a5..170078b4365b 100644 --- a/azurerm/resource_arm_log_analytics_solution.go +++ b/azurerm/resource_arm_log_analytics_solution.go @@ -7,9 +7,9 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -29,14 +29,14 @@ func resourceArmLogAnalyticsSolution() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "workspace_name": { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "workspace_resource_id": { diff --git a/azurerm/resource_arm_log_analytics_workspace_linked_service.go b/azurerm/resource_arm_log_analytics_workspace_linked_service.go index 7943b3911275..157849c5943a 100644 --- a/azurerm/resource_arm_log_analytics_workspace_linked_service.go +++ b/azurerm/resource_arm_log_analytics_workspace_linked_service.go @@ -6,8 +6,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -36,7 +36,7 @@ func resourceArmLogAnalyticsWorkspaceLinkedService() *schema.Resource { Optional: true, ForceNew: true, Default: "automation", - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "linked_service_properties": { diff --git a/azurerm/resource_arm_mariadb_server.go b/azurerm/resource_arm_mariadb_server.go index 6e3d80fb1fdc..e347777e94db 100644 --- a/azurerm/resource_arm_mariadb_server.go +++ b/azurerm/resource_arm_mariadb_server.go @@ -103,14 +103,14 @@ func resourceArmMariaDbServer() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "administrator_login_password": { Type: schema.TypeString, Required: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "version": { diff --git a/azurerm/resource_arm_monitor_action_group.go b/azurerm/resource_arm_monitor_action_group.go index 478b6209acf1..ea6f4cbea85a 100644 --- a/azurerm/resource_arm_monitor_action_group.go +++ b/azurerm/resource_arm_monitor_action_group.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -25,7 +26,7 @@ func resourceArmMonitorActionGroup() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -50,12 +51,12 @@ func resourceArmMonitorActionGroup() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "email_address": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, }, @@ -69,17 +70,17 @@ func resourceArmMonitorActionGroup() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "country_code": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "phone_number": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, }, @@ -93,12 +94,12 @@ func resourceArmMonitorActionGroup() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "service_uri": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, }, diff --git a/azurerm/resource_arm_monitor_activity_log_alert.go b/azurerm/resource_arm_monitor_activity_log_alert.go index eda603af534e..c9f33519e4ca 100644 --- a/azurerm/resource_arm_monitor_activity_log_alert.go +++ b/azurerm/resource_arm_monitor_activity_log_alert.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -31,7 +32,7 @@ func resourceArmMonitorActivityLogAlert() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -42,7 +43,7 @@ func resourceArmMonitorActivityLogAlert() *schema.Resource { MinItems: 1, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, diff --git a/azurerm/resource_arm_monitor_diagnostic_setting.go b/azurerm/resource_arm_monitor_diagnostic_setting.go index b7ff45e836ed..a491cf1d2cd9 100644 --- a/azurerm/resource_arm_monitor_diagnostic_setting.go +++ b/azurerm/resource_arm_monitor_diagnostic_setting.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,7 +34,7 @@ func resourceArmMonitorDiagnosticSetting() *schema.Resource { ForceNew: true, // NOTE: there's no validation requirements listed for this // so we're intentionally doing the minimum we can here - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "target_resource_id": { diff --git a/azurerm/resource_arm_monitor_log_profile.go b/azurerm/resource_arm_monitor_log_profile.go index 8a9ae6f87977..07bd8c5c1eee 100644 --- a/azurerm/resource_arm_monitor_log_profile.go +++ b/azurerm/resource_arm_monitor_log_profile.go @@ -9,8 +9,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -29,7 +29,7 @@ func resourceArmMonitorLogProfile() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "storage_account_id": { Type: schema.TypeString, diff --git a/azurerm/resource_arm_monitor_metric_alert.go b/azurerm/resource_arm_monitor_metric_alert.go index e86b1ef07c76..ecaeb6c381e9 100644 --- a/azurerm/resource_arm_monitor_metric_alert.go +++ b/azurerm/resource_arm_monitor_metric_alert.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -30,7 +31,7 @@ func resourceArmMonitorMetricAlert() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -59,12 +60,12 @@ func resourceArmMonitorMetricAlert() *schema.Resource { "metric_namespace": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "metric_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "aggregation": { Type: schema.TypeString, @@ -100,7 +101,7 @@ func resourceArmMonitorMetricAlert() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "operator": { Type: schema.TypeString, diff --git a/azurerm/resource_arm_mysql_virtual_network_rule.go b/azurerm/resource_arm_mysql_virtual_network_rule.go index fe5af6ac967c..c8ae60c0fe44 100644 --- a/azurerm/resource_arm_mysql_virtual_network_rule.go +++ b/azurerm/resource_arm_mysql_virtual_network_rule.go @@ -10,7 +10,6 @@ import ( "github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2017-12-01/mysql" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" @@ -41,7 +40,7 @@ func resourceArmMySqlVirtualNetworkRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "subnet_id": { diff --git a/azurerm/resource_arm_network_interface.go b/azurerm/resource_arm_network_interface.go index 4d21833f6fa9..d7c9a0a3f5b8 100644 --- a/azurerm/resource_arm_network_interface.go +++ b/azurerm/resource_arm_network_interface.go @@ -66,7 +66,7 @@ func resourceArmNetworkInterface() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "subnet_id": { @@ -160,7 +160,7 @@ func resourceArmNetworkInterface() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, @@ -169,7 +169,7 @@ func resourceArmNetworkInterface() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "applied_dns_servers": { @@ -178,7 +178,7 @@ func resourceArmNetworkInterface() *schema.Resource { Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, Set: schema.HashString, }, diff --git a/azurerm/resource_arm_network_interface_application_gateway_association.go b/azurerm/resource_arm_network_interface_application_gateway_association.go index e20f49fc09a4..18cf20636446 100644 --- a/azurerm/resource_arm_network_interface_application_gateway_association.go +++ b/azurerm/resource_arm_network_interface_application_gateway_association.go @@ -7,8 +7,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,7 +33,7 @@ func resourceArmNetworkInterfaceApplicationGatewayBackendAddressPoolAssociation( Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "backend_address_pool_id": { diff --git a/azurerm/resource_arm_network_interface_backend_address_pool_association.go b/azurerm/resource_arm_network_interface_backend_address_pool_association.go index 91f0f01073b3..34773639b18e 100644 --- a/azurerm/resource_arm_network_interface_backend_address_pool_association.go +++ b/azurerm/resource_arm_network_interface_backend_address_pool_association.go @@ -7,8 +7,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,7 +33,7 @@ func resourceArmNetworkInterfaceBackendAddressPoolAssociation() *schema.Resource Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "backend_address_pool_id": { diff --git a/azurerm/resource_arm_network_interface_nat_rule_association.go b/azurerm/resource_arm_network_interface_nat_rule_association.go index b720d7709312..5d9134ef25f4 100644 --- a/azurerm/resource_arm_network_interface_nat_rule_association.go +++ b/azurerm/resource_arm_network_interface_nat_rule_association.go @@ -7,8 +7,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,7 +33,7 @@ func resourceArmNetworkInterfaceNatRuleAssociation() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "nat_rule_id": { diff --git a/azurerm/resource_arm_postgresql_virtual_network_rule.go b/azurerm/resource_arm_postgresql_virtual_network_rule.go index 2d95006adf0b..a809ec997153 100644 --- a/azurerm/resource_arm_postgresql_virtual_network_rule.go +++ b/azurerm/resource_arm_postgresql_virtual_network_rule.go @@ -9,7 +9,6 @@ import ( "github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-12-01/postgresql" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" @@ -40,7 +39,7 @@ func resourceArmPostgreSQLVirtualNetworkRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "subnet_id": { diff --git a/azurerm/resource_arm_public_ip.go b/azurerm/resource_arm_public_ip.go index 1ac644e1cd2b..5be3a483996d 100644 --- a/azurerm/resource_arm_public_ip.go +++ b/azurerm/resource_arm_public_ip.go @@ -39,7 +39,7 @@ func resourceArmPublicIp() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "location": locationSchema(), diff --git a/azurerm/resource_arm_route.go b/azurerm/resource_arm_route.go index 104ca8d19e84..6c0bfaabdb5d 100644 --- a/azurerm/resource_arm_route.go +++ b/azurerm/resource_arm_route.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -26,7 +27,7 @@ func resourceArmRoute() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -35,13 +36,13 @@ func resourceArmRoute() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "address_prefix": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "next_hop_type": { @@ -60,7 +61,7 @@ func resourceArmRoute() *schema.Resource { "next_hop_in_ip_address": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, } diff --git a/azurerm/resource_arm_scheduler_job.go b/azurerm/resource_arm_scheduler_job.go index ce14c2480f3a..a91d9c344d99 100644 --- a/azurerm/resource_arm_scheduler_job.go +++ b/azurerm/resource_arm_scheduler_job.go @@ -55,7 +55,7 @@ func resourceArmSchedulerJob() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, //actions @@ -106,7 +106,7 @@ func resourceArmSchedulerJob() *schema.Resource { Type: schema.TypeString, Optional: true, Default: "00:00:30", - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "count": { @@ -286,7 +286,7 @@ func resourceArmSchedulerJobActionWebSchema(propertyName string) *schema.Resourc "body": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "headers": { @@ -308,14 +308,14 @@ func resourceArmSchedulerJobActionWebSchema(propertyName string) *schema.Resourc "username": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "password": { Type: schema.TypeString, Required: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, }, @@ -335,14 +335,14 @@ func resourceArmSchedulerJobActionWebSchema(propertyName string) *schema.Resourc Type: schema.TypeString, Required: true, Sensitive: true, //sensitive & shortens diff - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "password": { Type: schema.TypeString, Required: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "thumbprint": { @@ -376,19 +376,19 @@ func resourceArmSchedulerJobActionWebSchema(propertyName string) *schema.Resourc "tenant_id": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "client_id": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "secret": { Type: schema.TypeString, Required: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "audience": { @@ -424,13 +424,13 @@ func resourceArmSchedulerJobActionStorageSchema() *schema.Resource { "sas_token": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "message": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, } diff --git a/azurerm/resource_arm_security_center_contact.go b/azurerm/resource_arm_security_center_contact.go index 4d693d1d6d2f..cfa88f74c536 100644 --- a/azurerm/resource_arm_security_center_contact.go +++ b/azurerm/resource_arm_security_center_contact.go @@ -6,7 +6,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/2017-08-01-preview/security" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -31,13 +31,13 @@ func resourceArmSecurityCenterContact() *schema.Resource { "email": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "phone": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "alert_notifications": { diff --git a/azurerm/resource_arm_security_center_workspace.go b/azurerm/resource_arm_security_center_workspace.go index 5a7a2de20267..5ba72c2b1ef6 100644 --- a/azurerm/resource_arm_security_center_workspace.go +++ b/azurerm/resource_arm_security_center_workspace.go @@ -8,8 +8,8 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/2017-08-01-preview/security" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,7 +32,7 @@ func resourceArmSecurityCenterWorkspace() *schema.Resource { "scope": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "workspace_id": { diff --git a/azurerm/resource_arm_sql_database.go b/azurerm/resource_arm_sql_database.go index a99534b7650f..1a0d60374801 100644 --- a/azurerm/resource_arm_sql_database.go +++ b/azurerm/resource_arm_sql_database.go @@ -171,7 +171,7 @@ func resourceArmSqlDatabase() *schema.Resource { Optional: true, Computed: true, DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, // TODO: add validation once the Enum's complete // https://github.com/Azure/azure-rest-api-specs/issues/1609 }, @@ -267,13 +267,13 @@ func resourceArmSqlDatabase() *schema.Resource { Type: schema.TypeString, Optional: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "storage_endpoint": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "use_server_default": { diff --git a/azurerm/resource_arm_virtual_machine_scale_set.go b/azurerm/resource_arm_virtual_machine_scale_set.go index 372113b41468..07dee3ade3d7 100644 --- a/azurerm/resource_arm_virtual_machine_scale_set.go +++ b/azurerm/resource_arm_virtual_machine_scale_set.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,7 +34,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "location": locationSchema(), @@ -83,7 +84,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "tier": { @@ -222,14 +223,14 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { "admin_username": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "admin_password": { Type: schema.TypeString, Optional: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "custom_data": { @@ -375,7 +376,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "primary": { @@ -411,7 +412,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { Required: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, }, @@ -426,7 +427,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "subnet_id": { diff --git a/azurerm/resource_arm_virtual_network.go b/azurerm/resource_arm_virtual_network.go index 897dbf9b6a09..5a72f6a17a5e 100644 --- a/azurerm/resource_arm_virtual_network.go +++ b/azurerm/resource_arm_virtual_network.go @@ -10,7 +10,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -31,7 +31,7 @@ func resourceArmVirtualNetwork() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -44,7 +44,7 @@ func resourceArmVirtualNetwork() *schema.Resource { MinItems: 1, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, @@ -53,7 +53,7 @@ func resourceArmVirtualNetwork() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, }, @@ -66,12 +66,12 @@ func resourceArmVirtualNetwork() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "address_prefix": { Type: schema.TypeString, Required: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "security_group": { Type: schema.TypeString, diff --git a/azurerm/resource_arm_virtual_network_gateway.go b/azurerm/resource_arm_virtual_network_gateway.go index 715b065a54df..20bbb8a3421e 100644 --- a/azurerm/resource_arm_virtual_network_gateway.go +++ b/azurerm/resource_arm_virtual_network_gateway.go @@ -33,7 +33,7 @@ func resourceArmVirtualNetworkGateway() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), diff --git a/azurerm/resource_arm_virtual_network_gateway_connection.go b/azurerm/resource_arm_virtual_network_gateway_connection.go index 43974a77295a..779e37b228f6 100644 --- a/azurerm/resource_arm_virtual_network_gateway_connection.go +++ b/azurerm/resource_arm_virtual_network_gateway_connection.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -28,7 +29,7 @@ func resourceArmVirtualNetworkGatewayConnection() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "resource_group_name": resourceGroupNameSchema(), @@ -58,7 +59,7 @@ func resourceArmVirtualNetworkGatewayConnection() *schema.Resource { Type: schema.TypeString, Optional: true, Sensitive: true, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.NoEmptyStrings, }, "express_route_circuit_id": {