-
Notifications
You must be signed in to change notification settings - Fork 97
Adding InfluxDB Flux data source support for terraform-provider-grafana #60
Conversation
Supports a fix for grafana/terraform-provider-grafana#203 |
Please tag as |
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.
LGTM!
ds := &DataSource{ | ||
Name: "foo_influxdb", | ||
Type: "influxdb", | ||
URL: "http://some-url.com", |
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.
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.
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.
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 😄
* 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
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 forterraform-provider-grafana