grafana / terraform-provider-grafana

Terraform Grafana provider
https://www.terraform.io/docs/providers/grafana/
Mozilla Public License 2.0
430 stars 229 forks source link

Unable to deploy azure monitor because of unknown key #63

Closed aelking closed 2 years ago

aelking commented 5 years ago

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.11.13

Affected Resource(s)

Please list the resources as a list, for example:

grafana_data_source

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "grafana_data_source" "events"{
  type = "grafana-azure-monitor-datasource"
  name = "${var.prefix}-gds-ai-AK"

  secure_json_data{
    appInsightsApiKey = "${azurerm_application_insights_api_key.aik.api_key}"
    appInsightsAppId = "${azurerm_application_insights.ai.app_id}"
  }
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Expected Behavior

What should have happened? Grafana Azure Monitor Datasource should be created with the the Application Insights details filled in

Actual Behavior

What actually happened? Error about unknown keys

`Error: grafana_data_source.events: secure_json_data.0: invalid or unknown key: appInsightsApiKey

Error: grafana_data_source.events: secure_json_data.0: invalid or unknown key: appInsightsAppId`

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

gfoligna commented 4 years ago

Hi! I'm having the same issue here. The only example provided at the documentation is for InfluxDB and Grafana's docs are not saying any further.

screenshot

From scratching this repo I (wrongly) found some possible solutions for the required data to successfully configure the datasource. These are the results I got from that:


Error: grafana_data_source.azure_monitor: "secure_json_data.0.access_key": required field is not set
Error: grafana_data_source.azure_monitor: "secure_json_data.0.secret_key": required field is not set
Error: grafana_data_source.azure_monitor: json_data.0: invalid or unknown key: clientId
Error: grafana_data_source.azure_monitor: json_data.0: invalid or unknown key: subscriptionId
Error: grafana_data_source.azure_monitor: json_data.0: invalid or unknown key: tenantId
Error: grafana_data_source.azure_monitor: secure_json_data.0: invalid or unknown key: clientSecret```
mlclmj commented 4 years ago

We don't currently support Azure data sources, though this could absolutely be added with an accompanying library change.

jwierzbo commented 4 years ago

I've created separate grafanads provider to support every type of Grafana Datasource https://github.com/jwierzbo/terraform-provider-grafanads

Here is an example how to use it with custom mongo atlas datasource:

resource "grafanads_data_source_generic" "mongodbatlas" {
  type   = "grafana-mongodb-atlas-datasource"
  name   = "mongoatlas-datasource-provider-test"

  json_data_string = {
    atlasPublicKey = "XXX"
  }

  secure_json_string = {
    atlasPrivateKey = "YYY"
  }
}
dingjianrui commented 3 years ago

@jwierzbo do you have sample for azure monitor and log analytics workspace as the data source? many thanks.

moseskt commented 3 years ago

We don't currently support Azure data sources, though this could absolutely be added with an accompanying library change.

Hey @mlclmj is there any ETA on being able to fully configure the Azure Monitor data source fully via Terraform

reallydontask commented 3 years ago

@mlclmj Do you accept PRs?

bateau84 commented 2 years ago

Any progress on supporting this?

ju4nmg commented 2 years ago

Is this gonna be applied someday? thanks