From 79f8ab7569ae4dfb27cc854191cdab0e9ede8e50 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sun, 10 Apr 2022 14:26:58 +0300 Subject: [PATCH 1/2] validations --- internal/service/grafana/workspace.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/internal/service/grafana/workspace.go b/internal/service/grafana/workspace.go index 0288475443b5..7904a40a6bf1 100644 --- a/internal/service/grafana/workspace.go +++ b/internal/service/grafana/workspace.go @@ -48,12 +48,18 @@ func ResourceWorkspace() *schema.Resource { Type: schema.TypeList, Required: true, ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(managedgrafana.AuthenticationProviderTypes_Values(), false), + }, }, "data_sources": { Type: schema.TypeList, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(managedgrafana.DataSourceType_Values(), false), + }, }, "description": { Type: schema.TypeString, @@ -75,7 +81,10 @@ func ResourceWorkspace() *schema.Resource { "notification_destinations": { Type: schema.TypeList, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(managedgrafana.NotificationDestinationType_Values(), false), + }, }, "organization_role_name": { Type: schema.TypeString, From 6f17f7499631cf5a1eb9e92a32a13ead0a677747 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sun, 10 Apr 2022 14:28:54 +0300 Subject: [PATCH 2/2] changelog --- .changelog/24170.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/24170.txt diff --git a/.changelog/24170.txt b/.changelog/24170.txt new file mode 100644 index 000000000000..551fb9a18cbd --- /dev/null +++ b/.changelog/24170.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_grafana_workspace: Add plan time validations for `authentication_providers`, `authentication_providers`, `authentication_providers`. +``` \ No newline at end of file