diff --git a/digitalocean/database/resource_database_cluster.go b/digitalocean/database/resource_database_cluster.go index 8331dea22..2ef9c803b 100644 --- a/digitalocean/database/resource_database_cluster.go +++ b/digitalocean/database/resource_database_cluster.go @@ -96,8 +96,9 @@ func ResourceDigitalOceanDatabaseCluster() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "day": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.IsDayOfTheWeek(true), }, "hour": { Type: schema.TypeString, diff --git a/digitalocean/kubernetes/resource_kubernetes_cluster.go b/digitalocean/kubernetes/resource_kubernetes_cluster.go index 9abb46df8..2b548b3bd 100644 --- a/digitalocean/kubernetes/resource_kubernetes_cluster.go +++ b/digitalocean/kubernetes/resource_kubernetes_cluster.go @@ -124,6 +124,17 @@ func ResourceDigitalOceanKubernetesCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "any", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday"}, + true, + ), }, "start_time": { Type: schema.TypeString, diff --git a/docs/resources/database_cluster.md b/docs/resources/database_cluster.md index e5b7da774..7e89253a8 100644 --- a/docs/resources/database_cluster.md +++ b/docs/resources/database_cluster.md @@ -133,8 +133,8 @@ The following arguments are supported: `maintenance_window` supports the following: -* `day` - (Required) The day of the week on which to apply maintenance updates. -* `hour` - (Required) The hour in UTC at which maintenance updates will be applied in 24 hour format. +* `day` - (Required) The day of the week on which to apply maintenance updates. May be one of `monday` through `sunday`. +* `hour` - (Required) The hour in UTC at which maintenance updates will be applied as a string in 24 hour format, e.g. `13:00`. * `backup_restore` - (Optional) Create a new database cluster based on a backup of an existing cluster.