diff --git a/checkly/resource_alert_channel.go b/checkly/resource_alert_channel.go index 0264e6c..f0f56e2 100644 --- a/checkly/resource_alert_channel.go +++ b/checkly/resource_alert_channel.go @@ -113,7 +113,7 @@ func resourceAlertChannel() *schema.Resource { }, AcFieldWebhookMethod: { Type: schema.TypeString, - Required: true, + Optional: true, }, AcFieldWebhookHeaders: { Type: schema.TypeMap, @@ -137,7 +137,7 @@ func resourceAlertChannel() *schema.Resource { }, AcFieldWebhookURL: { Type: schema.TypeString, - Optional: true, + Required: true, }, AcFieldWebhookSecret: { Type: schema.TypeString, diff --git a/checkly/resource_alert_channel_test.go b/checkly/resource_alert_channel_test.go index 7349113..01ed7bc 100644 --- a/checkly/resource_alert_channel_test.go +++ b/checkly/resource_alert_channel_test.go @@ -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" { diff --git a/docs/resources/alert-channel.md b/docs/resources/alert-channel.md index 56975d9..dd24458 100644 --- a/docs/resources/alert-channel.md +++ b/docs/resources/alert-channel.md @@ -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). diff --git a/go.mod b/go.mod index 631aefe..272b1e2 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -24,3 +24,4 @@ require ( github.com/zclconf/go-cty v1.4.2 // indirect golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect ) + diff --git a/go.sum b/go.sum index 43489ab..93fad1e 100644 --- a/go.sum +++ b/go.sum @@ -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=