Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Adding InfluxDB Flux data source support for terraform-provider-grafana #60

Merged
merged 6 commits into from
Feb 11, 2022

Conversation

stevenleadbeater
Copy link
Contributor

Added support for InfluxDB / Flux data sources. I've run this against a grafana instance using the terraform-provider-grafana test suite pointed at this fork. It populated a Flux data source and I queried data using it. Please see associated changes here: https://github.com/albeego/terraform-provider-grafana once this is merged I will open the PR for terraform-provider-grafana

@stevenleadbeater
Copy link
Contributor Author

Supports a fix for grafana/terraform-provider-grafana#203

@stevenleadbeater
Copy link
Contributor Author

Please tag as v0.3.1 on merge to support associated PR: grafana/terraform-provider-grafana#386

Copy link
Member

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@julienduchesne julienduchesne merged commit 98703b6 into grafana:master Feb 11, 2022
ds := &DataSource{
Name: "foo_influxdb",
Type: "influxdb",
URL: "http://some-url.com",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late to the party, but for posterity: every time you need to use a fake domain name, please use one of the reserved example domain names: example.com, example.net and example.org. These are protected by RFC2606, whereas something like the one used here can be bought by a malicious actor and you could end up leaking secret information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point @inkel I didn't really think about that and just used the same address as the InfluxQL data source test used.

There seems to be several URLs in use in the tests:

http://grafana.com
http://my-grafana.com
http://some-url.com

I can have a look at cleaning this up at some point if you want to raise another issue for it. It is however only test code so the secrets are just mocked values but there's potentially mileage in Just Doing It for best practice sake 😄

julienduchesne pushed a commit to grafana/terraform-provider-grafana that referenced this pull request Feb 11, 2022
* Added Flux support to resource_data_source.go

* Fixing tests

* Adding documentation

* Use official repos

* Fix module name

* Remove checksums pending merge of grafana/grafana-api-golang-client#60

* Updating go.sum with new version of grafana-api-golang-client

* Fixing tests

* Updating documentation

* Fixing tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants