Skip to content

Commit a50adad

Browse files
author
Nacho Anaya
authored
fix: change webhook optional/required fields (#82)
* fix: fix webhook optional fields * fix: update webhook optional fields * chore: update sum file * fix: update acc test cases
1 parent bd3e0ae commit a50adad

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

checkly/resource_alert_channel.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func resourceAlertChannel() *schema.Resource {
113113
},
114114
AcFieldWebhookMethod: {
115115
Type: schema.TypeString,
116-
Required: true,
116+
Optional: true,
117117
},
118118
AcFieldWebhookHeaders: {
119119
Type: schema.TypeMap,
@@ -137,7 +137,7 @@ func resourceAlertChannel() *schema.Resource {
137137
},
138138
AcFieldWebhookURL: {
139139
Type: schema.TypeString,
140-
Optional: true,
140+
Required: true,
141141
},
142142
AcFieldWebhookSecret: {
143143
Type: schema.TypeString,

checkly/resource_alert_channel_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func TestAccFail(t *testing.T) {
158158
webhook {
159159
}
160160
}`,
161-
Error: `The argument "method" is required`,
161+
Error: `The argument "url" is required`,
162162
},
163163
{
164164
Config: `resource "checkly_alert_channel" "t1" {

docs/resources/alert-channel.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ resource "checkly_check_group" "test-group1" {
143143
### Argument Reference for Webhook Alert Channel
144144
* `webhook` (Optional)
145145
* `name` (Required) Webhook's channel name.
146-
* `method` (Required).
146+
* `url` (Required).
147+
* `method` (Optional) Default is `POST`.
147148
* `headers` (Optional).
148-
* `query_parameters` (Optional).
149149
* `template` (Optional).
150-
* `url` (Required).
150+
* `query_parameters` (Optional).
151151
* `webhook_secret` (Optional).

go.mod

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.14
55
require (
66
github.com/agext/levenshtein v1.2.3 // indirect
77
github.com/aws/aws-sdk-go v1.31.11 // indirect
8-
github.com/checkly/checkly-go-sdk v1.3.0
8+
github.com/checkly/checkly-go-sdk v1.3.1
99
github.com/fatih/color v1.9.0 // indirect
1010
github.com/google/go-cmp v0.5.0
1111
github.com/gruntwork-io/terratest v0.18.3
@@ -24,3 +24,4 @@ require (
2424
github.com/zclconf/go-cty v1.4.2 // indirect
2525
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
2626
)
27+

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ github.com/checkly/checkly-go-sdk v1.1.0 h1:a28JXarOuR6wQ8OO9I3p6puAnIvxjM+2XKsZ
6060
github.com/checkly/checkly-go-sdk v1.1.0/go.mod h1:wkAoXD2cVCNQEXi9lHZqy/zONIAZc5D9frih6Gas3Rs=
6161
github.com/checkly/checkly-go-sdk v1.3.0 h1:eDaohYTyrjkPEWRmf3vDmzYseRE5Vek2i2r5yBzup7w=
6262
github.com/checkly/checkly-go-sdk v1.3.0/go.mod h1:wkAoXD2cVCNQEXi9lHZqy/zONIAZc5D9frih6Gas3Rs=
63+
github.com/checkly/checkly-go-sdk v1.3.1 h1:0ltTCmo3qGqbh457XcA8vhuSOLdzQ3vOpznz00A7SlY=
64+
github.com/checkly/checkly-go-sdk v1.3.1/go.mod h1:wkAoXD2cVCNQEXi9lHZqy/zONIAZc5D9frih6Gas3Rs=
6365
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
6466
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
6567
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=

0 commit comments

Comments
 (0)