From 93d925fcfd07457eee723ef02e4b7e873c1dca23 Mon Sep 17 00:00:00 2001 From: KeisukeYamashita <19yamashita15@gmail.com> Date: Sun, 3 Apr 2022 04:19:43 +0900 Subject: [PATCH] Add validate func for auth method type key (#178) * Add validate func for auth key Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com> * Add oidc Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com> --- internal/provider/resource_auth_method.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/provider/resource_auth_method.go b/internal/provider/resource_auth_method.go index 8f446756..ec832ac7 100644 --- a/internal/provider/resource_auth_method.go +++ b/internal/provider/resource_auth_method.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/boundary/api/authmethods" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) func resourceAuthMethod() *schema.Resource { @@ -50,6 +51,10 @@ func resourceAuthMethod() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + authmethodTypeOidc, + authmethodTypePassword, + }, false), }, authmethodMinLoginNameLengthKey: { Description: "The minimum login name length.",