diff --git a/.golangci.yml b/.golangci.yml index e1ddccd8..736ab4fe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -31,7 +31,7 @@ linters-settings: # Report about shadowed variables. check-shadowing: true lll: - line-length: 120 + line-length: 250 gocritic: enabled-tags: # - diagnostic diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md new file mode 100644 index 00000000..02a184c5 --- /dev/null +++ b/DOCUMENTATION.md @@ -0,0 +1,37 @@ +# Documentation + +[Official Terraform Provider Documentation](https://www.terraform.io/registry/providers/docs) + +This section provides all the information needed to work with `terraform-provider-nobl9` documentation. + +## Tool + +Documentation is created using the [tfplugindocs](https://github.com/hashicorp/terraform-plugin-docs) tool. + +## Which files should I change? + +- Update (if needed) templates available under `templates/` directory + - Each resource has a separate template file, ex. `templates/resources/slo.md.tmpl` + - We use generic templates for index and resource pages: `templates/index.md.tmpl` and `templates/resources.md.tmpl` + - Use Data Fields supported by tfplugindocs - https://github.com/hashicorp/terraform-plugin-docs +- Update (if needed) examples available under `examples/` directory + - Make sure that all examples are working with the latest version of the provider + - `examples/provider/provider.tf` is the example that will be rendered on the main page on [provider documentation](https://registry.terraform.io/providers/nobl9/nobl9/latest/docs#schema) + - `examples/resources//resource.tf` will be rendered for every resource on their documentation page, ex. https://registry.terraform.io/providers/nobl9/nobl9/latest/docs/resources/slo +- Update (if needed) `"description"` field for a resource, ex. in `nobl9/resource_slo.go`: +``` +Schema: map[string]*schema.Schema{ + ... + "description": "Your new description" + ... +} +``` + - This description will be rendered on the documentation page for the changed resource. +- Do not touch anything under `docs/` directory. + +## How to generate docs? + +You need to have [Go](https://go.dev/) installed on your machine, then run: +``` +go generate +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 3b4586d0..a3c139ea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,16 +1,36 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "nobl9 Provider" -subcategory: "" +page_title: "Nobl9 Provider" description: |- - + The Nobl9 provider provides utilities for working with Nobl9 API. --- -# nobl9 Provider +# NOBL9 Provider +There are many types of [resources](https://docs.nobl9.com/#using-resources-in-nobl9) in the Nobl9 platform. You can configure them via: +- UI (https://app.nobl9.com) +- [sloctl](https://docs.nobl9.com/sloctl-user-guide/) +- Nobl9 Terraform Provider +## Scope of Support -## Example Usage +The Nobl9 Provider delivers tools working with the Nobl9 API to create and manage the following resources: +- SLOs +- Services +- Projects +- Alert Policies +- Alert Methods +- Data Sources +- Role Bindings + +The Nobl9 Terraform Provider does not support the configuration of the following resources: +- [SLO Annotations](https://docs.nobl9.com/Features/SLO_Annotations/) +- [Alert Silence](https://docs.nobl9.com/Alert_Methods/Alert_silence/) + +## Configuration + +To start using Nobl9 Terraform Provider, you must configure the provider with the proper credentials. Then, use the navigation on the left to learn more about the available resources. + +The following is an exemplary configuration: ```terraform terraform { @@ -35,9 +55,9 @@ provider "nobl9" { ### Required -- `client_id` (String) Authentication parameter ClientID. -- `client_secret` (String, Sensitive) Authentication parameter ClientSecret. -- `organization` (String) Nobl9 Organization that contain resources managed by this provider. +- `client_id` (String) the [Client ID](https://docs.nobl9.com/sloctl-user-guide/#configuration) of your Nobl9 account required to connect to Nobl9. +- `client_secret` (String, Sensitive) the [Client Secret](https://docs.nobl9.com/sloctl-user-guide/#configuration) of your Nobl9 account required to connect to Nobl9. +- `organization` (String) Nobl9 [Organization ID](https://docs.nobl9.com/API_Documentation/api-endpoints-for-slo-annotations/#common-headers) that contains resources managed by the Nobl9 Terraform provider. - `project` (String) Nobl9 project used when importing resources. ### Optional @@ -45,3 +65,9 @@ provider "nobl9" { - `ingest_url` (String) Nobl9 API URL. - `okta_auth_server` (String) Authorization service configuration. - `okta_org_url` (String) Authorization service URL. + +## Useful Links + +[Nobl9 Documentation](https://docs.nobl9.com/) + +[Nobl9 Terraform Provider Release Notes](https://github.com/nobl9/terraform-provider-nobl9/releases) \ No newline at end of file diff --git a/docs/resources/agent.md b/docs/resources/agent.md index bd0cfed3..56378853 100644 --- a/docs/resources/agent.md +++ b/docs/resources/agent.md @@ -1,22 +1,24 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_agent Resource - terraform-provider-nobl9" -subcategory: "" description: |- - Agent configuration documentation https://docs.nobl9.com/nobl9_agent + Agent configuration | Nobl9 Documentation https://docs.nobl9.com/nobl9_agent --- # nobl9_agent (Resource) -[Agent configuration documentation](https://docs.nobl9.com/nobl9_agent) +The Agent is a lightweight application that executes the queries defined for your Nobl9 SLOs. Queries are written in the language supported by the data source in question and executed via native APIs. + +The Agent then sends your SLI metrics back to Nobl9 for processing and error budget calculation. + +For more information, refer to [Agent configuration | Nobl9 Documentation](https://docs.nobl9.com/nobl9_agent) ## Example Usage ```terraform resource "nobl9_project" "this" { - display_name = "Test Terraform" - name = "test-terraform" - description = "An example terraform project" + display_name = "Test N9 Terraform" + name = "test-n9-terraform" + description = "An example N9 Terraform project" } resource "nobl9_agent" "this" { @@ -35,9 +37,9 @@ resource "nobl9_agent" "this" { ### Required -- `agent_type` (String) Type of an agent. [Supported agent types](https://docs.nobl9.com/Sources/) -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `agent_type` (String) The type of the Agent. Check [Supported Agent types | Nobl9 Documentation](https://docs.nobl9.com/Sources/) +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - `source_of` (List of String) Source of Metrics and/or Services ### Optional @@ -47,8 +49,8 @@ resource "nobl9_agent" "this" { - `bigquery_config` (Block Set, Max: 1) [Configuration documentation](https://docs.nobl9.com/Sources/bigquery#bigquery-agent) (see [below for nested schema](#nestedblock--bigquery_config)) - `cloudwatch_config` (Block Set, Max: 1) [Configuration documentation](https://docs.nobl9.com/Sources/Amazon_CloudWatch/#cloudwatch-agent) (see [below for nested schema](#nestedblock--cloudwatch_config)) - `datadog_config` (Block Set, Max: 1) [Configuration documentation](https://docs.nobl9.com/Sources/datadog#datadog-agent) (see [below for nested schema](#nestedblock--datadog_config)) -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. - `dynatrace_config` (Block Set, Max: 1) [Configuration documentation](https://docs.nobl9.com/Sources/dynatrace#dynatrace-agent) (see [below for nested schema](#nestedblock--dynatrace_config)) - `elasticsearch_config` (Block Set, Max: 1) [Configuration documentation](https://docs.nobl9.com/Sources/elasticsearch#elasticsearch-agent) (see [below for nested schema](#nestedblock--elasticsearch_config)) - `gcm_config` (Block Set, Max: 1) [Configuration documentation](https://docs.nobl9.com/Sources/google-cloud-monitoring#google-cloud-monitoring-agent) (see [below for nested schema](#nestedblock--gcm_config)) @@ -70,14 +72,14 @@ resource "nobl9_agent" "this" { ### Read-Only - `id` (String) The ID of this resource. -- `status` (Map of String) Status of created agent. +- `status` (Map of String) Status of the created agent. ### Nested Schema for `amazon_prometheus_config` Required: -- `region` (String) AWS region ex. eu-central-1 +- `region` (String) AWS region e.g., eu-central-1 - `url` (String) Base URL to Amazon Prometheus server. @@ -86,7 +88,7 @@ Required: Required: -- `url` (String) Base URL to a AppDynamics Controller. +- `url` (String) Base URL to the AppDynamics Controller. @@ -102,7 +104,7 @@ Required: Required: -- `site` (String) `com` or `eu`, Datadog SaaS instance, which corresponds to one of their two locations (https://www.datadoghq.com/ in the U.S. or https://datadoghq.eu/ in the European Union) +- `site` (String) `com` or `eu`, Datadog SaaS instance, which corresponds to one of Datadog's two locations (https://www.datadoghq.com/ in the U.S. or https://datadoghq.eu/ in the European Union) @@ -118,7 +120,7 @@ Required: Required: -- `url` (String) API URL endpoint of Elasticsearch's instance. +- `url` (String) API URL endpoint to the Elasticsearch's instance. @@ -130,7 +132,7 @@ Required: Required: -- `url` (String) API URL endpoint of Grafana Loki instance. +- `url` (String) API URL endpoint to the Grafana Loki instance. @@ -138,7 +140,7 @@ Required: Required: -- `url` (String) API URL endpoint of Graphite's instance. +- `url` (String) API URL endpoint to the Graphite's instance. @@ -146,7 +148,7 @@ Required: Required: -- `url` (String) API URL endpoint of InfluxDB's instance. +- `url` (String) API URL endpoint to the InfluxDB's instance. @@ -154,7 +156,7 @@ Required: Required: -- `url` (String) API URL endpoint of InfluxDB's instance. +- `url` (String) API URL endpoint to the InfluxDB's instance. @@ -171,7 +173,7 @@ Required: Required: -- `account_id` (String) ID number assigned to the New Relic user account +- `account_id` (String) ID number assigned to the New Relic user account. @@ -203,7 +205,7 @@ Required: Required: -- `url` (String) Base API URL of the Splunk Search app. +- `url` (String) Base API URL to the Splunk Search app. @@ -219,10 +221,12 @@ Required: Required: -- `url` (String) Base API URL of the Splunk Search app. +- `url` (String) Base API URL to the Splunk Search app. ### Nested Schema for `thousandeyes_config` +## Nobl9 Official Documentation +https://docs.nobl9.com/ diff --git a/docs/resources/alert_method_discord.md b/docs/resources/alert_method_discord.md index 99f2091b..7f690acc 100644 --- a/docs/resources/alert_method_discord.md +++ b/docs/resources/alert_method_discord.md @@ -1,33 +1,50 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_discord Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/discord + Discord Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/discord --- # nobl9_alert_method_discord (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/discord) +The **Discord Alert Method** enables sending alerts through Discord to notify Nobl9 users whenever an incident is triggered. +For more details, refer to [Discord Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/discord). +## Example Usage + +Here's an example of Discord Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_discord" "this" { + name = "my-discord-alert" + display_name = "My Discord alert" + project = "My Discord alert" + description = "My Discord alert method" + url = "https://discord.webhook.url" +} +``` ## Schema ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `url` (String, Sensitive) Discord webhook endpoint URL. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `url` (String, Sensitive) Discord webhook endpoint URL. Refer to [Intro to webhooks | Discord documentation](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) for more details. ### Read-Only - `id` (String) The ID of this resource. +## Useful Links + +[Discord alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/discord/) +[Intro to webhooks | Discord Documentation](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) \ No newline at end of file diff --git a/docs/resources/alert_method_email.md b/docs/resources/alert_method_email.md index d3279848..6daed160 100644 --- a/docs/resources/alert_method_email.md +++ b/docs/resources/alert_method_email.md @@ -1,37 +1,56 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_email Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/email-alert + Email Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/email-alert --- # nobl9_alert_method_email (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/email-alert) +The **Email Alert Method** enables sending automated and customized alert messages to up to 30 different inboxes per alert to notify Nobl9 users whenever an incident is triggered. +For more details, refer to [Email Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/email-alert). +## Example Usage + +Here's an example of Email Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_email" "this" { + name = "my-email-alert" + display_name = "My Email Alert" + project = "My Project" + description = "teams" + to = [ "testUser@nobl9.com" ] + cc = [ "testUser@nobl9.com" ] + bcc = [ "testUser@nobl9.com" ] + subject = "Test email, please ignore" + body = "This is just a test email" +} +``` ## Schema ### Required -- `body` (String) Body of the email. For format and samples see documentation and nobl9 application. -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `subject` (String) Subject of the email. -- `to` (List of String) Recipients. +- `body` (String) The Body of the email alert. For the format of the body and the list of variables that you can define, refer to the [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/email-alert#yaml-configuration). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `subject` (String) The Subject of the email alert. +- `to` (List of String) Recipients. The maximum number of recipients is 10. ### Optional -- `bcc` (List of String) Blind carbon copy recipients. -- `cc` (List of String) Carbon copy recipients. -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `bcc` (List of String) Blind carbon copy recipients. The maximum number of recipients is 10. +- `cc` (List of String) Carbon copy recipients. The maximum number of recipients is 10. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. ### Read-Only - `id` (String) The ID of this resource. +## Useful links +[Email alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/email-alert) \ No newline at end of file diff --git a/docs/resources/alert_method_jira.md b/docs/resources/alert_method_jira.md index 252f131d..defeb414 100644 --- a/docs/resources/alert_method_jira.md +++ b/docs/resources/alert_method_jira.md @@ -1,36 +1,56 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_jira Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/jira + Jira Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/jira --- # nobl9_alert_method_jira (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/jira) +The **Jira Alert Method** automatically opens a Jira issue to notify you whenever an incident is triggered. +For more details, refer to [Jira Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/jira). +## Example Usage + +Here's an example of Jira Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_webhook" "this" { + name = "my-jira-alert" + display_name = "My Jira Alert" + project = "My Jira Project" + description = "My jira alert" + url = "https://jira.com" + username = "nobl9User" + apitoken = "secret_api_token" + project_key = "PC" +} +``` ## Schema ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project_key` (String) The code of the project. -- `url` (String) Jira instance URL. +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project_key` (String) The code of the Jira project. +- `url` (String) Jira instance URL. The `https://` prefix is required. - `username` (String) Jira username for the owner of the API Token. ### Optional -- `apitoken` (String, Sensitive) API Token with access rights to the project. -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `apitoken` (String, Sensitive) [API Token](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) with access rights to the project. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. ### Read-Only - `id` (String) The ID of this resource. +## Useful Links + +[Jira alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/jira/) +[Atlassian Accounts Documentation](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) \ No newline at end of file diff --git a/docs/resources/alert_method_msteams.md b/docs/resources/alert_method_msteams.md index 919fdf2b..d28c3bde 100644 --- a/docs/resources/alert_method_msteams.md +++ b/docs/resources/alert_method_msteams.md @@ -1,33 +1,50 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_msteams Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/ms-teams + MS Teams Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/ms-teams --- # nobl9_alert_method_msteams (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/ms-teams) +The **MS Teams Alert Method** enables sending alerts through MS Teams to notify Nobl9 users whenever an incident is triggered. +For more details, refer to [MS Teams Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/ms-teams). +## Example Usage + +Here's an example of MS Teams Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_webhook" "this" { + name = "ms-teams-alert" + display_name = "MS Teams Alert" + project = "Test Project" + description = "My MS Teams alerts" + url = "https://teams.com" +} +``` ## Schema ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `url` (String, Sensitive) MSTeams webhook endpoint URL. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `url` (String, Sensitive) MS Teams [webhook endpoint URL](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook). ### Read-Only - `id` (String) The ID of this resource. +## Useful Links + +[MS Teams alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/msteams/) +[MS Teams webhooks | MS Teams Documentation](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) \ No newline at end of file diff --git a/docs/resources/alert_method_opsgenie.md b/docs/resources/alert_method_opsgenie.md index c6a269ec..77dc697f 100644 --- a/docs/resources/alert_method_opsgenie.md +++ b/docs/resources/alert_method_opsgenie.md @@ -1,34 +1,50 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_opsgenie Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/opsgenie + OpsGenie Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/opsgenie --- # nobl9_alert_method_opsgenie (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/opsgenie) +The **OpsGenie Alert Method** enables triggering alerts through OpsGenie to notify whenever an incident is triggered. +For more details, refer to [OpsGenie Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/opsgenie). +## Example Usage + +Here's an example of OpsGenie Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_webhook" "this" { + name = "my-opsgenie-alert" + display_name = "My Opsgenie Alert" + project = "Test Project" + description = "My Opsgenie Alert" + url = "https://discord.com" + auth = "GenieKey 12345" +} +``` ## Schema ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `url` (String) Opsgenie API URL. +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `url` (String) Opsgenie API URL. See [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/opsgenie#creating-opsgenie-api-key) for more details. ### Optional -- `auth` (String, Sensitive) Opsgenie authentication credentials. See documentation for supported formats. -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `auth` (String, Sensitive) Opsgenie authentication credentials. See [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/opsgenie#authentication) for supported formats. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. ### Read-Only - `id` (String) The ID of this resource. +## Useful Links +[OpsGenie alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/opsgenie/) \ No newline at end of file diff --git a/docs/resources/alert_method_pagerduty.md b/docs/resources/alert_method_pagerduty.md index 0dd29c36..2e60ea5e 100644 --- a/docs/resources/alert_method_pagerduty.md +++ b/docs/resources/alert_method_pagerduty.md @@ -1,33 +1,48 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_pagerduty Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/pagerduty + PagerDuty Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/pagerduty --- # nobl9_alert_method_pagerduty (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/pagerduty) +The **PagerDuty Alert Method** enables triggering alerts through PagerDuty to notify Nobl9 users whenever an incident is triggered. +For more details, refer to [PagerDuty Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/pagerduty). +## Example Usage + +Here's an example of PagerDuty Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_webhook" "this" { + name = "my-pagerduty-alert" + display_name = "My PagerDuty Alert" + project = "Test Project" + description = "My PaderDuty Alert" + integration_key = "84dfcdf19dad8f6c82b7e22afa024065" +} +``` ## Schema ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `integration_key` (String, Sensitive) PagerDuty Integration Key, found on Integrations tab. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `integration_key` (String, Sensitive) PagerDuty Integration Key. For more details, check [Services and integrations](https://support.pagerduty.com/docs/services-and-integrations). ### Read-Only - `id` (String) The ID of this resource. +## Useful Links +[PagerDuty alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/pagerduty/) \ No newline at end of file diff --git a/docs/resources/alert_method_servicenow.md b/docs/resources/alert_method_servicenow.md index ab1c8be5..421d4cff 100644 --- a/docs/resources/alert_method_servicenow.md +++ b/docs/resources/alert_method_servicenow.md @@ -1,35 +1,54 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_servicenow Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/servicenow + ServiceNow Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/servicenow --- # nobl9_alert_method_servicenow (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/servicenow) +The **ServiceNow Alert Method** automatically opens an issue in your ServiceNow workflow to notify you whenever an incident is triggered. +-> **NOTE** To allow ServiceNow alerts to integrate with Nobl9, you need to set up an Access Control List (ACL) for your ServiceNow users. Refer to [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/servicenow) for more details. +For more details, refer to [ServiceNow Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/servicenow). + +## Example Usage + +Here's an example of ServiceNow Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_webhook" "this" { + name = "my-servicenow-alert" + display_name = "My ServiceNow Alert" + project = "Test Project" + description = "ServiceNow alert" + username = "nobl9User" + password = "secret" + instance_name = "my_snow_instance_name" +} +``` ## Schema ### Required -- `instance_name` (String) ServiceNow InstanceName. For details see documentation. -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `instance_name` (String) ServiceNow InstanceName. For details see [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/servicenow#servicenow-credentials). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - `username` (String) ServiceNow username. ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. - `password` (String, Sensitive) ServiceNow password. ### Read-Only - `id` (String) The ID of this resource. +## Useful Links +[ServiceNow alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/servicenow/) \ No newline at end of file diff --git a/docs/resources/alert_method_slack.md b/docs/resources/alert_method_slack.md index b8b3c8aa..a7c7fb8f 100644 --- a/docs/resources/alert_method_slack.md +++ b/docs/resources/alert_method_slack.md @@ -1,33 +1,50 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_slack Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/slack + Slack Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/slack --- # nobl9_alert_method_slack (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/slack) +The **Slack Alert Method** allows sending a predefined notification through Slack to notify Nobl9 users whenever an incident is triggered. +-> **NOTE** To set up the Slack integration, you'll need to provide an Incoming Webhook URL. This allows Slack to send an automated notification to a channel of your choice. For details, see the [Slack documentation](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack%22). +For more details, refer to [Slack Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/slack). + +## Example Usage + +Here's an example of Slack Terraform resource configuration: + +```terraform +resource "nobl9_alert_method_webhook" "this" { + name = "my-slack-alert" + display_name = "My Slack Alert" + project = "Test Project" + description = "slack" + url = "https://slack.com" +} +``` ## Schema ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `url` (String, Sensitive) Slack webhook endpoint URL. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `url` (String, Sensitive) Slack [webhook endpoint URL](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack%22). ### Read-Only - `id` (String) The ID of this resource. +## Useful links +[Slack alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/slack/) \ No newline at end of file diff --git a/docs/resources/alert_method_webhook.md b/docs/resources/alert_method_webhook.md index 5f0deb01..7b621598 100644 --- a/docs/resources/alert_method_webhook.md +++ b/docs/resources/alert_method_webhook.md @@ -1,22 +1,27 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_method_webhook Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Integration configuration documentation https://docs.nobl9.com/Alert_Methods/webhook + Webhook Alert Method | Nobl9 Documentation https://docs.nobl9.com/Alert_Methods/webhook --- # nobl9_alert_method_webhook (Resource) -[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/webhook) +The **Webhook Alert Method** enables sending alerts through an HTTP callback handler that is triggered by an event. You can create webhooks and configure them to handle different incident notifications, using either custom or predefined notification templates. + +-> **NOTE** For details on how to use Webhook message templates, check the [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/webhook#creating-webhook-custom-templates-through-yaml). + +For more details, refer to [Webhook Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/webhook). ## Example Usage +Here's an example of Webhook Terraform resource configuration: + ```terraform resource "nobl9_alert_method_webhook" "this" { - name = "foo-alert" - display_name = "Foo Alert" - project = "Foo Project" + name = "my-webhook-alert" + display_name = "Webhook Alert" + project = "Test Project" url = "https://webhook.com/12345" template_fields = [ @@ -45,19 +50,21 @@ resource "nobl9_alert_method_webhook" "this" { ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. - `template` (String) Webhook message template. See documentation for template format and samples. -- `template_fields` (List of String) Webhook meesage fields. The message will contain json payload with specified fields. See documentation for allowed fields. +- `template_fields` (List of String) Webhook message fields. The message contains JSON payload with specified fields. See documentation for allowed fields. - `url` (String, Sensitive) URL of the webhook endpoint. ### Read-Only - `id` (String) The ID of this resource. +## Useful Links +[Webhook alerts documentation | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/webhook/) \ No newline at end of file diff --git a/docs/resources/alert_policy.md b/docs/resources/alert_policy.md index a28d32ae..cebf87fb 100644 --- a/docs/resources/alert_policy.md +++ b/docs/resources/alert_policy.md @@ -1,22 +1,26 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_alert_policy Resource - terraform-provider-nobl9" -subcategory: "" description: |- - AlertPolicy configuration documentation https://docs.nobl9.com/yaml-guide#alertpolicy + Alert Policy configuration | Nobl9 Documentation https://docs.nobl9.com/yaml-guide#alertpolicy --- # nobl9_alert_policy (Resource) -[AlertPolicy configuration documentation](https://docs.nobl9.com/yaml-guide#alertpolicy) +An **Alert Policy** expresses a set of conditions you want to track or monitor. The conditions for an Alert Policy define what is monitored and when to activate an alert: when the performance of your service is declining, Nobl9 will send a notification to a predefined channel. + +A Nobl9 AlertPolicy accepts up to 7 conditions. All the specified conditions must be satisfied to trigger an alert. + +For more details, refer to the [Alert Policy configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#alertpolicy). ## Example Usage +Here's an example of Alert Policy resource configuration: + ```terraform resource "nobl9_project" "this" { - display_name = "Foo Project" - name = "foo-project" - description = "An example terraform project" + display_name = "My Project" + name = "my-project" + description = "An example N9 Terraform project" } resource "nobl9_service" "this" { @@ -50,16 +54,16 @@ resource "nobl9_alert_policy" "this" { ### Required -- `condition` (Block List, Min: 1) Configuration of an alert condition. (see [below for nested schema](#nestedblock--condition)) -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `severity` (String) Alert severity. One of Low | Medium | High. +- `condition` (Block List, Min: 1) Configuration of an [alert condition](https://docs.nobl9.com/yaml-guide/#alertpolicy). (see [below for nested schema](#nestedblock--condition)) +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `severity` (String) Alert severity. One of `Low` | `Medium` | `High`. ### Optional - `alert_method` (Block List) (see [below for nested schema](#nestedblock--alert_method)) -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. ### Read-Only @@ -70,13 +74,13 @@ resource "nobl9_alert_policy" "this" { Required: -- `measurement` (String) One of timeToBurnBudget | burnRate | burnedBudget. +- `measurement` (String) One of `timeToBurnBudget` | `burnRate` | `burnedBudget`. Optional: -- `lasts_for` (String) How long a given condition needs to be valid to mark a condition as true. Time duration string. -- `value` (Number) For averageBurnRate it tells how fast the error budget is burning. For burnedBudget it tells how much error budget is already burned. -- `value_string` (String) Used with timeToBurnBudget. When the budget would be exhausted. Expected value is a string in time duration string format. +- `lasts_for` (String) Indicates how long a given condition needs to be valid to mark the condition as true. +- `value` (Number) For `averageBurnRate`, it indicates how fast the error budget is burning. For `burnedBudget`, it tells how much error budget is already burned. +- `value_string` (String) Used with `timeToBurnBudget`, indicates when the budget would be exhausted. The expected value is a string in time duration string format. @@ -84,10 +88,12 @@ Optional: Required: -- `name` (String) Name of the alertMethod defined earlier. +- `name` (String) The name of the previously defined alert method. Optional: -- `project` (String) Optional, if not defined project is the same as an Alert Policy. +- `project` (String) Project name the Alert Method is in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). If not defined, Nobl9 returns a default value for this field. +## Useful Links +[Alert Policy configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#alertpolicy) diff --git a/docs/resources/project.md b/docs/resources/project.md index 93570e73..873d1ebe 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -1,22 +1,27 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_project Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Groupings and Utilities" description: |- - [Project configuration documentation]() + Project configuration | Nobl9 Documentation https://docs.nobl9.dev/yaml-guide#project --- # nobl9_project (Resource) -[Project configuration documentation]() +**Projects** are the primary logical grouping of resources in the Nobl9 platform. All Nobl9 resources, such as data sources, SLOs, and alerts, are created within a project. + +Access controls at the project level enable users to control who can see and change these resources. For example, you can allow all of your users to view the SLOs in a given project, but only a few users to make changes. + +For more details, refer to [Project configuration | Nobl9 Documentation](https://docs.nobl9.dev/yaml-guide#project). ## Example Usage +Here's an example of Project resource configuration: + ```terraform resource "nobl9_project" "this" { - display_name = "Foo Project" - name = "foo-project" - description = "An example terraform project" + display_name = "My Project" + name = "my-project" + description = "An example N9 Terraform project" label { key = "env" @@ -35,13 +40,13 @@ resource "nobl9_project" "this" { ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `label` (Block List) Labels containing a single key and a list of values. (see [below for nested schema](#nestedblock--label)) +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `label` (Block List) [Labels](https://docs.nobl9.com/Features/labels/) containing a single key and a list of values. (see [below for nested schema](#nestedblock--label)) ### Read-Only @@ -52,7 +57,11 @@ resource "nobl9_project" "this" { Required: -- `key` (String) One key for the label, unique within the associated resource. +- `key` (String) A key for the label, unique within the associated resource. - `values` (List of String) A list of unique values for a single key. +## Useful Links + +[Projects in Nobl9 | Nobl9 Documentation](https://docs.nobl9.com/#projects) +[Projects YAML Configuration | Nobl9 Documentation](https://docs.nobl9.dev/yaml-guide#project) \ No newline at end of file diff --git a/docs/resources/role_binding.md b/docs/resources/role_binding.md index 549557bd..a84cbc8c 100644 --- a/docs/resources/role_binding.md +++ b/docs/resources/role_binding.md @@ -1,33 +1,60 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_role_binding Resource - terraform-provider-nobl9" -subcategory: "" description: |- - RoleBinding configuration documentation https://docs.nobl9.com/yaml-guide#rolebinding + Role Binding configuration | Nobl9 Documentation https://docs.nobl9.com/yaml-guide#rolebinding --- # nobl9_role_binding (Resource) -[RoleBinding configuration documentation](https://docs.nobl9.com/yaml-guide#rolebinding) +Nobl9 supports **Role-Based Access Control (RBAC)** to enable granular user permissions and access to resources in the Nobl9 platform. +There are two levels of permissions, the organization level and the project level: +- **Organization** roles enable access across the Nobl9 platform. + +- **Project** roles enable users to access a project and its underlying resources, such as services or SLOs. + +For more details, refer to the [Role Binding configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#rolebinding). + +-> **NOTE** To configure RBAC through Terraform, you must provide `role_ref` and `user` values: + +- `user` is a User ID from Okta. You can retrieve it from **Settings** > **Account and Settings** > **Users** in the Nobl9 UI. + +- `role_ref` must be an existing role name that you want the user to assume. If you don't specify the optional `project_ref` value, `role_ref` must contain an Organization Role. + +## Example Usage + +Here's an example of RBAC resource configuration: + +```terraform +resource "nobl9_role_binding" "this" { + name = "my-role-binding" + user = "1234567890asdfghjkl" + role_ref = "project-owner" + project_ref = "1234567890asdfghjkl" +} +``` ## Schema ### Required -- `role_ref` (String) Role name. -- `user` (String) ID of the user. +- `role_ref` (String) Role name; the role that you want the user to assume. +- `user` (String) Okta User ID that can be retrieved from the Nobl9 UI (**Settings** > **Users**). ### Optional -- `display_name` (String) Display name of the resource. -- `name` (String) Automatically generated, unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project_ref` (String) Project name. When empty, `role_ref` has to be Organization Role. +- `display_name` (String) User-friendly display name of the resource. +- `name` (String) Automatically generated, unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project_ref` (String) Project name, the project in which we want the user to assume the specified role. When `project_ref` is empty, `role_ref` must contain an Organization Role. ### Read-Only - `id` (String) The ID of this resource. +## Useful Links + +[Role Based Access Control in Nobl9 | Nobl9 Documentation](https://docs.nobl9.com/Features/RBAC/) +[Role Binding YAML Configuration | Nobl9 Documentation](https://docs.nobl9.com/Features/RBAC/role-binding-yaml) \ No newline at end of file diff --git a/docs/resources/service.md b/docs/resources/service.md index 77f95365..1f415baf 100644 --- a/docs/resources/service.md +++ b/docs/resources/service.md @@ -1,22 +1,25 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_service Resource - terraform-provider-nobl9" -subcategory: "" +subcategory: "Alert Methods" description: |- - Service configuration documentation https://docs.nobl9.com/yaml-guide#service + Service configuration | Nobl9 Documentation https://docs.nobl9.com/yaml-guide#service --- # nobl9_service (Resource) -* [Service configuration documentation](https://docs.nobl9.com/yaml-guide#service) +A **service** in Nobl9 is a high-level grouping of Service Level Objectives (SLOs). A service can represent a logical service endpoint like an API, a database, an application, or anything else you care about setting an SLO for. Every SLO in Nobl9 is tied to a service, and the service can have one or more SLOs. + +For more details, refer to the [Service configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#service). ## Example Usage +Here's an example of Service resource configuration: + ```terraform resource "nobl9_project" "this" { - display_name = "Foo Project" - name = "foo-project" - description = "An example terraform project" + display_name = "My Project" + name = "my-project" + description = "An example N9 Terraform project" } resource "nobl9_service" "this" { @@ -42,14 +45,14 @@ resource "nobl9_service" "this" { ### Required -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). ### Optional -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `label` (Block List) Labels containing a single key and a list of values. (see [below for nested schema](#nestedblock--label)) +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `label` (Block List) [Labels](https://docs.nobl9.com/Features/labels/) containing a single key and a list of values. (see [below for nested schema](#nestedblock--label)) ### Read-Only @@ -61,7 +64,11 @@ resource "nobl9_service" "this" { Required: -- `key` (String) One key for the label, unique within the associated resource. +- `key` (String) A key for the label, unique within the associated resource. - `values` (List of String) A list of unique values for a single key. +## Useful Links + +[Services in Nobl9 | Nobl9 Documentation](https://docs.nobl9.com/#services) +[Service YAML Configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide/#service) diff --git a/docs/resources/slo.md b/docs/resources/slo.md index dc70c26f..7b82941d 100644 --- a/docs/resources/slo.md +++ b/docs/resources/slo.md @@ -1,26 +1,26 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "nobl9_slo Resource - terraform-provider-nobl9" -subcategory: "" description: |- SLO configuration documentation https://docs.nobl9.com/yaml-guide#slo --- # nobl9_slo (Resource) -[SLO configuration documentation](https://docs.nobl9.com/yaml-guide#slo) +An SLO is a target value or range of values for a service that is measured by a service level indicator (SLI). SLOs allows you to define the reliability of your products and services in terms of customer expectations. You can create SLOs for user journeys, internal services, or even infrastructure. + +For more information, refer to [SLO configuration documentation](https://docs.nobl9.com/yaml-guide#slo) ## Example Usage ```terraform resource "nobl9_project" "this" { - display_name = "Test Terraform" - name = "test-terraform" - description = "An example terraform project" + display_name = "Test N9 Terraform" + name = "test-n9-terraform" + description = "An example N9 Terraform project" } resource "nobl9_service" "this" { - name = "foo-front-page" + name = "my-front-page" project = nobl9_project.this.name display_name = "${nobl9_project.this.display_name} Front Page" description = "Front page service" @@ -92,9 +92,9 @@ resource "nobl9_slo" "this" { - `budgeting_method` (String) Method which will be use to calculate budget - `indicator` (Block Set, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--indicator)) -- `name` (String) Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `name` (String) Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - `objective` (Block Set, Min: 1) [Objectives documentation](https://docs.nobl9.com/yaml-guide#objective) (see [below for nested schema](#nestedblock--objective)) -- `project` (String) Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). +- `project` (String) Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - `service` (String) Name of the service - `time_window` (Block Set, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--time_window)) @@ -104,9 +104,9 @@ resource "nobl9_slo" "this" { - `attachment` (Block List, Max: 20) (see [below for nested schema](#nestedblock--attachment)) - `attachments` (Block List, Max: 20, Deprecated) (see [below for nested schema](#nestedblock--attachments)) - `composite` (Block Set, Max: 1) [Composite SLO documentation](https://docs.nobl9.com/yaml-guide/#slo) (see [below for nested schema](#nestedblock--composite)) -- `description` (String) Optional description of the resource. -- `display_name` (String) Display name of the resource. -- `label` (Block List) Labels containing a single key and a list of values. (see [below for nested schema](#nestedblock--label)) +- `description` (String) Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it. +- `display_name` (String) User-friendly display name of the resource. +- `label` (Block List) [Labels](https://docs.nobl9.com/Features/labels/) containing a single key and a list of values. (see [below for nested schema](#nestedblock--label)) ### Read-Only @@ -1129,7 +1129,9 @@ Required: Required: -- `key` (String) One key for the label, unique within the associated resource. +- `key` (String) A key for the label, unique within the associated resource. - `values` (List of String) A list of unique values for a single key. +## Nobl9 Official Documentation +https://docs.nobl9.com/SLOs_as_code/?_highlight=slo \ No newline at end of file diff --git a/examples/resources/nobl9_agent/resource.tf b/examples/resources/nobl9_agent/resource.tf index 7971bc05..e004e613 100644 --- a/examples/resources/nobl9_agent/resource.tf +++ b/examples/resources/nobl9_agent/resource.tf @@ -1,7 +1,7 @@ resource "nobl9_project" "this" { - display_name = "Test Terraform" - name = "test-terraform" - description = "An example terraform project" + display_name = "Test N9 Terraform" + name = "test-n9-terraform" + description = "An example N9 Terraform project" } resource "nobl9_agent" "this" { diff --git a/examples/resources/nobl9_alert_method_discord/resource.tf b/examples/resources/nobl9_alert_method_discord/resource.tf new file mode 100644 index 00000000..65de1481 --- /dev/null +++ b/examples/resources/nobl9_alert_method_discord/resource.tf @@ -0,0 +1,8 @@ +resource "nobl9_alert_method_discord" "this" { + name = "my-discord-alert" + display_name = "My Discord alert" + project = "My Discord alert" + description = "My Discord alert method" + url = "https://discord.webhook.url" +} + diff --git a/examples/resources/nobl9_alert_method_email/resource.tf b/examples/resources/nobl9_alert_method_email/resource.tf new file mode 100644 index 00000000..f112a4aa --- /dev/null +++ b/examples/resources/nobl9_alert_method_email/resource.tf @@ -0,0 +1,12 @@ +resource "nobl9_alert_method_email" "this" { + name = "my-email-alert" + display_name = "My Email Alert" + project = "My Project" + description = "teams" + to = [ "testUser@nobl9.com" ] + cc = [ "testUser@nobl9.com" ] + bcc = [ "testUser@nobl9.com" ] + subject = "Test email, please ignore" + body = "This is just a test email" +} + diff --git a/examples/resources/nobl9_alert_method_jira/resource.tf b/examples/resources/nobl9_alert_method_jira/resource.tf new file mode 100644 index 00000000..55ba4493 --- /dev/null +++ b/examples/resources/nobl9_alert_method_jira/resource.tf @@ -0,0 +1,11 @@ +resource "nobl9_alert_method_webhook" "this" { + name = "my-jira-alert" + display_name = "My Jira Alert" + project = "My Jira Project" + description = "My jira alert" + url = "https://jira.com" + username = "nobl9User" + apitoken = "secret_api_token" + project_key = "PC" +} + diff --git a/examples/resources/nobl9_alert_method_msteams/resource.tf b/examples/resources/nobl9_alert_method_msteams/resource.tf new file mode 100644 index 00000000..a41e6f45 --- /dev/null +++ b/examples/resources/nobl9_alert_method_msteams/resource.tf @@ -0,0 +1,8 @@ +resource "nobl9_alert_method_webhook" "this" { + name = "ms-teams-alert" + display_name = "MS Teams Alert" + project = "Test Project" + description = "My MS Teams alerts" + url = "https://teams.com" +} + diff --git a/examples/resources/nobl9_alert_method_opsgenie/resource.tf b/examples/resources/nobl9_alert_method_opsgenie/resource.tf new file mode 100644 index 00000000..13fc07cd --- /dev/null +++ b/examples/resources/nobl9_alert_method_opsgenie/resource.tf @@ -0,0 +1,9 @@ +resource "nobl9_alert_method_webhook" "this" { + name = "my-opsgenie-alert" + display_name = "My Opsgenie Alert" + project = "Test Project" + description = "My Opsgenie Alert" + url = "https://discord.com" + auth = "GenieKey 12345" +} + diff --git a/examples/resources/nobl9_alert_method_pagerduty/resource.tf b/examples/resources/nobl9_alert_method_pagerduty/resource.tf new file mode 100644 index 00000000..285ebc2c --- /dev/null +++ b/examples/resources/nobl9_alert_method_pagerduty/resource.tf @@ -0,0 +1,8 @@ +resource "nobl9_alert_method_webhook" "this" { + name = "my-pagerduty-alert" + display_name = "My PagerDuty Alert" + project = "Test Project" + description = "My PaderDuty Alert" + integration_key = "84dfcdf19dad8f6c82b7e22afa024065" +} + diff --git a/examples/resources/nobl9_alert_method_servicenow/resource.tf b/examples/resources/nobl9_alert_method_servicenow/resource.tf new file mode 100644 index 00000000..03fafa32 --- /dev/null +++ b/examples/resources/nobl9_alert_method_servicenow/resource.tf @@ -0,0 +1,10 @@ +resource "nobl9_alert_method_webhook" "this" { + name = "my-servicenow-alert" + display_name = "My ServiceNow Alert" + project = "Test Project" + description = "ServiceNow alert" + username = "nobl9User" + password = "secret" + instance_name = "my_snow_instance_name" +} + diff --git a/examples/resources/nobl9_alert_method_slack/resource.tf b/examples/resources/nobl9_alert_method_slack/resource.tf new file mode 100644 index 00000000..e9c97236 --- /dev/null +++ b/examples/resources/nobl9_alert_method_slack/resource.tf @@ -0,0 +1,8 @@ +resource "nobl9_alert_method_webhook" "this" { + name = "my-slack-alert" + display_name = "My Slack Alert" + project = "Test Project" + description = "slack" + url = "https://slack.com" +} + diff --git a/examples/resources/nobl9_alert_method_webhook/resource.tf b/examples/resources/nobl9_alert_method_webhook/resource.tf index d2cff5c5..1e2744da 100644 --- a/examples/resources/nobl9_alert_method_webhook/resource.tf +++ b/examples/resources/nobl9_alert_method_webhook/resource.tf @@ -1,7 +1,7 @@ resource "nobl9_alert_method_webhook" "this" { - name = "foo-alert" - display_name = "Foo Alert" - project = "Foo Project" + name = "my-webhook-alert" + display_name = "Webhook Alert" + project = "Test Project" url = "https://webhook.com/12345" template_fields = [ diff --git a/examples/resources/nobl9_alert_policy/resource.tf b/examples/resources/nobl9_alert_policy/resource.tf index 9d4d5ef7..c89aa09a 100644 --- a/examples/resources/nobl9_alert_policy/resource.tf +++ b/examples/resources/nobl9_alert_policy/resource.tf @@ -1,7 +1,7 @@ resource "nobl9_project" "this" { - display_name = "Foo Project" - name = "foo-project" - description = "An example terraform project" + display_name = "My Project" + name = "my-project" + description = "An example N9 Terraform project" } resource "nobl9_service" "this" { diff --git a/examples/resources/nobl9_project/resource.tf b/examples/resources/nobl9_project/resource.tf index b51fc778..7a5fd82a 100644 --- a/examples/resources/nobl9_project/resource.tf +++ b/examples/resources/nobl9_project/resource.tf @@ -1,7 +1,7 @@ resource "nobl9_project" "this" { - display_name = "Foo Project" - name = "foo-project" - description = "An example terraform project" + display_name = "My Project" + name = "my-project" + description = "An example N9 Terraform project" label { key = "env" diff --git a/examples/resources/nobl9_role_binding/resource.tf b/examples/resources/nobl9_role_binding/resource.tf new file mode 100644 index 00000000..5642abc7 --- /dev/null +++ b/examples/resources/nobl9_role_binding/resource.tf @@ -0,0 +1,6 @@ +resource "nobl9_role_binding" "this" { + name = "my-role-binding" + user = "1234567890asdfghjkl" + role_ref = "project-owner" + project_ref = "1234567890asdfghjkl" +} \ No newline at end of file diff --git a/examples/resources/nobl9_service/resource.tf b/examples/resources/nobl9_service/resource.tf index 723bf6e5..0607587e 100644 --- a/examples/resources/nobl9_service/resource.tf +++ b/examples/resources/nobl9_service/resource.tf @@ -1,7 +1,7 @@ resource "nobl9_project" "this" { - display_name = "Foo Project" - name = "foo-project" - description = "An example terraform project" + display_name = "My Project" + name = "my-project" + description = "An example N9 Terraform project" } resource "nobl9_service" "this" { diff --git a/examples/resources/nobl9_slo/resource.tf b/examples/resources/nobl9_slo/resource.tf index c8168db3..e14c8941 100644 --- a/examples/resources/nobl9_slo/resource.tf +++ b/examples/resources/nobl9_slo/resource.tf @@ -1,11 +1,11 @@ resource "nobl9_project" "this" { - display_name = "Test Terraform" - name = "test-terraform" - description = "An example terraform project" + display_name = "Test N9 Terraform" + name = "test-n9-terraform" + description = "An example N9 Terraform project" } resource "nobl9_service" "this" { - name = "foo-front-page" + name = "my-front-page" project = nobl9_project.this.name display_name = "${nobl9_project.this.display_name} Front Page" description = "Front page service" diff --git a/nobl9/metadata_schema.go b/nobl9/metadata_schema.go index a114042d..9e7bcee6 100644 --- a/nobl9/metadata_schema.go +++ b/nobl9/metadata_schema.go @@ -23,7 +23,7 @@ func schemaName() *schema.Schema { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).", + Description: "Unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).", } } @@ -31,7 +31,7 @@ func schemaDisplayName() *schema.Schema { return &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "Display name of the resource.", + Description: "User-friendly display name of the resource.", } } @@ -40,7 +40,7 @@ func schemaLabels() *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Optional: true, - Description: "Labels containing a single key and a list of values.", + Description: "[Labels](https://docs.nobl9.com/Features/labels/) containing a single key and a list of values.", DiffSuppressFunc: diffSuppressLabels, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -48,7 +48,7 @@ func schemaLabels() *schema.Schema { Type: schema.TypeString, Required: true, ValidateFunc: validateNotEmptyString(fieldLabelKey), - Description: "One key for the label, unique within the associated resource.", + Description: "A key for the label, unique within the associated resource.", }, fieldLabelValues: { Type: schema.TypeList, @@ -162,14 +162,14 @@ func schemaProject() *schema.Schema { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Name of the project the resource is in. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names)."} + Description: "Name of the Nobl9 project the resource sits in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names)."} } func schemaDescription() *schema.Schema { return &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "Optional description of the resource.", + Description: "Optional description of the resource. Here, you can add details about who is responsible for the integration (team/owner) or the purpose of creating it.", } } diff --git a/nobl9/provider.go b/nobl9/provider.go index 581b63e2..39d2f72a 100644 --- a/nobl9/provider.go +++ b/nobl9/provider.go @@ -27,7 +27,7 @@ func Provider() *schema.Provider { Type: schema.TypeString, Required: true, DefaultFunc: schema.EnvDefaultFunc("NOBL9_ORG", nil), - Description: "Nobl9 Organization that contain resources managed by this provider.", + Description: "Nobl9 [Organization ID](https://docs.nobl9.com/API_Documentation/api-endpoints-for-slo-annotations/#common-headers) that contains resources managed by the Nobl9 Terraform provider.", }, "project": { @@ -41,7 +41,7 @@ func Provider() *schema.Provider { Type: schema.TypeString, Required: true, DefaultFunc: schema.EnvDefaultFunc("NOBL9_CLIENT_ID", nil), - Description: "Authentication parameter ClientID.", + Description: "the [Client ID](https://docs.nobl9.com/sloctl-user-guide/#configuration) of your Nobl9 account required to connect to Nobl9.", }, "client_secret": { @@ -49,7 +49,7 @@ func Provider() *schema.Provider { Required: true, Sensitive: true, DefaultFunc: schema.EnvDefaultFunc("NOBL9_CLIENT_SECRET", nil), - Description: "Authentication parameter ClientSecret.", + Description: "the [Client Secret](https://docs.nobl9.com/sloctl-user-guide/#configuration) of your Nobl9 account required to connect to Nobl9.", }, "okta_org_url": { diff --git a/nobl9/resource_agent.go b/nobl9/resource_agent.go index 910cd0c2..076753b0 100644 --- a/nobl9/resource_agent.go +++ b/nobl9/resource_agent.go @@ -25,7 +25,7 @@ func resourceAgent() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, - Description: "[Agent configuration documentation](https://docs.nobl9.com/nobl9_agent)", + Description: "[Agent configuration | Nobl9 Documentation](https://docs.nobl9.com/nobl9_agent)", } } @@ -49,12 +49,12 @@ func agentSchema() map[string]*schema.Schema { agentTypeKey: { Type: schema.TypeString, Required: true, - Description: "Type of an agent. [Supported agent types](https://docs.nobl9.com/Sources/)", + Description: "The type of the Agent. Check [Supported Agent types | Nobl9 Documentation](https://docs.nobl9.com/Sources/)", }, "status": { Type: schema.TypeMap, Computed: true, - Description: "Status of created agent.", + Description: "Status of the created agent.", }, } @@ -342,7 +342,7 @@ func schemaAgentAmazonPrometheus() map[string]*schema.Schema { "region": { Type: schema.TypeString, Required: true, - Description: "AWS region ex. eu-central-1", + Description: "AWS region e.g., eu-central-1", }, }, }, @@ -383,7 +383,7 @@ func schemaAgentAppDynamics() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "Base URL to a AppDynamics Controller.", + Description: "Base URL to the AppDynamics Controller.", }, }, }, @@ -483,7 +483,7 @@ func schemaAgentDatadog() map[string]*schema.Schema { "site": { Type: schema.TypeString, Required: true, - Description: "`com` or `eu`, Datadog SaaS instance, which corresponds to one of their " + + Description: "`com` or `eu`, Datadog SaaS instance, which corresponds to one of Datadog's " + "two locations (https://www.datadoghq.com/ in the U.S. " + "or https://datadoghq.eu/ in the European Union)", }, @@ -565,7 +565,7 @@ func schemaAgentElasticsearch() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "API URL endpoint of Elasticsearch's instance.", + Description: "API URL endpoint to the Elasticsearch's instance.", }, }, }, @@ -636,7 +636,7 @@ func schemaAgentGrafanaLoki() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "API URL endpoint of Grafana Loki instance.", + Description: "API URL endpoint to the Grafana Loki instance.", }, }, }, @@ -676,7 +676,7 @@ func schemaAgentGraphite() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "API URL endpoint of Graphite's instance.", + Description: "API URL endpoint to the Graphite's instance.", }, }, }, @@ -716,7 +716,7 @@ func schemaAgentInfluxDB() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "API URL endpoint of InfluxDB's instance.", + Description: "API URL endpoint to the InfluxDB's instance.", }, }, }, @@ -756,7 +756,7 @@ func schemaAgentInstana() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "API URL endpoint of InfluxDB's instance.", + Description: "API URL endpoint to the InfluxDB's instance.", }, }, }, @@ -843,7 +843,7 @@ func schemaAgentNewRelic() map[string]*schema.Schema { "account_id": { Type: schema.TypeString, Required: true, - Description: "ID number assigned to the New Relic user account", + Description: "ID number assigned to the New Relic user account.", }, }, }, @@ -1037,7 +1037,7 @@ func schemaAgentSplunk() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "Base API URL of the Splunk Search app.", + Description: "Base API URL to the Splunk Search app.", }, }, }, @@ -1120,7 +1120,7 @@ func schemaAgentSumoLogic() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "Base API URL of the Splunk Search app.", + Description: "Base API URL to the Splunk Search app.", }, }, }, diff --git a/nobl9/resource_alert_policy.go b/nobl9/resource_alert_policy.go index b910644d..6faeacfe 100644 --- a/nobl9/resource_alert_policy.go +++ b/nobl9/resource_alert_policy.go @@ -20,35 +20,35 @@ func resourceAlertPolicy() *schema.Resource { "severity": { Type: schema.TypeString, Required: true, - Description: "Alert severity. One of Low | Medium | High.", + Description: "Alert severity. One of `Low` | `Medium` | `High`.", }, //nolint:lll "condition": { Type: schema.TypeList, Required: true, MinItems: 1, - Description: "Configuration of an alert condition.", + Description: "Configuration of an [alert condition](https://docs.nobl9.com/yaml-guide/#alertpolicy).", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "measurement": { Type: schema.TypeString, Required: true, - Description: "One of timeToBurnBudget | burnRate | burnedBudget.", + Description: "One of `timeToBurnBudget` | `burnRate` | `burnedBudget`.", }, "value": { Type: schema.TypeFloat, Optional: true, - Description: "For averageBurnRate it tells how fast the error budget is burning. For burnedBudget it tells how much error budget is already burned.", + Description: "For `averageBurnRate`, it indicates how fast the error budget is burning. For `burnedBudget`, it tells how much error budget is already burned.", }, "value_string": { Type: schema.TypeString, Optional: true, - Description: "Used with timeToBurnBudget. When the budget would be exhausted. Expected value is a string in time duration string format.", + Description: "Used with `timeToBurnBudget`, indicates when the budget would be exhausted. The expected value is a string in time duration string format.", }, "lasts_for": { Type: schema.TypeString, Optional: true, - Description: "How long a given condition needs to be valid to mark a condition as true. Time duration string.", + Description: "Indicates how long a given condition needs to be valid to mark the condition as true.", Default: "0m", }, }, @@ -63,14 +63,15 @@ func resourceAlertPolicy() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "project": { - Type: schema.TypeString, - Optional: true, - Description: "Optional, if not defined project is the same as an Alert Policy.", + Type: schema.TypeString, + Optional: true, + Description: "Project name the Alert Method is in, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names)." + + " If not defined, Nobl9 returns a default value for this field.", }, "name": { Type: schema.TypeString, Required: true, - Description: "Name of the alertMethod defined earlier.", + Description: "The name of the previously defined alert method.", }, }, }, @@ -83,7 +84,7 @@ func resourceAlertPolicy() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, - Description: "[AlertPolicy configuration documentation](https://docs.nobl9.com/yaml-guide#alertpolicy)", + Description: "[Alert Policy configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#alertpolicy)", } } diff --git a/nobl9/resource_alertmethod.go b/nobl9/resource_alertmethod.go index 20b5c46a..cc08ca44 100644 --- a/nobl9/resource_alertmethod.go +++ b/nobl9/resource_alertmethod.go @@ -149,7 +149,7 @@ func resourceAlertMethodDelete(_ context.Context, d *schema.ResourceData, meta i type alertMethodWebhook struct{} func (i alertMethodWebhook) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/webhook)" + return "[Webhook Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/webhook)" } //nolint:lll @@ -171,7 +171,7 @@ func (i alertMethodWebhook) GetSchema() map[string]*schema.Schema { "template_fields": { Type: schema.TypeList, Optional: true, - Description: "Webhook meesage fields. The message will contain json payload with specified fields. See documentation for allowed fields.", + Description: "Webhook message fields. The message contains JSON payload with specified fields. See documentation for allowed fields.", ConflictsWith: []string{"template"}, Elem: &schema.Schema{ Type: schema.TypeString, @@ -217,7 +217,7 @@ func (i alertMethodWebhook) UnmarshalSpec(d *schema.ResourceData, spec map[strin type alertMethodPagerDuty struct{} func (i alertMethodPagerDuty) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/pagerduty)" + return "[PagerDuty Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/pagerduty)" } func (i alertMethodPagerDuty) GetSchema() map[string]*schema.Schema { @@ -225,7 +225,7 @@ func (i alertMethodPagerDuty) GetSchema() map[string]*schema.Schema { "integration_key": { Type: schema.TypeString, Optional: true, - Description: "PagerDuty Integration Key, found on Integrations tab.", + Description: "PagerDuty Integration Key. For more details, check [Services and integrations](https://support.pagerduty.com/docs/services-and-integrations).", Sensitive: true, Computed: true, }, @@ -249,7 +249,7 @@ func (i alertMethodPagerDuty) UnmarshalSpec(d *schema.ResourceData, spec map[str type alertMethodSlack struct{} func (i alertMethodSlack) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/slack)" + return "[Slack Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/slack)" } func (i alertMethodSlack) GetSchema() map[string]*schema.Schema { @@ -257,7 +257,7 @@ func (i alertMethodSlack) GetSchema() map[string]*schema.Schema { "url": { Type: schema.TypeString, Optional: true, - Description: "Slack webhook endpoint URL.", + Description: "Slack [webhook endpoint URL](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack%22).", Sensitive: true, Computed: true, }, @@ -281,7 +281,7 @@ func (i alertMethodSlack) UnmarshalSpec(d *schema.ResourceData, spec map[string] type alertMethodDiscord struct{} func (i alertMethodDiscord) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/discord)" + return "[Discord Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/discord)" } func (i alertMethodDiscord) GetSchema() map[string]*schema.Schema { @@ -289,7 +289,7 @@ func (i alertMethodDiscord) GetSchema() map[string]*schema.Schema { "url": { Type: schema.TypeString, Optional: true, - Description: "Discord webhook endpoint URL.", + Description: "Discord webhook endpoint URL. Refer to [Intro to webhooks | Discord documentation](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) for more details.", Sensitive: true, Computed: true, }, @@ -313,7 +313,7 @@ func (i alertMethodDiscord) UnmarshalSpec(d *schema.ResourceData, spec map[strin type alertMethodOpsgenie struct{} func (i alertMethodOpsgenie) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/opsgenie)" + return "[OpsGenie Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/opsgenie)" } func (i alertMethodOpsgenie) GetSchema() map[string]*schema.Schema { @@ -321,14 +321,14 @@ func (i alertMethodOpsgenie) GetSchema() map[string]*schema.Schema { "auth": { Type: schema.TypeString, Optional: true, - Description: "Opsgenie authentication credentials. See documentation for supported formats.", + Description: "Opsgenie authentication credentials. See [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/opsgenie#authentication) for supported formats.", Sensitive: true, Computed: true, }, "url": { Type: schema.TypeString, Required: true, - Description: "Opsgenie API URL.", + Description: "Opsgenie API URL. See [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/opsgenie#creating-opsgenie-api-key) for more details.", }, } } @@ -356,7 +356,7 @@ func (i alertMethodOpsgenie) UnmarshalSpec(d *schema.ResourceData, spec map[stri type alertMethodServiceNow struct{} func (i alertMethodServiceNow) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/servicenow)" + return "[ServiceNow Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/servicenow)" } func (i alertMethodServiceNow) GetSchema() map[string]*schema.Schema { @@ -376,7 +376,7 @@ func (i alertMethodServiceNow) GetSchema() map[string]*schema.Schema { "instance_name": { Type: schema.TypeString, Required: true, - Description: "ServiceNow InstanceName. For details see documentation.", + Description: "ServiceNow InstanceName. For details see [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/servicenow#servicenow-credentials).", }, } } @@ -407,7 +407,7 @@ func (i alertMethodServiceNow) UnmarshalSpec(d *schema.ResourceData, spec map[st type alertMethodJira struct{} func (i alertMethodJira) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/jira)" + return "[Jira Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/jira)" } func (i alertMethodJira) GetSchema() map[string]*schema.Schema { @@ -415,7 +415,7 @@ func (i alertMethodJira) GetSchema() map[string]*schema.Schema { "url": { Type: schema.TypeString, Required: true, - Description: "Jira instance URL.", + Description: "Jira instance URL. The `https://` prefix is required.", }, "username": { Type: schema.TypeString, @@ -425,14 +425,14 @@ func (i alertMethodJira) GetSchema() map[string]*schema.Schema { "apitoken": { Type: schema.TypeString, Optional: true, - Description: "API Token with access rights to the project.", + Description: "[API Token](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) with access rights to the project.", Sensitive: true, Computed: true, }, "project_key": { Type: schema.TypeString, Required: true, - Description: "The code of the project.", + Description: "The code of the Jira project.", }, } } @@ -466,7 +466,7 @@ func (i alertMethodJira) UnmarshalSpec(d *schema.ResourceData, spec map[string]i type alertMethodTeams struct{} func (i alertMethodTeams) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/ms-teams)" + return "[MS Teams Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/ms-teams)" } func (i alertMethodTeams) GetSchema() map[string]*schema.Schema { @@ -474,7 +474,7 @@ func (i alertMethodTeams) GetSchema() map[string]*schema.Schema { "url": { Type: schema.TypeString, Optional: true, - Description: "MSTeams webhook endpoint URL.", + Description: "MS Teams [webhook endpoint URL](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook).", Sensitive: true, Computed: true, }, @@ -498,7 +498,7 @@ func (i alertMethodTeams) UnmarshalSpec(d *schema.ResourceData, spec map[string] type alertMethodEmail struct{} func (i alertMethodEmail) GetDescription() string { - return "[Integration configuration documentation](https://docs.nobl9.com/Alert_Methods/email-alert)" + return "[Email Alert Method | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/email-alert)" } func (i alertMethodEmail) GetSchema() map[string]*schema.Schema { @@ -506,7 +506,7 @@ func (i alertMethodEmail) GetSchema() map[string]*schema.Schema { "to": { Type: schema.TypeList, Required: true, - Description: "Recipients.", + Description: "Recipients. The maximum number of recipients is 10.", Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -514,7 +514,7 @@ func (i alertMethodEmail) GetSchema() map[string]*schema.Schema { "cc": { Type: schema.TypeList, Optional: true, - Description: "Carbon copy recipients.", + Description: "Carbon copy recipients. The maximum number of recipients is 10.", Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -522,7 +522,7 @@ func (i alertMethodEmail) GetSchema() map[string]*schema.Schema { "bcc": { Type: schema.TypeList, Optional: true, - Description: "Blind carbon copy recipients.", + Description: "Blind carbon copy recipients. The maximum number of recipients is 10.", Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -530,12 +530,12 @@ func (i alertMethodEmail) GetSchema() map[string]*schema.Schema { "subject": { Type: schema.TypeString, Required: true, - Description: "Subject of the email.", + Description: "The Subject of the email alert.", }, "body": { Type: schema.TypeString, Required: true, - Description: "Body of the email. For format and samples see documentation and nobl9 application.", + Description: "The Body of the email alert. For the format of the body and the list of variables that you can define, refer to the [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/email-alert#yaml-configuration).", }, } } diff --git a/nobl9/resource_project.go b/nobl9/resource_project.go index 2601a583..f1ee9324 100644 --- a/nobl9/resource_project.go +++ b/nobl9/resource_project.go @@ -24,7 +24,7 @@ func resourceProject() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, - Description: "[Project configuration documentation]()", + Description: "[Project configuration | Nobl9 Documentation](https://docs.nobl9.dev/yaml-guide#project)", } } diff --git a/nobl9/resource_role_binding.go b/nobl9/resource_role_binding.go index be0bd462..059d50c3 100644 --- a/nobl9/resource_role_binding.go +++ b/nobl9/resource_role_binding.go @@ -21,23 +21,23 @@ func resourceRoleBinding() *schema.Resource { Optional: true, ForceNew: true, Computed: true, - Description: "Automatically generated, unique name of the resource. Must match [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).", + Description: "Automatically generated, unique name of the resource, must conform to the naming convention from [DNS RFC1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).", }, "display_name": schemaDisplayName(), "user": { Type: schema.TypeString, Required: true, - Description: "ID of the user.", + Description: "Okta User ID that can be retrieved from the Nobl9 UI (**Settings** > **Users**).", }, "role_ref": { Type: schema.TypeString, Required: true, - Description: "Role name.", + Description: "Role name; the role that you want the user to assume.", }, "project_ref": { Type: schema.TypeString, Optional: true, - Description: "Project name. When empty, `role_ref` has to be Organization Role.", + Description: "Project name, the project in which we want the user to assume the specified role. When `project_ref` is empty, `role_ref` must contain an Organization Role.", }, }, CreateContext: resourceRoleBindingApply, @@ -47,7 +47,7 @@ func resourceRoleBinding() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, - Description: "[RoleBinding configuration documentation](https://docs.nobl9.com/yaml-guide#rolebinding)", + Description: "[Role Binding configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#rolebinding)", } } diff --git a/nobl9/resource_service.go b/nobl9/resource_service.go index cea390e6..a98a141f 100644 --- a/nobl9/resource_service.go +++ b/nobl9/resource_service.go @@ -33,7 +33,7 @@ func resourceService() *schema.Resource { Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, - Description: "* [Service configuration documentation](https://docs.nobl9.com/yaml-guide#service)", + Description: "[Service configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#service)", } } diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl new file mode 100644 index 00000000..aa40dc21 --- /dev/null +++ b/templates/index.md.tmpl @@ -0,0 +1,43 @@ +--- +page_title: "Nobl9 Provider" +description: |- + The Nobl9 provider provides utilities for working with Nobl9 API. +--- + +# {{ .ProviderShortName | upper }} Provider + +There are many types of [resources](https://docs.nobl9.com/#using-resources-in-nobl9) in the Nobl9 platform. You can configure them via: +- UI (https://app.nobl9.com) +- [sloctl](https://docs.nobl9.com/sloctl-user-guide/) +- Nobl9 Terraform Provider + +## Scope of Support + +The Nobl9 Provider delivers tools working with the Nobl9 API to create and manage the following resources: +- SLOs +- Services +- Projects +- Alert Policies +- Alert Methods +- Data Sources +- Role Bindings + +The Nobl9 Terraform Provider does not support the configuration of the following resources: +- [SLO Annotations](https://docs.nobl9.com/Features/SLO_Annotations/) +- [Alert Silence](https://docs.nobl9.com/Alert_Methods/Alert_silence/) + +## Configuration + +To start using Nobl9 Terraform Provider, you must configure the provider with the proper credentials. Then, use the navigation on the left to learn more about the available resources. + +The following is an exemplary configuration: + +{{ tffile "examples/provider/provider.tf" }} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Nobl9 Documentation](https://docs.nobl9.com/) + +[Nobl9 Terraform Provider Release Notes](https://github.com/nobl9/terraform-provider-nobl9/releases) \ No newline at end of file diff --git a/templates/resources.md.tmpl b/templates/resources.md.tmpl new file mode 100644 index 00000000..791863c7 --- /dev/null +++ b/templates/resources.md.tmpl @@ -0,0 +1,20 @@ +--- +page_title: "Resources" +description: |- + The Nobl9 provider provides utilities for working with Nobl9 API. +--- + +# {{ .ProviderShortName | upper }} Provider + +There are many types of resources in the Nobl9 platform, which you can configure via: +- UI (https://app.nobl9.com) +- [sloctl](https://docs.nobl9.com/sloctl-user-guide/) +- Nobl9 Terraform Provider + +## Unsupported Resources + +There are couple of resources that cannot be configured using Terraform Provider. +Their creation and management are limited to sloctl/UI. +This is the list that are not supported in this provider: +- [SLO Annotations](https://docs.nobl9.com/Features/SLO_Annotations/) +- Alert Silences diff --git a/templates/resources/agent.md.tmpl b/templates/resources/agent.md.tmpl new file mode 100644 index 00000000..0872570c --- /dev/null +++ b/templates/resources/agent.md.tmpl @@ -0,0 +1,23 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The Agent is a lightweight application that executes the queries defined for your Nobl9 SLOs. Queries are written in the language supported by the data source in question and executed via native APIs. + +The Agent then sends your SLI metrics back to Nobl9 for processing and error budget calculation. + +For more information, refer to {{ .Description | trimspace }} + +## Example Usage + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Nobl9 Official Documentation + +https://docs.nobl9.com/ diff --git a/templates/resources/alert_method_discord.md.tmpl b/templates/resources/alert_method_discord.md.tmpl new file mode 100644 index 00000000..8624966f --- /dev/null +++ b/templates/resources/alert_method_discord.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **Discord Alert Method** enables sending alerts through Discord to notify Nobl9 users whenever an incident is triggered. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Discord Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Discord alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/discord/) + +[Intro to webhooks | Discord Documentation](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) \ No newline at end of file diff --git a/templates/resources/alert_method_email.md.tmpl b/templates/resources/alert_method_email.md.tmpl new file mode 100644 index 00000000..d2370d26 --- /dev/null +++ b/templates/resources/alert_method_email.md.tmpl @@ -0,0 +1,24 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **Email Alert Method** enables sending automated and customized alert messages to up to 30 different inboxes per alert to notify Nobl9 users whenever an incident is triggered. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Email Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful links + +[Email alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/email-alert) \ No newline at end of file diff --git a/templates/resources/alert_method_jira.md.tmpl b/templates/resources/alert_method_jira.md.tmpl new file mode 100644 index 00000000..152e567e --- /dev/null +++ b/templates/resources/alert_method_jira.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **Jira Alert Method** automatically opens a Jira issue to notify you whenever an incident is triggered. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Jira Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Jira alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/jira/) + +[Atlassian Accounts Documentation](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) \ No newline at end of file diff --git a/templates/resources/alert_method_msteams.md.tmpl b/templates/resources/alert_method_msteams.md.tmpl new file mode 100644 index 00000000..be532a4f --- /dev/null +++ b/templates/resources/alert_method_msteams.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **MS Teams Alert Method** enables sending alerts through MS Teams to notify Nobl9 users whenever an incident is triggered. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of MS Teams Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[MS Teams alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/msteams/) + +[MS Teams webhooks | MS Teams Documentation](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) \ No newline at end of file diff --git a/templates/resources/alert_method_opsgenie.md.tmpl b/templates/resources/alert_method_opsgenie.md.tmpl new file mode 100644 index 00000000..4b18fa41 --- /dev/null +++ b/templates/resources/alert_method_opsgenie.md.tmpl @@ -0,0 +1,24 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **OpsGenie Alert Method** enables triggering alerts through OpsGenie to notify whenever an incident is triggered. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of OpsGenie Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[OpsGenie alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/opsgenie/) \ No newline at end of file diff --git a/templates/resources/alert_method_pagerduty.md.tmpl b/templates/resources/alert_method_pagerduty.md.tmpl new file mode 100644 index 00000000..3db2a821 --- /dev/null +++ b/templates/resources/alert_method_pagerduty.md.tmpl @@ -0,0 +1,24 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **PagerDuty Alert Method** enables triggering alerts through PagerDuty to notify Nobl9 users whenever an incident is triggered. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of PagerDuty Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[PagerDuty alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/pagerduty/) \ No newline at end of file diff --git a/templates/resources/alert_method_servicenow.md.tmpl b/templates/resources/alert_method_servicenow.md.tmpl new file mode 100644 index 00000000..19a0206a --- /dev/null +++ b/templates/resources/alert_method_servicenow.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **ServiceNow Alert Method** automatically opens an issue in your ServiceNow workflow to notify you whenever an incident is triggered. + +-> **NOTE** To allow ServiceNow alerts to integrate with Nobl9, you need to set up an Access Control List (ACL) for your ServiceNow users. Refer to [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/servicenow) for more details. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of ServiceNow Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[ServiceNow alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/servicenow/) \ No newline at end of file diff --git a/templates/resources/alert_method_slack.md.tmpl b/templates/resources/alert_method_slack.md.tmpl new file mode 100644 index 00000000..cb1bb2e5 --- /dev/null +++ b/templates/resources/alert_method_slack.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **Slack Alert Method** allows sending a predefined notification through Slack to notify Nobl9 users whenever an incident is triggered. + +-> **NOTE** To set up the Slack integration, you'll need to provide an Incoming Webhook URL. This allows Slack to send an automated notification to a channel of your choice. For details, see the [Slack documentation](https://slack.com/help/articles/115005265063-Incoming-webhooks-for-Slack%22). + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Slack Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful links + +[Slack alerts configuration | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/slack/) \ No newline at end of file diff --git a/templates/resources/alert_method_webhook.md.tmpl b/templates/resources/alert_method_webhook.md.tmpl new file mode 100644 index 00000000..2fffcc4c --- /dev/null +++ b/templates/resources/alert_method_webhook.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +The **Webhook Alert Method** enables sending alerts through an HTTP callback handler that is triggered by an event. You can create webhooks and configure them to handle different incident notifications, using either custom or predefined notification templates. + +-> **NOTE** For details on how to use Webhook message templates, check the [Nobl9 documentation](https://docs.nobl9.com/Alert_Methods/webhook#creating-webhook-custom-templates-through-yaml). + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Webhook Terraform resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Webhook alerts documentation | Nobl9 Documentation](https://docs.nobl9.com/Alert_Methods/webhook/) \ No newline at end of file diff --git a/templates/resources/alert_policy.md.tmpl b/templates/resources/alert_policy.md.tmpl new file mode 100644 index 00000000..f0835a80 --- /dev/null +++ b/templates/resources/alert_policy.md.tmpl @@ -0,0 +1,25 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +An **Alert Policy** expresses a set of conditions you want to track or monitor. The conditions for an Alert Policy define what is monitored and when to activate an alert: when the performance of your service is declining, Nobl9 will send a notification to a predefined channel. + +A Nobl9 AlertPolicy accepts up to 7 conditions. All the specified conditions must be satisfied to trigger an alert. + +For more details, refer to the {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Alert Policy resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Alert Policy configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide#alertpolicy) diff --git a/templates/resources/project.md.tmpl b/templates/resources/project.md.tmpl new file mode 100644 index 00000000..6beeb4b2 --- /dev/null +++ b/templates/resources/project.md.tmpl @@ -0,0 +1,28 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Groupings and Utilities" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +**Projects** are the primary logical grouping of resources in the Nobl9 platform. All Nobl9 resources, such as data sources, SLOs, and alerts, are created within a project. + +Access controls at the project level enable users to control who can see and change these resources. For example, you can allow all of your users to view the SLOs in a given project, but only a few users to make changes. + +For more details, refer to {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Project resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Projects in Nobl9 | Nobl9 Documentation](https://docs.nobl9.com/#projects) + +[Projects YAML Configuration | Nobl9 Documentation](https://docs.nobl9.dev/yaml-guide#project) \ No newline at end of file diff --git a/templates/resources/role_binding.md.tmpl b/templates/resources/role_binding.md.tmpl new file mode 100644 index 00000000..31f79f3e --- /dev/null +++ b/templates/resources/role_binding.md.tmpl @@ -0,0 +1,37 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +Nobl9 supports **Role-Based Access Control (RBAC)** to enable granular user permissions and access to resources in the Nobl9 platform. + +There are two levels of permissions, the organization level and the project level: + +- **Organization** roles enable access across the Nobl9 platform. + +- **Project** roles enable users to access a project and its underlying resources, such as services or SLOs. + +For more details, refer to the {{ .Description | trimspace }}. + +-> **NOTE** To configure RBAC through Terraform, you must provide `role_ref` and `user` values: + +- `user` is a User ID from Okta. You can retrieve it from **Settings** > **Account and Settings** > **Users** in the Nobl9 UI. + +- `role_ref` must be an existing role name that you want the user to assume. If you don't specify the optional `project_ref` value, `role_ref` must contain an Organization Role. + +## Example Usage + +Here's an example of RBAC resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Role Based Access Control in Nobl9 | Nobl9 Documentation](https://docs.nobl9.com/Features/RBAC/) + +[Role Binding YAML Configuration | Nobl9 Documentation](https://docs.nobl9.com/Features/RBAC/role-binding-yaml) \ No newline at end of file diff --git a/templates/resources/service.md.tmpl b/templates/resources/service.md.tmpl new file mode 100644 index 00000000..f4db6fdd --- /dev/null +++ b/templates/resources/service.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "Alert Methods" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +A **service** in Nobl9 is a high-level grouping of Service Level Objectives (SLOs). A service can represent a logical service endpoint like an API, a database, an application, or anything else you care about setting an SLO for. Every SLO in Nobl9 is tied to a service, and the service can have one or more SLOs. + +For more details, refer to the {{ .Description | trimspace }}. + +## Example Usage + +Here's an example of Service resource configuration: + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Useful Links + +[Services in Nobl9 | Nobl9 Documentation](https://docs.nobl9.com/#services) + +[Service YAML Configuration | Nobl9 Documentation](https://docs.nobl9.com/yaml-guide/#service) diff --git a/templates/resources/slo.md.tmpl b/templates/resources/slo.md.tmpl new file mode 100644 index 00000000..04339c60 --- /dev/null +++ b/templates/resources/slo.md.tmpl @@ -0,0 +1,21 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +An SLO is a target value or range of values for a service that is measured by a service level indicator (SLI). SLOs allows you to define the reliability of your products and services in terms of customer expectations. You can create SLOs for user journeys, internal services, or even infrastructure. + +For more information, refer to {{ .Description | trimspace }} + +## Example Usage + +{{ tffile (printf "examples/resources/%s/resource.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Nobl9 Official Documentation + +https://docs.nobl9.com/SLOs_as_code/?_highlight=slo \ No newline at end of file