From 0a0ab608456bf76cc3c72a45f2839d1c2f8fc60d Mon Sep 17 00:00:00 2001 From: Topper Date: Fri, 15 Mar 2024 16:45:49 +0000 Subject: [PATCH 1/2] add the tf generated docs --- docs/data-sources/dataset.md | 25 +++++++++ docs/data-sources/monitor.md | 33 ++++++++++++ docs/data-sources/notifier.md | 96 +++++++++++++++++++++++++++++++++++ docs/data-sources/user.md | 26 ++++++++++ docs/index.md | 25 +++++++++ docs/resources/dataset.md | 28 ++++++++++ docs/resources/monitor.md | 36 +++++++++++++ docs/resources/notifier.md | 96 +++++++++++++++++++++++++++++++++++ docs/resources/user.md | 26 ++++++++++ 9 files changed, 391 insertions(+) create mode 100644 docs/data-sources/dataset.md create mode 100644 docs/data-sources/monitor.md create mode 100644 docs/data-sources/notifier.md create mode 100644 docs/data-sources/user.md create mode 100644 docs/index.md create mode 100644 docs/resources/dataset.md create mode 100644 docs/resources/monitor.md create mode 100644 docs/resources/notifier.md create mode 100644 docs/resources/user.md diff --git a/docs/data-sources/dataset.md b/docs/data-sources/dataset.md new file mode 100644 index 0000000..e27a431 --- /dev/null +++ b/docs/data-sources/dataset.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_dataset Data Source - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_dataset (Data Source) + + + + + + +## Schema + +### Required + +- `id` (String) Dataset identifier + +### Read-Only + +- `description` (String) Dataset description +- `name` (String) Dataset name diff --git a/docs/data-sources/monitor.md b/docs/data-sources/monitor.md new file mode 100644 index 0000000..3a2dbdb --- /dev/null +++ b/docs/data-sources/monitor.md @@ -0,0 +1,33 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_monitor Data Source - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_monitor (Data Source) + + + + + + +## Schema + +### Required + +- `id` (String) Monitor identifier + +### Read-Only + +- `alert_on_no_data` (Boolean) If the monitor should trigger an alert if there is no data +- `apl_query` (String) The query used inside the monitor +- `description` (String) Monitor description +- `disabled_until` (String) The time the monitor will be disabled until +- `interval_minutes` (Number) How often the monitor should run +- `name` (String) Monitor name +- `notifier_ids` (List of String) A list of notifier id's to be used when this monitor triggers +- `operator` (String) Operator used in monitor trigger evaluation +- `range_minutes` (Number) Query time range from now +- `threshold` (Number) The threshold where the monitor should trigger diff --git a/docs/data-sources/notifier.md b/docs/data-sources/notifier.md new file mode 100644 index 0000000..1ced73b --- /dev/null +++ b/docs/data-sources/notifier.md @@ -0,0 +1,96 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_notifier Data Source - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_notifier (Data Source) + + + + + + +## Schema + +### Required + +- `id` (String) Notifier identifier + +### Read-Only + +- `name` (String) Notifier name +- `properties` (Attributes) The properties of the notifier (see [below for nested schema](#nestedatt--properties)) + + +### Nested Schema for `properties` + +Read-Only: + +- `discord` (Attributes) (see [below for nested schema](#nestedatt--properties--discord)) +- `discord_webhook` (Attributes) (see [below for nested schema](#nestedatt--properties--discord_webhook)) +- `email` (Attributes) (see [below for nested schema](#nestedatt--properties--email)) +- `opsgenie` (Attributes) (see [below for nested schema](#nestedatt--properties--opsgenie)) +- `pagerduty` (Attributes) (see [below for nested schema](#nestedatt--properties--pagerduty)) +- `slack` (Attributes) (see [below for nested schema](#nestedatt--properties--slack)) +- `webhook` (Attributes) (see [below for nested schema](#nestedatt--properties--webhook)) + + +### Nested Schema for `properties.discord` + +Read-Only: + +- `discord_channel` (String) The discord channel +- `discord_token` (String) The discord token + + + +### Nested Schema for `properties.discord_webhook` + +Read-Only: + +- `discord_webhook_url` (String) The discord webhook URL + + + +### Nested Schema for `properties.email` + +Read-Only: + +- `emails` (List of String) The emails to be notified + + + +### Nested Schema for `properties.opsgenie` + +Read-Only: + +- `api_key` (String) The opsgenie API key +- `is_eu` (Boolean) The opsgenie is EU + + + +### Nested Schema for `properties.pagerduty` + +Read-Only: + +- `routing_key` (String) The pagerduty routing key +- `token` (String) The pager duty token + + + +### Nested Schema for `properties.slack` + +Read-Only: + +- `slack_url` (String) The slack URL + + + +### Nested Schema for `properties.webhook` + +Read-Only: + +- `url` (String) The webhook URL diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md new file mode 100644 index 0000000..e90b4f7 --- /dev/null +++ b/docs/data-sources/user.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_user Data Source - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_user (Data Source) + + + + + + +## Schema + +### Required + +- `id` (String) Users identifier + +### Read-Only + +- `email` (String) Users email +- `name` (String) Users name +- `role` (String) Users role diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..a276477 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,25 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom Provider" +subcategory: "" +description: |- + +--- + +# axiom Provider + + + + + + +## Schema + +### Required + +- `api_token` (String) The Axiom API token. +- `org_id` (String) The Axiom organization ID. + +### Optional + +- `base_url` (String) The base url of the axiom api. diff --git a/docs/resources/dataset.md b/docs/resources/dataset.md new file mode 100644 index 0000000..80db5b5 --- /dev/null +++ b/docs/resources/dataset.md @@ -0,0 +1,28 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_dataset Resource - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_dataset (Resource) + + + + + + +## Schema + +### Required + +- `name` (String) Dataset name + +### Optional + +- `description` (String) Dataset description + +### Read-Only + +- `id` (String) Dataset identifier diff --git a/docs/resources/monitor.md b/docs/resources/monitor.md new file mode 100644 index 0000000..c8855bf --- /dev/null +++ b/docs/resources/monitor.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_monitor Resource - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_monitor (Resource) + + + + + + +## Schema + +### Required + +- `alert_on_no_data` (Boolean) If the monitor should trigger an alert if there is no data +- `apl_query` (String) The query used inside the monitor +- `interval_minutes` (Number) How often the monitor should run +- `name` (String) Monitor name +- `operator` (String) Operator used in monitor trigger evaluation +- `range_minutes` (Number) Query time range from now +- `threshold` (Number) The threshold where the monitor should trigger + +### Optional + +- `description` (String) Monitor description +- `disabled_until` (String) The time the monitor will be disabled until +- `notifier_ids` (List of String) A list of notifier id's to be used when this monitor triggers + +### Read-Only + +- `id` (String) Monitor identifier diff --git a/docs/resources/notifier.md b/docs/resources/notifier.md new file mode 100644 index 0000000..8091556 --- /dev/null +++ b/docs/resources/notifier.md @@ -0,0 +1,96 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_notifier Resource - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_notifier (Resource) + + + + + + +## Schema + +### Required + +- `name` (String) Notifier name +- `properties` (Attributes) The properties of the notifier (see [below for nested schema](#nestedatt--properties)) + +### Read-Only + +- `id` (String) Notifier identifier + + +### Nested Schema for `properties` + +Optional: + +- `discord` (Attributes) (see [below for nested schema](#nestedatt--properties--discord)) +- `discord_webhook` (Attributes) (see [below for nested schema](#nestedatt--properties--discord_webhook)) +- `email` (Attributes) (see [below for nested schema](#nestedatt--properties--email)) +- `opsgenie` (Attributes) (see [below for nested schema](#nestedatt--properties--opsgenie)) +- `pagerduty` (Attributes) (see [below for nested schema](#nestedatt--properties--pagerduty)) +- `slack` (Attributes) (see [below for nested schema](#nestedatt--properties--slack)) +- `webhook` (Attributes) (see [below for nested schema](#nestedatt--properties--webhook)) + + +### Nested Schema for `properties.discord` + +Required: + +- `discord_channel` (String) The discord channel +- `discord_token` (String) The discord token + + + +### Nested Schema for `properties.discord_webhook` + +Required: + +- `discord_webhook_url` (String) The discord webhook URL + + + +### Nested Schema for `properties.email` + +Required: + +- `emails` (List of String) The emails to be notified + + + +### Nested Schema for `properties.opsgenie` + +Required: + +- `api_key` (String) The opsgenie API key +- `is_eu` (Boolean) The opsgenie is EU + + + +### Nested Schema for `properties.pagerduty` + +Required: + +- `routing_key` (String) The pagerduty routing key +- `token` (String) The pager duty token + + + +### Nested Schema for `properties.slack` + +Required: + +- `slack_url` (String) The slack URL + + + +### Nested Schema for `properties.webhook` + +Required: + +- `url` (String) The webhook URL diff --git a/docs/resources/user.md b/docs/resources/user.md new file mode 100644 index 0000000..ed03a71 --- /dev/null +++ b/docs/resources/user.md @@ -0,0 +1,26 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "axiom_user Resource - terraform-provider-axiom" +subcategory: "" +description: |- + +--- + +# axiom_user (Resource) + + + + + + +## Schema + +### Required + +- `email` (String) Users email +- `name` (String) Users name +- `role` (String) Users role + +### Read-Only + +- `id` (String) Users identifier From cd14d0b09488412d2af378ab538465debc21a9c7 Mon Sep 17 00:00:00 2001 From: Topper Date: Tue, 2 Apr 2024 18:34:51 +0100 Subject: [PATCH 2/2] add the example to the docs --- docs/index.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/docs/index.md b/docs/index.md index a276477..81fc7e5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,3 +23,68 @@ description: |- ### Optional - `base_url` (String) The base url of the axiom api. + +# Example +```terraform +terraform { + required_providers { + axiom = { + source = "axiomhq/axiom" + version = "1.0" + } + } +} + +provider "axiom" { + api_token = "" + org_id = "" + base_url = "https://api.axiom.co" +} + +// create a dataset resource with name and description +resource "axiom_dataset" "testing_dataset" { + name = "created_via_terraform" + description = "testing datasets using tf" +} + +resource "axiom_notifier" "slack_test" { + name = "slack_test" + properties = { + slack = { + slack_url = "https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE" + } + # discord = { + # discord_channel = "https://discord.com/api/webhooks/EXAMPLE/EXAMPLE/EXAMPLE" + # discord_token = "EXAMPLE" + # } + # email= { + # emails = ["test","test2"] + # } + } +} + +resource "axiom_monitor" "test_monitor" { + depends_on = [axiom_dataset.testing_dataset, axiom_notifier.slack_test] + name = "test monitor" + description = "test_monitor updated" + apl_query = <