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

Terraform resource definition #633

Open
GunFood opened this issue Sep 12, 2024 · 2 comments
Open

Terraform resource definition #633

GunFood opened this issue Sep 12, 2024 · 2 comments
Labels

Comments

@GunFood
Copy link

GunFood commented Sep 12, 2024

We try to configure Grafana using Terraform so it was a challenge to find the correct variables (still have not found some, for example withCredentials).

But I think it might be a good starting point and maybe something to add to the documentation. As I have more than one JSON source, I've put it into a for each, so you can call the module with an list object to have multiple of them configured.

resource "grafana_data_source" "json-datasource" {
    for_each = { for each in var.json-datasources : each.name => each }
    type = "simpod-json-datasource"
    uid = each.value.uid
    name = each.value.name
    url = each.value.url
    basic_auth_enabled  = true
    basic_auth_username = each.value.username

    json_data_encoded = jsonencode (
        {
            tlsSkipVerify = true
            withCredentials = true #not working
        }
    )
    secure_json_data_encoded = jsonencode (
        {
            basicAuthPassword = each.value.secret
        }
    )
}

Thanks for your work.

@simPod
Copy link
Owner

simPod commented Sep 20, 2024

I have no personal experience with TF but PR is welcome. Can be added to docs/ with some disclaimer.

Copy link

This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants