diff --git a/internal/sdkv2provider/resource_cloudflare_email_routing_rule.go b/internal/sdkv2provider/resource_cloudflare_email_routing_rule.go index 48c3ec1ab5..9892f17433 100644 --- a/internal/sdkv2provider/resource_cloudflare_email_routing_rule.go +++ b/internal/sdkv2provider/resource_cloudflare_email_routing_rule.go @@ -46,8 +46,10 @@ func buildMatchersAndActions(d *schema.ResourceData) (matchers []cloudflare.Emai action := item.(map[string]interface{}) ruleAction := cloudflare.EmailRoutingRuleAction{} ruleAction.Type = action["type"].(string) - for _, value := range action["value"].([]interface{}) { - ruleAction.Value = append(ruleAction.Value, value.(string)) + if val, ok := action["value"]; ok { + for _, value := range val.([]interface{}) { + ruleAction.Value = append(ruleAction.Value, value.(string)) + } } actions = append(actions, ruleAction) diff --git a/internal/sdkv2provider/schema_cloudflare_email_routing_rules.go b/internal/sdkv2provider/schema_cloudflare_email_routing_rules.go index f8900948c0..2e09d511bd 100644 --- a/internal/sdkv2provider/schema_cloudflare_email_routing_rules.go +++ b/internal/sdkv2provider/schema_cloudflare_email_routing_rules.go @@ -71,7 +71,7 @@ func resourceCloudflareEmailRoutingRuleSchema() map[string]*schema.Schema { Description: "Type of supported action.", Type: schema.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{"forward", "worker"}, true), + ValidateFunc: validation.StringInSlice([]string{"forward", "worker", "drop"}, true), }, "value": { Description: "An array with items in the following form.",