Skip to content

Commit

Permalink
Merge pull request #24170 from DrFaust92/grafana-validations
Browse files Browse the repository at this point in the history
r/grafana_workspace - validations
  • Loading branch information
ewbankkit authored Apr 12, 2022
2 parents 2617987 + 6f17f74 commit 65d0933
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/24170.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_grafana_workspace: Add plan time validations for `authentication_providers`, `authentication_providers`, `authentication_providers`.
```
15 changes: 12 additions & 3 deletions internal/service/grafana/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 65d0933

Please sign in to comment.