Skip to content
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

Grafana Terraform examples #61

Merged
merged 10 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ e2e-results/
# generated plugin
dist/
releases/

# terraform
.terraform*
terraform.*
*.tfvars
21 changes: 21 additions & 0 deletions terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Terraform Grafana Example

This is an example of how you can use Terraform to create:

- A Service Cloud Observability datasource
- A dashboard with template variables and spans and logs panels


To run:

```
terraform apply -var-file=vars.tfvars
```

Where the `vars.tfvars` specifies Grafana service account token and Cloud Observability API token:

```
grafana_auth = "<service-account-token>"
grafaha_host = "https://<grafana-host>"
lighstep_api_key = "<cloud-observability-api-token>"
```
15 changes: 15 additions & 0 deletions terraform/datasource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "grafana_data_source" "demo" {
type = "servicenow-cloudobservability-datasource"
name = "demo"
uid = "snco-demo-ds-test-uid"
url = "https://${var.lightstep_api_host}"
json_data_encoded = jsonencode({
orgName = "LightStep"
projectName = "demo"
apiHost = var.lightstep_api_host
})

secure_json_data_encoded = jsonencode({
apiKey = var.lighstep_api_key
})
}
Loading
Loading