From 041d5a369ea033054777f66831be4d1ec692979f Mon Sep 17 00:00:00 2001 From: travertischio Date: Sun, 30 Apr 2017 17:15:34 -0300 Subject: [PATCH] Makes cache setting condition optional in fastly service --- .../providers/fastly/resource_fastly_service_v1.go | 11 ++++++----- .../docs/providers/fastly/r/service_v1.html.markdown | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/builtin/providers/fastly/resource_fastly_service_v1.go b/builtin/providers/fastly/resource_fastly_service_v1.go index 4ce4db716..bb3fb6bfd 100644 --- a/builtin/providers/fastly/resource_fastly_service_v1.go +++ b/builtin/providers/fastly/resource_fastly_service_v1.go @@ -318,17 +318,18 @@ func resourceServiceV1() *schema.Resource { Required: true, Description: "A name to refer to this Cache Setting", }, - "cache_condition": { - Type: schema.TypeString, - Required: true, - Description: "Name of a condition to check if this Cache Setting applies", - }, "action": { Type: schema.TypeString, Optional: true, Description: "Action to take", }, // optional + "cache_condition": { + Type: schema.TypeString, + Optional: true, + Default: "", + Description: "Name of a condition to check if this Cache Setting applies", + }, "stale_ttl": { Type: schema.TypeInt, Optional: true, diff --git a/website/source/docs/providers/fastly/r/service_v1.html.markdown b/website/source/docs/providers/fastly/r/service_v1.html.markdown index 37bd5c1f5..2f0a7cb2e 100644 --- a/website/source/docs/providers/fastly/r/service_v1.html.markdown +++ b/website/source/docs/providers/fastly/r/service_v1.html.markdown @@ -209,7 +209,7 @@ The `cache_setting` block supports: * `name` - (Required) Unique name for this Cache Setting. * `action` - (Required) One of `cache`, `pass`, or `restart`, as defined on Fastly's documentation under ["Caching action descriptions"](https://docs.fastly.com/guides/performance-tuning/controlling-caching#caching-action-descriptions). -* `cache_condition` - (Required) Name of already defined `condition` used to test whether this settings object should be used. This `condition` must be of type `CACHE`. +* `cache_condition` - (Optional) Name of already defined `condition` used to test whether this settings object should be used. This `condition` must be of type `CACHE`. * `stale_ttl` - (Optional) Max "Time To Live" for stale (unreachable) objects. Default `300`. * `ttl` - (Optional) The Time-To-Live (TTL) for the object.