Skip to content

Unable to attach a PDC to a datasource #2416

@matdevdug

Description

@matdevdug

Terraform Version

1.11.2

Terraform Grafana Provider Version

4.12.1

Grafana Version

12.3.0-18940657299.patch2 (Grafana Cloud Advanced)

Affected Resource(s)

  • datasources

Terraform Configuration Files

resource "grafana_data_source" "loki" {                                                                                                                                                                                                        │
│   uid         = "APP-00936-loki-dev-pdc-id"                                                                                                                                                                                                    │
│   type        = "loki"                                                                                                                                                                                                                         │
│   name        = "TEST Loki"                                                                                                                                                                                                                    │
│   url         = "http://istar-loki-query-frontend:3100"                                                                                                                                                                                        │
│   access_mode = "proxy"                                                                                                                                                                                                                        │
│                                                                                                                                                                                                                                                │
│   json_data_encoded = jsonencode({                                                                                                                                                                                                             │
│     enableSecureSocksProxy   = true                                                                                                                                                                                                            │
│     secureSocksProxyUsername = "ID-of-PDC"                                                                                                                                                                          │
│     tlsSkipVerify            = true                                                                                                                                                                                                            │
│   })                                                                                                                                                                                                                                           │
│                                                                                                                                                                                                                                                │
│   http_headers = {                                                                                                                                                                                                                             │
│     "X-Scope-OrgID" = "APP-00936"                                                                                                                                                                                                              │
│   }                                                                                                                                                                                                                                            │
│ }

Also attempted with the: private_data_source_connect_network_id 



### Expected Behavior

Successfully create a datasource associated with the PDC 

### Actual Behavior

Returns a 400 from grafana api. 

Interestingly, the same request made through a curl command succeeds. 

curl -X POST
-H "Authorization: Bearer "
-H "Content-Type: application/json"
-d '{
"uid": "test-loki-dev-pdc",
"name": "TEST Loki PDC",
"type": "loki",
"access": "proxy",
"url": "http://istar-loki-query-frontend:3100",
"jsonData": {
"enableSecureSocksProxy": true,
"secureSocksProxyUsername": "UUID",
"httpHeaderName1": "X-Scope-OrgID"
},
"secureJsonData": {
"httpHeaderValue1": "test"
}
}' \

Steps to Reproduce

  1. Run terraform apply
  2. Get back 400 from Grafana

Important Factoids

We are using Grafana Cloud for the dashboards and connecting via PDC to our own AWS account.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions