|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "grafana_k6_load_tests Data Source - terraform-provider-grafana" |
| 4 | +subcategory: "k6" |
| 5 | +description: |- |
| 6 | + Retrieves all k6 load tests that belong to a project. |
| 7 | +--- |
| 8 | + |
| 9 | +# grafana_k6_load_tests (Data Source) |
| 10 | + |
| 11 | +Retrieves all k6 load tests that belong to a project. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +resource "grafana_k6_project" "load_test_project" { |
| 17 | + name = "Terraform Load Test Project" |
| 18 | +} |
| 19 | +
|
| 20 | +resource "grafana_k6_load_test" "test_load_test" { |
| 21 | + project_id = grafana_k6_project.load_test_project.id |
| 22 | + name = "Terraform Test Load Test" |
| 23 | + script = <<-EOT |
| 24 | + export default function() { |
| 25 | + console.log('Hello from k6!'); |
| 26 | + } |
| 27 | + EOT |
| 28 | +
|
| 29 | + depends_on = [ |
| 30 | + grafana_k6_project.load_test_project, |
| 31 | + ] |
| 32 | +} |
| 33 | +
|
| 34 | +resource "grafana_k6_load_test" "test_load_test_2" { |
| 35 | + project_id = grafana_k6_project.load_test_project.id |
| 36 | + name = "Terraform Test Load Test (2)" |
| 37 | + script = <<-EOT |
| 38 | + export default function() { |
| 39 | + console.log('Hello from k6!'); |
| 40 | + } |
| 41 | + EOT |
| 42 | +
|
| 43 | + depends_on = [ |
| 44 | + grafana_k6_load_test.test_load_test, |
| 45 | + ] |
| 46 | +} |
| 47 | +
|
| 48 | +data "grafana_k6_load_tests" "from_project_id" { |
| 49 | + project_id = grafana_k6_project.load_test_project.id |
| 50 | +
|
| 51 | + depends_on = [ |
| 52 | + grafana_k6_load_test.test_load_test, |
| 53 | + grafana_k6_load_test.test_load_test_2 |
| 54 | + ] |
| 55 | +} |
| 56 | +
|
| 57 | +data "grafana_k6_load_tests" "filter_by_name" { |
| 58 | + name = "Terraform Test Load Test (2)" |
| 59 | + project_id = grafana_k6_project.load_test_project.id |
| 60 | +
|
| 61 | + depends_on = [ |
| 62 | + grafana_k6_load_test.test_load_test_2, |
| 63 | + ] |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +<!-- schema generated by tfplugindocs --> |
| 68 | +## Schema |
| 69 | + |
| 70 | +### Required |
| 71 | + |
| 72 | +- `project_id` (Number) The identifier of the project the load tests belong to. |
| 73 | + |
| 74 | +### Optional |
| 75 | + |
| 76 | +- `name` (String) Human-friendly identifier of the load test. |
| 77 | + |
| 78 | +### Read-Only |
| 79 | + |
| 80 | +- `id` (Number) The identifier of the project the load tests belong to. This is set to the same as the project_id. |
| 81 | +- `load_tests` (List of Object) (see [below for nested schema](#nestedatt--load_tests)) |
| 82 | + |
| 83 | +<a id="nestedatt--load_tests"></a> |
| 84 | +### Nested Schema for `load_tests` |
| 85 | + |
| 86 | +Read-Only: |
| 87 | + |
| 88 | +- `baseline_test_run_id` (Number) |
| 89 | +- `created` (String) |
| 90 | +- `id` (Number) |
| 91 | +- `name` (String) |
| 92 | +- `project_id` (Number) |
| 93 | +- `script` (String) |
| 94 | +- `updated` (String) |
0 commit comments