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 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,