From c780664e7f1341c0ca2dc2d434955bcdf0ce885c Mon Sep 17 00:00:00 2001 From: Kobi Samoray Date: Wed, 13 Dec 2023 09:59:27 +0000 Subject: [PATCH] Verify that project_id contains a value Empty project id is meaningless and also crashes the provider. Signed-off-by: Kobi Samoray --- nsxt/utils.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nsxt/utils.go b/nsxt/utils.go index caedfc5be..2c1363929 100644 --- a/nsxt/utils.go +++ b/nsxt/utils.go @@ -692,10 +692,11 @@ func getContextSchema() *schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "project_id": { - Type: schema.TypeString, - Description: "Id of the project which the resource belongs to.", - Required: true, - ForceNew: true, + Type: schema.TypeString, + Description: "Id of the project which the resource belongs to.", + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, }, }, },