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

Unable to create Data Sources in Grafana Cloud #1340

Closed
BobRoss5027 opened this issue Feb 8, 2024 · 1 comment
Closed

Unable to create Data Sources in Grafana Cloud #1340

BobRoss5027 opened this issue Feb 8, 2024 · 1 comment

Comments

@BobRoss5027
Copy link

Terraform Version

  • Terraform: v1.5.7
  • Terraform Grafana Provider: v2.11.0
  • Grafana: v10.4.0

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

terraform {
  required_version = "~> 1.5"
  required_providers {
    grafana = {
      source = "grafana/grafana"
      version = "~> 2.11.0"
    }
  }
}

provider "grafana" {
  url  = "<URL>"
  auth = "<Service Account Token>"
}

resource "grafana_data_source" "data_source" {
  type = "cloudwatch"
  name = "test"

  json_data_encoded = jsonencode({
    defaultRegion: "eu-west-2",
    authType: "keys",
    assumeRoleArn: "aws_role_arn"
  })
  secure_json_data_encoded = jsonencode({
    accessKey: "accessKey"
    secretKey: "secretKey"
  })
}

Debug Output

https://gist.github.com/BobRoss5027/689fb5e7a5b5d7e44ef66c913bac248d

Expected Behavior

Deployment of a Data Source

Actual Behavior

Terraform errors out after apply, showing the following message:

╷
│ Error: json: cannot unmarshal array into Go value of type models.AddDataSourceOKBody
│ 
│   with grafana_data_source.data_source,
│   on main.tf line 38, in resource "grafana_data_source" "data_source":
│   38: resource "grafana_data_source" "data_source" {
│ 
╵

Steps to Reproduce

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

  1. terraform apply
@BobRoss5027 BobRoss5027 added the bug label Feb 8, 2024
@julienduchesne
Copy link
Member

Strange, I tried with Grafana 10.3.2 locally with an SA and the admin user and on Grafana Cloud (10.4) with an SA and it worked 🤔

@julienduchesne julienduchesne closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants