diff --git a/docs/resources/data_source_permission.md b/docs/resources/data_source_permission.md index e5dd4efa1..8a3406df1 100644 --- a/docs/resources/data_source_permission.md +++ b/docs/resources/data_source_permission.md @@ -32,6 +32,13 @@ resource "grafana_data_source" "foo" { }) } +resource "grafana_user" "user" { + name = "test-ds-permissions" + email = "test-ds-permissions@example.com" + login = "test-ds-permissions" + password = "hunter2" +} + resource "grafana_data_source_permission" "fooPermissions" { datasource_id = grafana_data_source.foo.id permissions { @@ -39,7 +46,7 @@ resource "grafana_data_source_permission" "fooPermissions" { permission = "Query" } permissions { - user_id = 3 // 3 is the admin user in cloud. It can't be queried + user_id = grafana_user.user.id permission = "Edit" } permissions { diff --git a/examples/resources/grafana_data_source_permission/resource.tf b/examples/resources/grafana_data_source_permission/resource.tf index 9a20ea993..f7e77c4c5 100644 --- a/examples/resources/grafana_data_source_permission/resource.tf +++ b/examples/resources/grafana_data_source_permission/resource.tf @@ -17,6 +17,13 @@ resource "grafana_data_source" "foo" { }) } +resource "grafana_user" "user" { + name = "test-ds-permissions" + email = "test-ds-permissions@example.com" + login = "test-ds-permissions" + password = "hunter2" +} + resource "grafana_data_source_permission" "fooPermissions" { datasource_id = grafana_data_source.foo.id permissions { @@ -24,7 +31,7 @@ resource "grafana_data_source_permission" "fooPermissions" { permission = "Query" } permissions { - user_id = 3 // 3 is the admin user in cloud. It can't be queried + user_id = grafana_user.user.id permission = "Edit" } permissions {