From 2c960e7fdab5a680de2be306ec3797350b69bfa9 Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Thu, 4 Apr 2019 19:03:48 -0700 Subject: [PATCH 1/2] validation for identity_ids --- azurerm/resource_arm_virtual_machine.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azurerm/resource_arm_virtual_machine.go b/azurerm/resource_arm_virtual_machine.go index 33f12e538c3c..10cd7ad69923 100644 --- a/azurerm/resource_arm_virtual_machine.go +++ b/azurerm/resource_arm_virtual_machine.go @@ -102,8 +102,10 @@ func resourceArmVirtualMachine() *schema.Resource { "identity_ids": { Type: schema.TypeList, Optional: true, + MinItems: 1, Elem: &schema.Schema{ - Type: schema.TypeString, + Type: schema.TypeString, + ValidateFunc: validation.NoZeroValues, }, }, }, From a4a2ab03bf11d68733f8ee078e4de39ffbfbbc64 Mon Sep 17 00:00:00 2001 From: Robert Lippens Date: Thu, 4 Apr 2019 19:10:26 -0700 Subject: [PATCH 2/2] check for UUIDs --- azurerm/resource_arm_virtual_machine.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azurerm/resource_arm_virtual_machine.go b/azurerm/resource_arm_virtual_machine.go index 10cd7ad69923..dc1b016b2554 100644 --- a/azurerm/resource_arm_virtual_machine.go +++ b/azurerm/resource_arm_virtual_machine.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" "golang.org/x/net/context" ) @@ -105,7 +106,7 @@ func resourceArmVirtualMachine() *schema.Resource { MinItems: 1, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.NoZeroValues, + ValidateFunc: validate.UUID, }, }, },