Skip to content

Commit 4eeb28c

Browse files
authored
docs(tem): add grafana provider example (#1861)
1 parent 820566d commit 4eeb28c

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

docs/resources/cockpit.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,41 @@ For more information consult the [documentation](https://www.scaleway.com/en/doc
1212

1313
## Example Usage
1414

15+
### Activate Cockpit in the default project
16+
1517
```hcl
16-
// Create the cockpit in the default project
1718
resource "scaleway_cockpit" "main" {}
1819
```
1920

21+
### Activate Cockpit in a specific project
22+
2023
```hcl
21-
// Create the cockpit in a specific project
2224
resource "scaleway_cockpit" "main" {
2325
project_id = "11111111-1111-1111-1111-111111111111"
2426
}
2527
```
2628

29+
### Use the Grafana Terraform provider
30+
31+
```hcl
32+
resource "scaleway_cockpit" "main" {}
33+
34+
resource "scaleway_cockpit_grafana_user" "main" {
35+
project_id = scaleway_cockpit.main.project_id
36+
login = "example"
37+
role = "editor"
38+
}
39+
40+
provider "grafana" {
41+
url = scaleway_cockpit.main.endpoints.0.grafana_url
42+
auth = "${scaleway_cockpit_grafana_user.main.login}:${scaleway_cockpit_grafana_user.main.password}"
43+
}
44+
45+
resource "grafana_folder" "test_folder" {
46+
title = "Test Folder"
47+
}
48+
```
49+
2750
## Arguments Reference
2851

2952
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the cockpit is associated with.

0 commit comments

Comments
 (0)