Skip to content

Commit f6ac901

Browse files
committed
Merge branch 'statuscake_adding_contact_group' of https://github.com/ldjohnson/terraform into ldjohnson-statuscake_adding_contact_group
2 parents a53c827 + d203dcf commit f6ac901

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

builtin/providers/statuscake/resource_statuscaketest.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ func resourceStatusCakeTest() *schema.Resource {
3333
Required: true,
3434
},
3535

36+
"contact_id": &schema.Schema{
37+
Type: schema.TypeInt,
38+
Optional: true,
39+
},
40+
3641
"check_rate": &schema.Schema{
3742
Type: schema.TypeInt,
3843
Optional: true,
@@ -53,10 +58,6 @@ func resourceStatusCakeTest() *schema.Resource {
5358
Type: schema.TypeInt,
5459
Computed: true,
5560
},
56-
"contact_id": &schema.Schema{
57-
Type: schema.TypeInt,
58-
Optional: true,
59-
},
6061
"confirmations": &schema.Schema{
6162
Type: schema.TypeInt,
6263
Optional: true,
@@ -161,6 +162,9 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
161162
if v, ok := d.GetOk("check_rate"); ok {
162163
test.CheckRate = v.(int)
163164
}
165+
if v, ok := d.GetOk("contact_id"); ok {
166+
test.ContactID = v.(int)
167+
}
164168
if v, ok := d.GetOk("test_type"); ok {
165169
test.TestType = v.(string)
166170
}

website/source/docs/providers/statuscake/index.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ resource "statuscake_test" "google" {
3434
website_url = "www.google.com"
3535
test_type = "HTTP"
3636
check_rate = 300
37+
contact_id = 12345
3738
}
3839
```

website/source/docs/providers/statuscake/r/test.html.markdown

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: |-
88

99
# statuscake\_test
1010

11-
The test resource allows StatusCake tests to be managed by Terraform.
11+
The test resource allows StatusCake tests to be managed by Terraform.
1212

1313
## Example Usage
1414

@@ -18,6 +18,7 @@ resource "statuscake_test" "google" {
1818
website_url = "www.google.com"
1919
test_type = "HTTP"
2020
check_rate = 300
21+
contact_id = 12345
2122
}
2223
```
2324

@@ -26,9 +27,10 @@ resource "statuscake_test" "google" {
2627
The following arguments are supported:
2728

2829
* `website_name` - (Required) This is the name of the test and the website to be monitored.
29-
* `website_url` - (Required) The URL of the website to be monitored.
30-
* `check_rate` - (Optional) Test check rate in seconds. Defaults to 300.
31-
* `test_type` - (Required) The type of Test. Either HTTP or TCP.
30+
* `website_url` - (Required) The URL of the website to be monitored
31+
* `check_rate` - (Optional) Test check rate in seconds. Defaults to 300
32+
* `contact_id` - (Optional) The id of the contact group to be add to the test. Each test can have only one.
33+
* `test_type` - (Required) The type of Test. Either HTTP or TCP
3234
* `paused` - (Optional) Whether or not the test is paused. Defaults to false.
3335
* `timeout` - (Optional) The timeout of the test in seconds.
3436
* `contact_id` - (Optional) The ID of the contact group to associate with the test.
@@ -39,4 +41,4 @@ The following arguments are supported:
3941

4042
The following attribute is exported:
4143

42-
* `test_id` - A unique identifier for the test.
44+
* `test_id` - A unique identifier for the test.

0 commit comments

Comments
 (0)