Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply default value for status codes #157

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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