-
Notifications
You must be signed in to change notification settings - Fork 272
Grafana Cloud Integrations #2191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
clementduveau
wants to merge
3
commits into
grafana:main
Choose a base branch
from
clementduveau:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "grafana_integration Resource - terraform-provider-grafana" | ||
| subcategory: "Cloud" | ||
| description: |- | ||
| Manages Grafana Cloud integrations. | ||
| Official documentation https://grafana.com/docs/grafana-cloud/data-configuration/integrations/ | ||
| Required access policy scopes: | ||
| folders:readfolders:writedashboards:readdashboards:write | ||
| Note: This resource creates folders and dashboards as part of the integration installation process, which requires additional permissions beyond the basic integration scopes. | ||
| --- | ||
|
|
||
| # grafana_integration (Resource) | ||
|
|
||
| Manages Grafana Cloud integrations. | ||
|
|
||
| * [Official documentation](https://grafana.com/docs/grafana-cloud/data-configuration/integrations/) | ||
|
|
||
| Required access policy scopes: | ||
|
|
||
| * folders:read | ||
| * folders:write | ||
| * dashboards:read | ||
| * dashboards:write | ||
|
|
||
| **Note:** This resource creates folders and dashboards as part of the integration installation process, which requires additional permissions beyond the basic integration scopes. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| # Install Docker integration with logs and alerts enabled | ||
| resource "grafana_integration" "docker" { | ||
| slug = "docker" | ||
|
|
||
| configuration { | ||
| configurable_logs { | ||
| logs_disabled = false | ||
| } | ||
| configurable_alerts { | ||
| alerts_disabled = false | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Install Linux Node integration with logs enabled but alerts disabled | ||
| resource "grafana_integration" "linux_node" { | ||
| slug = "linux-node" | ||
|
|
||
| configuration { | ||
| configurable_logs { | ||
| logs_disabled = false | ||
| } | ||
| configurable_alerts { | ||
| alerts_disabled = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Install Windows integration with minimal configuration | ||
| resource "grafana_integration" "windows" { | ||
| slug = "windows-exporter" | ||
| } | ||
|
|
||
| # Output integration information | ||
| output "docker_integration" { | ||
| value = { | ||
| name = grafana_integration.docker.name | ||
| version = grafana_integration.docker.version | ||
| installed = grafana_integration.docker.installed | ||
| dashboard_folder = grafana_integration.docker.dashboard_folder | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `slug` (String) The slug of the integration to install (e.g., 'docker', 'linux-node'). | ||
|
|
||
| ### Optional | ||
|
|
||
| - `configuration` (Block List, Max: 1) Configuration options for the integration. (see [below for nested schema](#nestedblock--configuration)) | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `dashboard_folder` (String) The dashboard folder associated with this integration. | ||
| - `id` (String) The ID of this resource. | ||
| - `installed` (Boolean) Whether the integration is currently installed. | ||
| - `name` (String) The display name of the integration. | ||
| - `version` (String) The version of the installed integration. | ||
|
|
||
| <a id="nestedblock--configuration"></a> | ||
| ### Nested Schema for `configuration` | ||
|
|
||
| Optional: | ||
|
|
||
| - `configurable_alerts` (Block List, Max: 1) Alerts configuration for the integration. (see [below for nested schema](#nestedblock--configuration--configurable_alerts)) | ||
| - `configurable_logs` (Block List, Max: 1) Logs configuration for the integration. (see [below for nested schema](#nestedblock--configuration--configurable_logs)) | ||
|
|
||
| <a id="nestedblock--configuration--configurable_alerts"></a> | ||
| ### Nested Schema for `configuration.configurable_alerts` | ||
|
|
||
| Optional: | ||
|
|
||
| - `alerts_disabled` (Boolean) Whether to disable alerts for this integration. Defaults to `false`. | ||
|
|
||
|
|
||
| <a id="nestedblock--configuration--configurable_logs"></a> | ||
| ### Nested Schema for `configuration.configurable_logs` | ||
|
|
||
| Optional: | ||
|
|
||
| - `logs_disabled` (Boolean) Whether to disable logs collection for this integration. Defaults to `false`. | ||
|
|
||
| ## Import | ||
|
|
||
| Import is supported using the following syntax: | ||
|
|
||
| ```shell | ||
| terraform import grafana_integration.name "{{ slug }}" | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| terraform import grafana_integration.name "{{ slug }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Install Docker integration with logs and alerts enabled | ||
| resource "grafana_integration" "docker" { | ||
| slug = "docker" | ||
|
|
||
| configuration { | ||
| configurable_logs { | ||
| logs_disabled = false | ||
| } | ||
| configurable_alerts { | ||
| alerts_disabled = false | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Install Linux Node integration with logs enabled but alerts disabled | ||
| resource "grafana_integration" "linux_node" { | ||
| slug = "linux-node" | ||
|
|
||
| configuration { | ||
| configurable_logs { | ||
| logs_disabled = false | ||
| } | ||
| configurable_alerts { | ||
| alerts_disabled = true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Install Windows integration with minimal configuration | ||
| resource "grafana_integration" "windows" { | ||
| slug = "windows-exporter" | ||
| } | ||
|
|
||
| # Output integration information | ||
| output "docker_integration" { | ||
| value = { | ||
| name = grafana_integration.docker.name | ||
| version = grafana_integration.docker.version | ||
| installed = grafana_integration.docker.installed | ||
| dashboard_folder = grafana_integration.docker.dashboard_folder | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also installing alerts and rules isn't it?