diff --git a/builtin/providers/statuscake/resource_statuscaketest.go b/builtin/providers/statuscake/resource_statuscaketest.go index 6c340d869..0cdc76d8e 100644 --- a/builtin/providers/statuscake/resource_statuscaketest.go +++ b/builtin/providers/statuscake/resource_statuscaketest.go @@ -33,6 +33,11 @@ func resourceStatusCakeTest() *schema.Resource { Required: true, }, + "contact_id": &schema.Schema{ + Type: schema.TypeInt, + Optional: true, + }, + "check_rate": &schema.Schema{ Type: schema.TypeInt, Optional: true, @@ -53,10 +58,6 @@ func resourceStatusCakeTest() *schema.Resource { Type: schema.TypeInt, Computed: true, }, - "contact_id": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, "confirmations": &schema.Schema{ Type: schema.TypeInt, Optional: true, @@ -161,6 +162,9 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test { if v, ok := d.GetOk("check_rate"); ok { test.CheckRate = v.(int) } + if v, ok := d.GetOk("contact_id"); ok { + test.ContactID = v.(int) + } if v, ok := d.GetOk("test_type"); ok { test.TestType = v.(string) } diff --git a/website/source/docs/providers/statuscake/index.html.markdown b/website/source/docs/providers/statuscake/index.html.markdown index 150b36aad..443e892d6 100644 --- a/website/source/docs/providers/statuscake/index.html.markdown +++ b/website/source/docs/providers/statuscake/index.html.markdown @@ -34,5 +34,6 @@ resource "statuscake_test" "google" { website_url = "www.google.com" test_type = "HTTP" check_rate = 300 + contact_id = 12345 } ``` diff --git a/website/source/docs/providers/statuscake/r/test.html.markdown b/website/source/docs/providers/statuscake/r/test.html.markdown index b3cf174f7..b566b0e8e 100644 --- a/website/source/docs/providers/statuscake/r/test.html.markdown +++ b/website/source/docs/providers/statuscake/r/test.html.markdown @@ -8,7 +8,7 @@ description: |- # statuscake\_test -The test resource allows StatusCake tests to be managed by Terraform. +The test resource allows StatusCake tests to be managed by Terraform. ## Example Usage @@ -18,6 +18,7 @@ resource "statuscake_test" "google" { website_url = "www.google.com" test_type = "HTTP" check_rate = 300 + contact_id = 12345 } ``` @@ -26,9 +27,10 @@ resource "statuscake_test" "google" { The following arguments are supported: * `website_name` - (Required) This is the name of the test and the website to be monitored. -* `website_url` - (Required) The URL of the website to be monitored. -* `check_rate` - (Optional) Test check rate in seconds. Defaults to 300. -* `test_type` - (Required) The type of Test. Either HTTP or TCP. +* `website_url` - (Required) The URL of the website to be monitored +* `check_rate` - (Optional) Test check rate in seconds. Defaults to 300 +* `contact_id` - (Optional) The id of the contact group to be add to the test. Each test can have only one. +* `test_type` - (Required) The type of Test. Either HTTP or TCP * `paused` - (Optional) Whether or not the test is paused. Defaults to false. * `timeout` - (Optional) The timeout of the test in seconds. * `contact_id` - (Optional) The ID of the contact group to associate with the test. @@ -39,4 +41,4 @@ The following arguments are supported: The following attribute is exported: -* `test_id` - A unique identifier for the test. \ No newline at end of file +* `test_id` - A unique identifier for the test.