Skip to content

Commit a9defaf

Browse files
authored
Merge pull request #157 from StatusCakeDev/apply-default-value-for-status-codes
Apply default value for status codes
2 parents 702f508 + 77eda8c commit a9defaf

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ $(BINARY_NAME):
3535
@echo "building provider"
3636
@go build -o $@
3737

38+
.PHONY: docs
39+
docs:
40+
@go generate ./...
41+
3842
.PHONY: testacc
3943
testacc:
4044
TF_ACC=1 $(GO) test ./... -v $(TESTARGS) -timeout 120m

docs/resources/uptime_check.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ Optional:
126126
<a id="nestedblock--http_check"></a>
127127
### Nested Schema for `http_check`
128128

129-
Required:
130-
131-
- `status_codes` (Set of String) List of status codes that trigger an alert
132-
133129
Optional:
134130

135131
- `basic_authentication` (Block List, Max: 1) Basic Authentication (RFC7235) configuration block (see [below for nested schema](#nestedblock--http_check--basic_authentication))
@@ -141,6 +137,7 @@ Optional:
141137
- `request_method` (String) Type of HTTP check. Either HTTP, or HEAD
142138
- `request_payload` (Map of String) Payload submitted with the request. Setting this updates the check to use the HTTP POST verb. Only one of `request_payload` or `request_payload_raw` may be specified
143139
- `request_payload_raw` (String) Raw payload submitted with the request. Setting this updates the check to use the HTTP POST verb. Only one of `request_payload` or `request_payload_raw` may be specified
140+
- `status_codes` (Set of String) List of status codes that trigger an alert. If not specified then the default status codes are used. Once set, the default status codes cannot be restored and ommitting this field does not clear the attribute
144141
- `timeout` (Number) The number of seconds to wait to receive the first byte
145142
- `user_agent` (String) Custom user agent string set when testing
146143
- `validate_ssl` (Boolean) Whether to send an alert if the SSL certificate is soon to expire

internal/provider/resource_uptime_check.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ func resourceStatusCakeUptimeCheck() *schema.Resource {
194194
},
195195
"status_codes": &schema.Schema{
196196
Type: schema.TypeSet,
197-
Required: true,
197+
Computed: true,
198+
Optional: true,
198199
MinItems: 1,
199-
Description: "List of status codes that trigger an alert",
200+
Description: "List of status codes that trigger an alert. If not specified then the default status codes are used. Once set, the default status codes cannot be restored and ommitting this field does not clear the attribute",
200201
Elem: &schema.Schema{
201202
Type: schema.TypeString,
202203
ValidateFunc: intvalidation.StringIsNumerical,

0 commit comments

Comments
 (0)