diff --git a/docs/resources/contact_group.md b/docs/resources/contact_group.md index 1fe575b4..fd069868 100644 --- a/docs/resources/contact_group.md +++ b/docs/resources/contact_group.md @@ -48,8 +48,8 @@ output "operations_team_contact_group_id" { ## Import -Contact groups can be imported using the contact group `id`, e.g. +Import is supported using the following syntax: -``` -$ terraform import statuscake_contact_group.operations_team 1234 +```shell +terraform import statuscake_contact_group.operations_team 1234 ``` diff --git a/docs/resources/heartbeat_check.md b/docs/resources/heartbeat_check.md index 8c027e9a..4385e7cf 100644 --- a/docs/resources/heartbeat_check.md +++ b/docs/resources/heartbeat_check.md @@ -10,7 +10,30 @@ description: |- +## Example Usage +```terraform +resource "statuscake_uptime_check" "example" { + name = "Example" + period = 1800 + + contact_groups = [ + statuscake_contact_group.operations_team.id + ] + + tags = [ + "production", + ] +} + +output "example_heartbeat_check_id" { + value = statuscake_heartbeat_check.example.id +} + +output "example_heartbeat_check_url" { + value = statuscake_heartbeat_check.example.check_url +} +``` ## Schema @@ -41,8 +64,8 @@ Optional: ## Import -Heartbeat checks can be imported using the check `id`, e.g. +Import is supported using the following syntax: -``` -$ terraform import statuscake_heartbeat_check.example_com 1234 +```shell +terraform import statuscake_heartbeat_check.example_com 1234 ``` diff --git a/docs/resources/maintenance_window.md b/docs/resources/maintenance_window.md index b0df5083..fbb1a509 100644 --- a/docs/resources/maintenance_window.md +++ b/docs/resources/maintenance_window.md @@ -14,12 +14,11 @@ description: |- ```terraform resource "statuscake_maintenance_window" "weekends" { - name = "Weekends" - timezone = "UTC" - - start = "2022-01-29T00:00:00Z" end = "2022-01-30T23:59:59Z" + name = "Weekends" repeat_interval = "1w" + start = "2022-01-29T00:00:00Z" + timezone = "UTC" tags = [ "production" @@ -53,8 +52,8 @@ resource "statuscake_maintenance_window" "weekends" { ## Import -Maintenance windows can be imported using the maintenance window `id`, e.g. +Import is supported using the following syntax: -``` -$ terraform import statuscake_maintenance_window.weekends 1234 +```shell +terraform import statuscake_maintenance_window.weekends 1234 ``` diff --git a/docs/resources/pagespeed_check.md b/docs/resources/pagespeed_check.md index f717652a..7ba2fcc3 100644 --- a/docs/resources/pagespeed_check.md +++ b/docs/resources/pagespeed_check.md @@ -14,18 +14,18 @@ description: |- ```terraform resource "statuscake_pagespeed_check" "example_com" { - name = "Example" check_interval = 300 + name = "Example" region = "UK" - contact_groups = [ - statuscake_contact_group.operations_team.id - ] - alert_config { alert_bigger = "5000" } + contact_groups = [ + statuscake_contact_group.operations_team.id + ] + monitored_resource { address = "https://www.example.com" } @@ -76,8 +76,8 @@ Required: ## Import -Pagespeed checks can be imported using the check `id`, e.g. +Import is supported using the following syntax: -``` -$ terraform import statuscake_pagespeed_check.example_com 1234 +```shell +terraform import statuscake_pagespeed_check.example_com 1234 ``` diff --git a/docs/resources/ssl_check.md b/docs/resources/ssl_check.md index a17b2b2c..05f30485 100644 --- a/docs/resources/ssl_check.md +++ b/docs/resources/ssl_check.md @@ -17,19 +17,18 @@ resource "statuscake_ssl_check" "example_com" { check_interval = 600 user_agent = "terraform managed SSL check" - contact_groups = [ - statuscake_contact_group.operations_team.id - ] - alert_config { - alert_at = [7, 14, 21] - - on_reminder = true - on_expiry = true + alert_at = [7, 14, 21] on_broken = false + on_expiry = true on_mixed = false + on_reminder = true } + contact_groups = [ + statuscake_contact_group.operations_team.id + ] + monitored_resource { address = "https://www.example.com" } @@ -88,8 +87,8 @@ Optional: ## Import -SSL checks can be imported using the check `id`, e.g. +Import is supported using the following syntax: -``` -$ terraform import statuscake_ssl_check.example_com 1234 +```shell +terraform import statuscake_ssl_check.example_com 1234 ``` diff --git a/docs/resources/uptime_check.md b/docs/resources/uptime_check.md index 87723a73..b9e201aa 100644 --- a/docs/resources/uptime_check.md +++ b/docs/resources/uptime_check.md @@ -14,9 +14,9 @@ description: |- ```terraform resource "statuscake_uptime_check" "example_com" { - name = "Example" check_interval = 30 confirmation = 3 + name = "Example" trigger_rate = 10 contact_groups = [ @@ -31,8 +31,8 @@ resource "statuscake_uptime_check" "example_com" { validate_ssl = true basic_authentication { - username = "username" password = "password" + username = "username" } content_matchers { @@ -213,8 +213,8 @@ Read-Only: ## Import -Uptime checks can be imported using the check `id`, e.g. +Import is supported using the following syntax: -``` -$ terraform import statuscake_uptime_check.example_com 1234 +```shell +terraform import statuscake_uptime_check.example_com 1234 ``` diff --git a/examples/resources/statuscake_contact_group/import.sh b/examples/resources/statuscake_contact_group/import.sh new file mode 100644 index 00000000..9da2986a --- /dev/null +++ b/examples/resources/statuscake_contact_group/import.sh @@ -0,0 +1 @@ +terraform import statuscake_contact_group.operations_team 1234 diff --git a/examples/resources/statuscake_heartbeat_check/import.sh b/examples/resources/statuscake_heartbeat_check/import.sh new file mode 100644 index 00000000..e6898be1 --- /dev/null +++ b/examples/resources/statuscake_heartbeat_check/import.sh @@ -0,0 +1 @@ +terraform import statuscake_heartbeat_check.example_com 1234 diff --git a/examples/resources/statuscake_maintenance_window/import.sh b/examples/resources/statuscake_maintenance_window/import.sh new file mode 100644 index 00000000..8ba40c81 --- /dev/null +++ b/examples/resources/statuscake_maintenance_window/import.sh @@ -0,0 +1 @@ +terraform import statuscake_maintenance_window.weekends 1234 diff --git a/examples/resources/statuscake_maintenance_window/resource.tf b/examples/resources/statuscake_maintenance_window/resource.tf index de41813d..dba44530 100644 --- a/examples/resources/statuscake_maintenance_window/resource.tf +++ b/examples/resources/statuscake_maintenance_window/resource.tf @@ -1,10 +1,9 @@ resource "statuscake_maintenance_window" "weekends" { - name = "Weekends" - timezone = "UTC" - - start = "2022-01-29T00:00:00Z" end = "2022-01-30T23:59:59Z" + name = "Weekends" repeat_interval = "1w" + start = "2022-01-29T00:00:00Z" + timezone = "UTC" tags = [ "production" diff --git a/examples/resources/statuscake_pagespeed_check/import.sh b/examples/resources/statuscake_pagespeed_check/import.sh new file mode 100644 index 00000000..2222e507 --- /dev/null +++ b/examples/resources/statuscake_pagespeed_check/import.sh @@ -0,0 +1 @@ +terraform import statuscake_pagespeed_check.example_com 1234 diff --git a/examples/resources/statuscake_pagespeed_check/resource.tf b/examples/resources/statuscake_pagespeed_check/resource.tf index 60134f86..01a78b4c 100644 --- a/examples/resources/statuscake_pagespeed_check/resource.tf +++ b/examples/resources/statuscake_pagespeed_check/resource.tf @@ -1,16 +1,16 @@ resource "statuscake_pagespeed_check" "example_com" { - name = "Example" check_interval = 300 + name = "Example" region = "UK" - contact_groups = [ - statuscake_contact_group.operations_team.id - ] - alert_config { alert_bigger = "5000" } + contact_groups = [ + statuscake_contact_group.operations_team.id + ] + monitored_resource { address = "https://www.example.com" } diff --git a/examples/resources/statuscake_ssl_check/import.sh b/examples/resources/statuscake_ssl_check/import.sh new file mode 100644 index 00000000..60040d40 --- /dev/null +++ b/examples/resources/statuscake_ssl_check/import.sh @@ -0,0 +1 @@ +terraform import statuscake_ssl_check.example_com 1234 diff --git a/examples/resources/statuscake_ssl_check/resource.tf b/examples/resources/statuscake_ssl_check/resource.tf index d63b9e44..9b681b0f 100644 --- a/examples/resources/statuscake_ssl_check/resource.tf +++ b/examples/resources/statuscake_ssl_check/resource.tf @@ -2,19 +2,18 @@ resource "statuscake_ssl_check" "example_com" { check_interval = 600 user_agent = "terraform managed SSL check" - contact_groups = [ - statuscake_contact_group.operations_team.id - ] - alert_config { - alert_at = [7, 14, 21] - - on_reminder = true - on_expiry = true + alert_at = [7, 14, 21] on_broken = false + on_expiry = true on_mixed = false + on_reminder = true } + contact_groups = [ + statuscake_contact_group.operations_team.id + ] + monitored_resource { address = "https://www.example.com" } diff --git a/examples/resources/statuscake_uptime_check/import.sh b/examples/resources/statuscake_uptime_check/import.sh new file mode 100644 index 00000000..92b884ec --- /dev/null +++ b/examples/resources/statuscake_uptime_check/import.sh @@ -0,0 +1 @@ +terraform import statuscake_uptime_check.example_com 1234 diff --git a/examples/resources/statuscake_uptime_check/resource.tf b/examples/resources/statuscake_uptime_check/resource.tf index 3e65db86..a328ad1c 100644 --- a/examples/resources/statuscake_uptime_check/resource.tf +++ b/examples/resources/statuscake_uptime_check/resource.tf @@ -1,7 +1,7 @@ resource "statuscake_uptime_check" "example_com" { - name = "Example" check_interval = 30 confirmation = 3 + name = "Example" trigger_rate = 10 contact_groups = [ @@ -16,8 +16,8 @@ resource "statuscake_uptime_check" "example_com" { validate_ssl = true basic_authentication { - username = "username" password = "password" + username = "username" } content_matchers {