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

"url": all of auth,url must be specified #1099

Closed
lohrm-stabl opened this issue Oct 25, 2023 · 2 comments
Closed

"url": all of auth,url must be specified #1099

lohrm-stabl opened this issue Oct 25, 2023 · 2 comments
Assignees
Labels

Comments

@lohrm-stabl
Copy link

Terraform Version

  • Terraform: v1.6.2
  • Terraform Grafana Provider: v2.3.3
  • Grafana: v9.4.3

Affected Resource(s)

  • provider
  • grafana_dashboard

Terraform Configuration Files

{
  "//": {
    "metadata": {
      "backend": "local",
      "stackName": "infra",
      "version": "0.19.0"
    },
    "outputs": {
    }
  },
  "provider": {
    "grafana": [
      {
        "auth": "...",
        "url": "https://grafana...."
      }
    ]
  },
  "resource": {
    "grafana_dashboard": {
      "test": {
        "//": {
          "metadata": {
            "path": "infra/test",
            "uniqueId": "test"
          }
        },
        "config_json": "{\n  \"annotations\": {\n    \"list\": [\n      {\n        \"builtIn\": 1,\n        \"datasource\": {\n          \"type\": \"grafana\",\n          \"uid\": \"-- Grafana --\"\n        },\n        \"enable\": true,\n        \"hide\": true,\n        \"iconColor\": \"rgba(0, 211, 255, 1)\",\n        \"name\": \"Annotations & Alerts\",\n        \"target\": {\n          \"limit\": 100,\n          \"matchAny\": false,\n          \"tags\": [],\n          \"type\": \"dashboard\"\n        },\n        \"type\": \"dashboard\"\n      }\n    ]\n  },\n  \"editable\": true,\n  \"fiscalYearStartMonth\": 0,\n  \"graphTooltip\": 0,\n  \"id\": 9,\n  \"links\": [],\n  \"liveNow\": false,\n  \"panels\": [\n    {\n      \"datasource\": {\n        \"type\": \"influxdb\",\n        \"uid\": \"lDPOg13Vz\"\n      },\n      \"fieldConfig\": {\n        \"defaults\": {\n          \"color\": {\n            \"mode\": \"palette-classic\"\n          },\n          \"custom\": {\n            \"axisCenteredZero\": false,\n            \"axisColorMode\": \"text\",\n            \"axisLabel\": \"\",\n            \"axisPlacement\": \"auto\",\n            \"barAlignment\": 0,\n            \"drawStyle\": \"line\",\n            \"fillOpacity\": 0,\n            \"gradientMode\": \"none\",\n            \"hideFrom\": {\n              \"legend\": false,\n              \"tooltip\": false,\n              \"viz\": false\n            },\n            \"lineInterpolation\": \"linear\",\n            \"lineWidth\": 1,\n            \"pointSize\": 5,\n            \"scaleDistribution\": {\n              \"type\": \"linear\"\n            },\n            \"showPoints\": \"auto\",\n            \"spanNulls\": false,\n            \"stacking\": {\n              \"group\": \"A\",\n              \"mode\": \"none\"\n            },\n            \"thresholdsStyle\": {\n              \"mode\": \"off\"\n            }\n          },\n          \"mappings\": [],\n          \"thresholds\": {\n            \"mode\": \"absolute\",\n            \"steps\": [\n              {\n                \"color\": \"green\",\n                \"value\": null\n              },\n              {\n                \"color\": \"red\",\n                \"value\": 80\n              }\n            ]\n          }\n        },\n        \"overrides\": []\n      },\n      \"gridPos\": {\n        \"h\": 8,\n        \"w\": 12,\n        \"x\": 0,\n        \"y\": 0\n      },\n      \"id\": 2,\n      \"options\": {\n        \"legend\": {\n          \"calcs\": [],\n          \"displayMode\": \"list\",\n          \"placement\": \"bottom\",\n          \"showLegend\": true\n        },\n        \"tooltip\": {\n          \"mode\": \"single\",\n          \"sort\": \"none\"\n        }\n      },\n      \"title\": \"Panel Title\",\n      \"type\": \"timeseries\"\n    }\n  ],\n  \"refresh\": \"\",\n  \"revision\": 1,\n  \"schemaVersion\": 38,\n  \"style\": \"dark\",\n  \"tags\": [],\n  \"templating\": {\n    \"list\": []\n  },\n  \"time\": {\n    \"from\": \"now-6h\",\n    \"to\": \"now\"\n  },\n  \"timepicker\": {},\n  \"timezone\": \"\",\n  \"title\": \"gen-test\",\n  \"uid\": \"2NOzGPnSz\",\n  \"version\": 1,\n  \"weekStart\": \"\"\n}\n"
      }
    }
  },
  "terraform": {
    "backend": {
      "local": {
        "path": "/workspaces/Grafana-Infrastructure/terraform.infra.tfstate"
      }
    },
    "required_providers": {
      "grafana": {
        "source": "grafana/grafana",
        "version": "2.3.3"
      }
    }
  }
}

This hcljson was generated with CDKTF.

Expected Behavior

terraform plan plans the deployment.
This actually works just fine when setting GRAFANA_USER & GRAFANA_AUTH env vars to the same values.

Actual Behavior

terraform plan    
╷
│ Error: Missing required argument
│ 
│   with provider["registry.terraform.io/grafana/grafana"],
│   on cdk.tf.json line 15, in provider.grafana[0]:
│   15:         "url": "https://grafana...."
│ 
│ "url": all of `auth,url` must be specified

References

Could be related to #960.

@julienduchesne julienduchesne self-assigned this Nov 7, 2023
@julienduchesne
Copy link
Member

Hello, I've tried your config (placing other values in the url and auth attributes) with lots of different Terraform and provider versions (including the ones you declared) and I haven't been able to reproduce this. Do you have any more info on how to reproduce this?

@lohrm-stabl
Copy link
Author

I am also not able to reproduce it anymore. Super weird, but thanks for investigating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants