From eab1f69d01f174a5e289f8a1c6d818674d7ad966 Mon Sep 17 00:00:00 2001 From: v-cheye Date: Thu, 6 Feb 2020 09:42:09 +0800 Subject: [PATCH] Add name validation for azurerm_role_assignment --- .../authorization/resource_arm_role_assignment.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/azurerm/internal/services/authorization/resource_arm_role_assignment.go b/azurerm/internal/services/authorization/resource_arm_role_assignment.go index 7afbdb0edc2c..f11016a66c8c 100644 --- a/azurerm/internal/services/authorization/resource_arm_role_assignment.go +++ b/azurerm/internal/services/authorization/resource_arm_role_assignment.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" "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/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" @@ -36,10 +37,11 @@ func resourceArmRoleAssignment() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validate.GUID, }, "scope": {