Grafana v2.14.1 published on Thursday, Nov 6, 2025 by pulumiverse
grafana.k6.getSchedule
Start a Neo task
Explain and create a grafana.k6.getSchedule resource
Retrieves a k6 schedule.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const scheduleProject = new grafana.k6.Project("schedule_project", {name: "Terraform Schedule Test Project"});
const scheduleLoadTest = new grafana.k6.LoadTest("schedule_load_test", {
projectId: scheduleProject.id,
name: "Terraform Test Load Test for Schedule",
script: `export default function() {
console.log('Hello from k6 schedule test!');
}
`,
}, {
dependsOn: [scheduleProject],
});
const testSchedule = new grafana.k6.Schedule("test_schedule", {
loadTestId: scheduleLoadTest.id,
starts: "2024-12-25T10:00:00Z",
recurrenceRule: {
frequency: "MONTHLY",
interval: 12,
count: 100,
},
}, {
dependsOn: [scheduleLoadTest],
});
const fromLoadTest = grafana.k6.getScheduleOutput({
loadTestId: scheduleLoadTest.id,
});
export const completeScheduleInfo = {
id: fromLoadTest.apply(fromLoadTest => fromLoadTest.id),
loadTestId: fromLoadTest.apply(fromLoadTest => fromLoadTest.loadTestId),
starts: fromLoadTest.apply(fromLoadTest => fromLoadTest.starts),
deactivated: fromLoadTest.apply(fromLoadTest => fromLoadTest.deactivated),
nextRun: fromLoadTest.apply(fromLoadTest => fromLoadTest.nextRun),
createdBy: fromLoadTest.apply(fromLoadTest => fromLoadTest.createdBy),
recurrenceRule: fromLoadTest.apply(fromLoadTest => fromLoadTest.recurrenceRule),
cron: fromLoadTest.apply(fromLoadTest => fromLoadTest.cron),
};
import pulumi
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana
schedule_project = grafana.k6.Project("schedule_project", name="Terraform Schedule Test Project")
schedule_load_test = grafana.k6.LoadTest("schedule_load_test",
project_id=schedule_project.id,
name="Terraform Test Load Test for Schedule",
script="""export default function() {
console.log('Hello from k6 schedule test!');
}
""",
opts = pulumi.ResourceOptions(depends_on=[schedule_project]))
test_schedule = grafana.k6.Schedule("test_schedule",
load_test_id=schedule_load_test.id,
starts="2024-12-25T10:00:00Z",
recurrence_rule={
"frequency": "MONTHLY",
"interval": 12,
"count": 100,
},
opts = pulumi.ResourceOptions(depends_on=[schedule_load_test]))
from_load_test = grafana.k6.get_schedule_output(load_test_id=schedule_load_test.id)
pulumi.export("completeScheduleInfo", {
"id": from_load_test.id,
"loadTestId": from_load_test.load_test_id,
"starts": from_load_test.starts,
"deactivated": from_load_test.deactivated,
"nextRun": from_load_test.next_run,
"createdBy": from_load_test.created_by,
"recurrenceRule": from_load_test.recurrence_rule,
"cron": from_load_test.cron,
})
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/k6"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
scheduleProject, err := k6.NewProject(ctx, "schedule_project", &k6.ProjectArgs{
Name: pulumi.String("Terraform Schedule Test Project"),
})
if err != nil {
return err
}
scheduleLoadTest, err := k6.NewLoadTest(ctx, "schedule_load_test", &k6.LoadTestArgs{
ProjectId: scheduleProject.ID(),
Name: pulumi.String("Terraform Test Load Test for Schedule"),
Script: pulumi.String("export default function() {\n console.log('Hello from k6 schedule test!');\n}\n"),
}, pulumi.DependsOn([]pulumi.Resource{
scheduleProject,
}))
if err != nil {
return err
}
_, err = k6.NewSchedule(ctx, "test_schedule", &k6.ScheduleArgs{
LoadTestId: scheduleLoadTest.ID(),
Starts: pulumi.String("2024-12-25T10:00:00Z"),
RecurrenceRule: &k6.ScheduleRecurrenceRuleArgs{
Frequency: pulumi.String("MONTHLY"),
Interval: pulumi.Int(12),
Count: pulumi.Int(100),
},
}, pulumi.DependsOn([]pulumi.Resource{
scheduleLoadTest,
}))
if err != nil {
return err
}
fromLoadTest := k6.LookupScheduleOutput(ctx, k6.GetScheduleOutputArgs{
LoadTestId: scheduleLoadTest.ID(),
}, nil)
ctx.Export("completeScheduleInfo", pulumi.Map{
"id": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (*string, error) {
return &fromLoadTest.Id, nil
}).(pulumi.StringPtrOutput),
"loadTestId": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (*string, error) {
return &fromLoadTest.LoadTestId, nil
}).(pulumi.StringPtrOutput),
"starts": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (*string, error) {
return &fromLoadTest.Starts, nil
}).(pulumi.StringPtrOutput),
"deactivated": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (*bool, error) {
return &fromLoadTest.Deactivated, nil
}).(pulumi.BoolPtrOutput),
"nextRun": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (*string, error) {
return &fromLoadTest.NextRun, nil
}).(pulumi.StringPtrOutput),
"createdBy": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (*string, error) {
return &fromLoadTest.CreatedBy, nil
}).(pulumi.StringPtrOutput),
"recurrenceRule": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (k6.GetScheduleRecurrenceRule, error) {
return fromLoadTest.RecurrenceRule, nil
}).(k6.GetScheduleRecurrenceRuleOutput),
"cron": fromLoadTest.ApplyT(func(fromLoadTest k6.GetScheduleResult) (k6.GetScheduleCron, error) {
return fromLoadTest.Cron, nil
}).(k6.GetScheduleCronOutput),
})
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() =>
{
var scheduleProject = new Grafana.K6.Project("schedule_project", new()
{
Name = "Terraform Schedule Test Project",
});
var scheduleLoadTest = new Grafana.K6.LoadTest("schedule_load_test", new()
{
ProjectId = scheduleProject.Id,
Name = "Terraform Test Load Test for Schedule",
Script = @"export default function() {
console.log('Hello from k6 schedule test!');
}
",
}, new CustomResourceOptions
{
DependsOn =
{
scheduleProject,
},
});
var testSchedule = new Grafana.K6.Schedule("test_schedule", new()
{
LoadTestId = scheduleLoadTest.Id,
Starts = "2024-12-25T10:00:00Z",
RecurrenceRule = new Grafana.K6.Inputs.ScheduleRecurrenceRuleArgs
{
Frequency = "MONTHLY",
Interval = 12,
Count = 100,
},
}, new CustomResourceOptions
{
DependsOn =
{
scheduleLoadTest,
},
});
var fromLoadTest = Grafana.K6.GetSchedule.Invoke(new()
{
LoadTestId = scheduleLoadTest.Id,
});
return new Dictionary<string, object?>
{
["completeScheduleInfo"] =
{
{ "id", fromLoadTest.Apply(getScheduleResult => getScheduleResult.Id) },
{ "loadTestId", fromLoadTest.Apply(getScheduleResult => getScheduleResult.LoadTestId) },
{ "starts", fromLoadTest.Apply(getScheduleResult => getScheduleResult.Starts) },
{ "deactivated", fromLoadTest.Apply(getScheduleResult => getScheduleResult.Deactivated) },
{ "nextRun", fromLoadTest.Apply(getScheduleResult => getScheduleResult.NextRun) },
{ "createdBy", fromLoadTest.Apply(getScheduleResult => getScheduleResult.CreatedBy) },
{ "recurrenceRule", fromLoadTest.Apply(getScheduleResult => getScheduleResult.RecurrenceRule) },
{ "cron", fromLoadTest.Apply(getScheduleResult => getScheduleResult.Cron) },
},
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.k6.Project;
import com.pulumi.grafana.k6.ProjectArgs;
import com.pulumi.grafana.k6.LoadTest;
import com.pulumi.grafana.k6.LoadTestArgs;
import com.pulumi.grafana.k6.Schedule;
import com.pulumi.grafana.k6.ScheduleArgs;
import com.pulumi.grafana.k6.inputs.ScheduleRecurrenceRuleArgs;
import com.pulumi.grafana.k6.K6Functions;
import com.pulumi.grafana.k6.inputs.GetScheduleArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var scheduleProject = new Project("scheduleProject", ProjectArgs.builder()
.name("Terraform Schedule Test Project")
.build());
var scheduleLoadTest = new LoadTest("scheduleLoadTest", LoadTestArgs.builder()
.projectId(scheduleProject.id())
.name("Terraform Test Load Test for Schedule")
.script("""
export default function() {
console.log('Hello from k6 schedule test!');
}
""")
.build(), CustomResourceOptions.builder()
.dependsOn(scheduleProject)
.build());
var testSchedule = new Schedule("testSchedule", ScheduleArgs.builder()
.loadTestId(scheduleLoadTest.id())
.starts("2024-12-25T10:00:00Z")
.recurrenceRule(ScheduleRecurrenceRuleArgs.builder()
.frequency("MONTHLY")
.interval(12)
.count(100)
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(scheduleLoadTest)
.build());
final var fromLoadTest = K6Functions.getSchedule(GetScheduleArgs.builder()
.loadTestId(scheduleLoadTest.id())
.build());
ctx.export("completeScheduleInfo", Map.ofEntries(
Map.entry("id", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.id())),
Map.entry("loadTestId", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.loadTestId())),
Map.entry("starts", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.starts())),
Map.entry("deactivated", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.deactivated())),
Map.entry("nextRun", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.nextRun())),
Map.entry("createdBy", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.createdBy())),
Map.entry("recurrenceRule", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.recurrenceRule())),
Map.entry("cron", fromLoadTest.applyValue(_fromLoadTest -> _fromLoadTest.cron()))
));
}
}
resources:
scheduleProject:
type: grafana:k6:Project
name: schedule_project
properties:
name: Terraform Schedule Test Project
scheduleLoadTest:
type: grafana:k6:LoadTest
name: schedule_load_test
properties:
projectId: ${scheduleProject.id}
name: Terraform Test Load Test for Schedule
script: |
export default function() {
console.log('Hello from k6 schedule test!');
}
options:
dependsOn:
- ${scheduleProject}
testSchedule:
type: grafana:k6:Schedule
name: test_schedule
properties:
loadTestId: ${scheduleLoadTest.id}
starts: 2024-12-25T10:00:00Z
recurrenceRule:
frequency: MONTHLY
interval: 12
count: 100
options:
dependsOn:
- ${scheduleLoadTest}
variables:
fromLoadTest:
fn::invoke:
function: grafana:k6:getSchedule
arguments:
loadTestId: ${scheduleLoadTest.id}
outputs:
completeScheduleInfo:
id: ${fromLoadTest.id}
loadTestId: ${fromLoadTest.loadTestId}
starts: ${fromLoadTest.starts}
deactivated: ${fromLoadTest.deactivated}
nextRun: ${fromLoadTest.nextRun}
createdBy: ${fromLoadTest.createdBy}
recurrenceRule: ${fromLoadTest.recurrenceRule}
cron: ${fromLoadTest.cron}
Using getSchedule
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSchedule(args: GetScheduleArgs, opts?: InvokeOptions): Promise<GetScheduleResult>
function getScheduleOutput(args: GetScheduleOutputArgs, opts?: InvokeOptions): Output<GetScheduleResult>def get_schedule(cron: Optional[GetScheduleCron] = None,
load_test_id: Optional[str] = None,
recurrence_rule: Optional[GetScheduleRecurrenceRule] = None,
opts: Optional[InvokeOptions] = None) -> GetScheduleResult
def get_schedule_output(cron: Optional[pulumi.Input[GetScheduleCronArgs]] = None,
load_test_id: Optional[pulumi.Input[str]] = None,
recurrence_rule: Optional[pulumi.Input[GetScheduleRecurrenceRuleArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetScheduleResult]func LookupSchedule(ctx *Context, args *LookupScheduleArgs, opts ...InvokeOption) (*LookupScheduleResult, error)
func LookupScheduleOutput(ctx *Context, args *LookupScheduleOutputArgs, opts ...InvokeOption) LookupScheduleResultOutput> Note: This function is named LookupSchedule in the Go SDK.
public static class GetSchedule
{
public static Task<GetScheduleResult> InvokeAsync(GetScheduleArgs args, InvokeOptions? opts = null)
public static Output<GetScheduleResult> Invoke(GetScheduleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetScheduleResult> getSchedule(GetScheduleArgs args, InvokeOptions options)
public static Output<GetScheduleResult> getSchedule(GetScheduleArgs args, InvokeOptions options)
fn::invoke:
function: grafana:k6/getSchedule:getSchedule
arguments:
# arguments dictionaryThe following arguments are supported:
- Load
Test stringId - The identifier of the load test to retrieve the schedule for.
- Cron
Pulumiverse.
Grafana. K6. Inputs. Get Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- Recurrence
Rule Pulumiverse.Grafana. K6. Inputs. Get Schedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- Load
Test stringId - The identifier of the load test to retrieve the schedule for.
- Cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- Recurrence
Rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- load
Test StringId - The identifier of the load test to retrieve the schedule for.
- cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence
Rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- load
Test stringId - The identifier of the load test to retrieve the schedule for.
- cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence
Rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- load_
test_ strid - The identifier of the load test to retrieve the schedule for.
- cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence_
rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- load
Test StringId - The identifier of the load test to retrieve the schedule for.
- cron Property Map
- The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence
Rule Property Map - The schedule recurrence settings. If null, the test will run only once on the starts date.
getSchedule Result
The following output properties are available:
- Created
By string - The email of the user who created the schedule.
- Deactivated bool
- Whether the schedule is deactivated.
- Id string
- Numeric identifier of the schedule.
- Load
Test stringId - The identifier of the load test to retrieve the schedule for.
- Next
Run string - The next scheduled execution time.
- Starts string
- The start time for the schedule (RFC3339 format).
- Cron
Pulumiverse.
Grafana. K6. Outputs. Get Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- Recurrence
Rule Pulumiverse.Grafana. K6. Outputs. Get Schedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- Created
By string - The email of the user who created the schedule.
- Deactivated bool
- Whether the schedule is deactivated.
- Id string
- Numeric identifier of the schedule.
- Load
Test stringId - The identifier of the load test to retrieve the schedule for.
- Next
Run string - The next scheduled execution time.
- Starts string
- The start time for the schedule (RFC3339 format).
- Cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- Recurrence
Rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- created
By String - The email of the user who created the schedule.
- deactivated Boolean
- Whether the schedule is deactivated.
- id String
- Numeric identifier of the schedule.
- load
Test StringId - The identifier of the load test to retrieve the schedule for.
- next
Run String - The next scheduled execution time.
- starts String
- The start time for the schedule (RFC3339 format).
- cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence
Rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- created
By string - The email of the user who created the schedule.
- deactivated boolean
- Whether the schedule is deactivated.
- id string
- Numeric identifier of the schedule.
- load
Test stringId - The identifier of the load test to retrieve the schedule for.
- next
Run string - The next scheduled execution time.
- starts string
- The start time for the schedule (RFC3339 format).
- cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence
Rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- created_
by str - The email of the user who created the schedule.
- deactivated bool
- Whether the schedule is deactivated.
- id str
- Numeric identifier of the schedule.
- load_
test_ strid - The identifier of the load test to retrieve the schedule for.
- next_
run str - The next scheduled execution time.
- starts str
- The start time for the schedule (RFC3339 format).
- cron
Get
Schedule Cron - The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence_
rule GetSchedule Recurrence Rule - The schedule recurrence settings. If null, the test will run only once on the starts date.
- created
By String - The email of the user who created the schedule.
- deactivated Boolean
- Whether the schedule is deactivated.
- id String
- Numeric identifier of the schedule.
- load
Test StringId - The identifier of the load test to retrieve the schedule for.
- next
Run String - The next scheduled execution time.
- starts String
- The start time for the schedule (RFC3339 format).
- cron Property Map
- The cron schedule to trigger the test periodically. If null, the test will run only once on the 'starts' date.
- recurrence
Rule Property Map - The schedule recurrence settings. If null, the test will run only once on the starts date.
Supporting Types
GetScheduleCron
GetScheduleRecurrenceRule
- Bydays List<string>
- The weekdays when the 'WEEKLY' recurrence will be applied (e.g., ['MO', 'WE', 'FR']). Cannot be set for other frequencies.
- Count int
- How many times the recurrence will repeat.
- Frequency string
- The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY).
- Interval int
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY).
- Until string
- The end time for the recurrence (RFC3339 format).
- Bydays []string
- The weekdays when the 'WEEKLY' recurrence will be applied (e.g., ['MO', 'WE', 'FR']). Cannot be set for other frequencies.
- Count int
- How many times the recurrence will repeat.
- Frequency string
- The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY).
- Interval int
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY).
- Until string
- The end time for the recurrence (RFC3339 format).
- bydays List<String>
- The weekdays when the 'WEEKLY' recurrence will be applied (e.g., ['MO', 'WE', 'FR']). Cannot be set for other frequencies.
- count Integer
- How many times the recurrence will repeat.
- frequency String
- The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY).
- interval Integer
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY).
- until String
- The end time for the recurrence (RFC3339 format).
- bydays string[]
- The weekdays when the 'WEEKLY' recurrence will be applied (e.g., ['MO', 'WE', 'FR']). Cannot be set for other frequencies.
- count number
- How many times the recurrence will repeat.
- frequency string
- The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY).
- interval number
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY).
- until string
- The end time for the recurrence (RFC3339 format).
- bydays Sequence[str]
- The weekdays when the 'WEEKLY' recurrence will be applied (e.g., ['MO', 'WE', 'FR']). Cannot be set for other frequencies.
- count int
- How many times the recurrence will repeat.
- frequency str
- The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY).
- interval int
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY).
- until str
- The end time for the recurrence (RFC3339 format).
- bydays List<String>
- The weekdays when the 'WEEKLY' recurrence will be applied (e.g., ['MO', 'WE', 'FR']). Cannot be set for other frequencies.
- count Number
- How many times the recurrence will repeat.
- frequency String
- The frequency of the schedule (HOURLY, DAILY, WEEKLY, MONTHLY).
- interval Number
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY).
- until String
- The end time for the recurrence (RFC3339 format).
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafanaTerraform Provider.
