diff --git a/docs/data-sources/integration.md b/docs/data-sources/integration.md index f61735c..0c26eea 100644 --- a/docs/data-sources/integration.md +++ b/docs/data-sources/integration.md @@ -10,7 +10,22 @@ description: |- +## Example Usage +```terraform +data "statusflare_integration" "example" { + name = "example-integration-name" +} + +resource "statusflare_monitor" "example" { + name = "Example monitor" + url = "www.example.com" + + integrations = [ + data.statusflare_integration.example.id + ] +} +``` ## Schema diff --git a/docs/index.md b/docs/index.md index 95974d8..b5ee4a7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,8 +16,8 @@ description: |- terraform { required_providers { statusflare = { - version = "~> 1.0" - source = "statusflare.com/statusflare/statusflare" + version = "~> 0.1" + source = "statusflare-com/statusflare" } } } diff --git a/docs/resources/integration.md b/docs/resources/integration.md index 68bfcb1..d219bc7 100644 --- a/docs/resources/integration.md +++ b/docs/resources/integration.md @@ -10,7 +10,15 @@ description: |- - +## Example Usage + +```terraform +resource "statusflare_integration" "example" { + name = "example-integration-name" + type = "webhook" + secret = "https://webhook.example.com" +} +``` ## Schema diff --git a/docs/resources/monitor.md b/docs/resources/monitor.md index aa90bb1..66558b3 100644 --- a/docs/resources/monitor.md +++ b/docs/resources/monitor.md @@ -10,7 +10,18 @@ description: |- +## Example Usage +```terraform +resource "statusflare_monitor" "example" { + name = "Example monitor" + url = "www.example.com" + + integrations = [ + data.statusflare_integration.slack.id + ] +} +``` ## Schema diff --git a/examples/data-sources/statusflare_integration/data-source.tf b/examples/data-sources/statusflare_integration/data-source.tf new file mode 100644 index 0000000..3bd0051 --- /dev/null +++ b/examples/data-sources/statusflare_integration/data-source.tf @@ -0,0 +1,12 @@ +data "statusflare_integration" "example" { + name = "example-integration-name" +} + +resource "statusflare_monitor" "example" { + name = "Example monitor" + url = "www.example.com" + + integrations = [ + data.statusflare_integration.example.id + ] +} diff --git a/examples/main.tf b/examples/main.tf deleted file mode 100644 index 2bb16fa..0000000 --- a/examples/main.tf +++ /dev/null @@ -1,23 +0,0 @@ -terraform { - required_providers { - statusflare = { - version = "~> 1.0" - source = "statusflare.com/statusflare/statusflare" - } - } -} - -provider "statusflare" { -} - -data "statusflare_integration" "slack" { - name = "some-slack-integration" -} - -resource "statusflare_monitor" "first" { - name = "hello-world" - url = "www.helloworld.com" - integrations = [ - data.statusflare_integration.slack.id - ] -} diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 026a862..6817def 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,8 +1,8 @@ terraform { required_providers { statusflare = { - version = "~> 1.0" - source = "statusflare.com/statusflare/statusflare" + version = "~> 0.1" + source = "statusflare-com/statusflare" } } } @@ -12,5 +12,3 @@ provider "statusflare" { key_id = "..." token = "***" } - - diff --git a/examples/resources/statusflare_integration/resource.tf b/examples/resources/statusflare_integration/resource.tf new file mode 100644 index 0000000..93a5576 --- /dev/null +++ b/examples/resources/statusflare_integration/resource.tf @@ -0,0 +1,5 @@ +resource "statusflare_integration" "example" { + name = "example-integration-name" + type = "webhook" + secret = "https://webhook.example.com" +} diff --git a/examples/resources/statusflare_monitor/resource.tf b/examples/resources/statusflare_monitor/resource.tf new file mode 100644 index 0000000..83c5d40 --- /dev/null +++ b/examples/resources/statusflare_monitor/resource.tf @@ -0,0 +1,8 @@ +resource "statusflare_monitor" "example" { + name = "Example monitor" + url = "www.example.com" + + integrations = [ + data.statusflare_integration.slack.id + ] +}