Skip to content

Commit

Permalink
feat(uptime): apply default value for status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbasham committed Oct 17, 2023
1 parent 323ebfe commit 77eda8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ $(BINARY_NAME):
@echo "building provider"
@go build -o $@

.PHONY: docs
docs:
@go generate ./...

.PHONY: testacc
testacc:
TF_ACC=1 $(GO) test ./... -v $(TESTARGS) -timeout 120m
Expand Down
5 changes: 1 addition & 4 deletions docs/resources/uptime_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ Optional:
<a id="nestedblock--http_check"></a>
### Nested Schema for `http_check`

Required:

- `status_codes` (Set of String) List of status codes that trigger an alert

Optional:

- `basic_authentication` (Block List, Max: 1) Basic Authentication (RFC7235) configuration block (see [below for nested schema](#nestedblock--http_check--basic_authentication))
Expand All @@ -141,6 +137,7 @@ Optional:
- `request_method` (String) Type of HTTP check. Either HTTP, or HEAD
- `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
- `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
- `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
- `timeout` (Number) The number of seconds to wait to receive the first byte
- `user_agent` (String) Custom user agent string set when testing
- `validate_ssl` (Boolean) Whether to send an alert if the SSL certificate is soon to expire
Expand Down
5 changes: 3 additions & 2 deletions internal/provider/resource_uptime_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ func resourceStatusCakeUptimeCheck() *schema.Resource {
},
"status_codes": &schema.Schema{
Type: schema.TypeSet,
Required: true,
Computed: true,
Optional: true,
MinItems: 1,
Description: "List of status codes that trigger an alert",
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",
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: intvalidation.StringIsNumerical,
Expand Down

0 comments on commit 77eda8c

Please sign in to comment.