Skip to content

Commit

Permalink
fix: change webhook optional/required fields (#82)
Browse files Browse the repository at this point in the history
* fix: fix webhook optional fields

* fix: update webhook optional fields

* chore: update sum file

* fix: update acc test cases
  • Loading branch information
Nacho Anaya authored Oct 19, 2021
1 parent bd3e0ae commit a50adad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions checkly/resource_alert_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func resourceAlertChannel() *schema.Resource {
},
AcFieldWebhookMethod: {
Type: schema.TypeString,
Required: true,
Optional: true,
},
AcFieldWebhookHeaders: {
Type: schema.TypeMap,
Expand All @@ -137,7 +137,7 @@ func resourceAlertChannel() *schema.Resource {
},
AcFieldWebhookURL: {
Type: schema.TypeString,
Optional: true,
Required: true,
},
AcFieldWebhookSecret: {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion checkly/resource_alert_channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestAccFail(t *testing.T) {
webhook {
}
}`,
Error: `The argument "method" is required`,
Error: `The argument "url" is required`,
},
{
Config: `resource "checkly_alert_channel" "t1" {
Expand Down
6 changes: 3 additions & 3 deletions docs/resources/alert-channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ resource "checkly_check_group" "test-group1" {
### Argument Reference for Webhook Alert Channel
* `webhook` (Optional)
* `name` (Required) Webhook's channel name.
* `method` (Required).
* `url` (Required).
* `method` (Optional) Default is `POST`.
* `headers` (Optional).
* `query_parameters` (Optional).
* `template` (Optional).
* `url` (Required).
* `query_parameters` (Optional).
* `webhook_secret` (Optional).
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/aws/aws-sdk-go v1.31.11 // indirect
github.com/checkly/checkly-go-sdk v1.3.0
github.com/checkly/checkly-go-sdk v1.3.1
github.com/fatih/color v1.9.0 // indirect
github.com/google/go-cmp v0.5.0
github.com/gruntwork-io/terratest v0.18.3
Expand All @@ -24,3 +24,4 @@ require (
github.com/zclconf/go-cty v1.4.2 // indirect
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
)

2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ github.com/checkly/checkly-go-sdk v1.1.0 h1:a28JXarOuR6wQ8OO9I3p6puAnIvxjM+2XKsZ
github.com/checkly/checkly-go-sdk v1.1.0/go.mod h1:wkAoXD2cVCNQEXi9lHZqy/zONIAZc5D9frih6Gas3Rs=
github.com/checkly/checkly-go-sdk v1.3.0 h1:eDaohYTyrjkPEWRmf3vDmzYseRE5Vek2i2r5yBzup7w=
github.com/checkly/checkly-go-sdk v1.3.0/go.mod h1:wkAoXD2cVCNQEXi9lHZqy/zONIAZc5D9frih6Gas3Rs=
github.com/checkly/checkly-go-sdk v1.3.1 h1:0ltTCmo3qGqbh457XcA8vhuSOLdzQ3vOpznz00A7SlY=
github.com/checkly/checkly-go-sdk v1.3.1/go.mod h1:wkAoXD2cVCNQEXi9lHZqy/zONIAZc5D9frih6Gas3Rs=
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
Expand Down

0 comments on commit a50adad

Please sign in to comment.