github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/website/source/docs/providers/grafana/r/data_source.html.md (about) 1 --- 2 layout: "grafana" 3 page_title: "Grafana: grafana_data_source" 4 sidebar_current: "docs-influxdb-resource-data-source" 5 description: |- 6 The grafana_data_source resource allows a Grafana data source to be created. 7 --- 8 9 # grafana\_data\_source 10 11 The data source resource allows a data source to created on a Grafana server. 12 13 ## Example Usage 14 15 The required arguments for this resource vary depending on the type of data 16 source selected (via the `type` argument). The following example is for 17 InfluxDB. See 18 [Grafana's *Data Sources Guides*](http://docs.grafana.org/#data-sources-guides) 19 for more details on the supported data source types and the arguments they use. 20 21 ``` 22 resource "grafana_data_source" "metrics" { 23 type = "influxdb" 24 name = "myapp-metrics" 25 url = "http://influxdb.example.net:8086/" 26 username = "myapp" 27 password = "foobarbaz" 28 database_name = "${influxdb_database.metrics.name}" 29 } 30 ``` 31 32 ## Argument Reference 33 34 The following arguments are supported: 35 36 * `type` - (Required) The data source type. Must be one of the data source 37 keywords supported by the Grafana server. 38 39 * `name` - (Required) A unique name for the data source within the Grafana 40 server. 41 42 * `url` - (Required) The URL for the data source. The type of URL required 43 varies depending on the chosen data source type. 44 45 * `is_default` - (Optional) If true, the dashboard will be shown as the 46 root page on the Grafana server. Only one dashboard on a server can be 47 the default. 48 49 * `basic_auth_enabled` - (Optional) - If true, HTTP basic authentication will 50 be used to make requests. 51 52 * `basic_auth_username` - (Required if `basic_auth_enabled` is true) The 53 username to use for basic auth. 54 55 * `basic_auth_password` - (Required if `basic_auth_enabled` is true) The 56 password to use for basic auth. 57 58 * `username` - (Required by some data source types) The username to use to 59 authenticate to the data source. 60 61 * `password` - (Required by some data source types) The password to use to 62 authenticate to the data source. 63 64 * `database_name` - (Required by some data source types) The name of the 65 database to use on the selected data source server. 66 67 * `access_mode` - (Optional) The method by which the browser-based Grafana 68 application will access the data source. The default is "proxy", which means 69 that the application will make requests via a proxy endpoint on the Grafana 70 server. 71 72 ## Attributes Reference 73 74 The resource exports the following attributes: 75 76 * `id` - The opaque unique id assigned to the data source by the Grafana 77 server.