grafana.k6.Schedule
Manages a k6 schedule for automated test execution.
Example Usage
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
Example coming soon!
resources:
scheduleProject:
type: grafana:k6:Project
name: schedule_project
properties:
name: Terraform Schedule Resource Project
scheduledTest:
type: grafana:k6:LoadTest
name: scheduled_test
properties:
projectId: ${scheduleProject.id}
name: Terraform Scheduled Resource Test
script: |
export default function() {
console.log('Hello from scheduled k6 test!');
}
options:
dependsOn:
- ${scheduleProject}
cronMonthly:
type: grafana:k6:Schedule
name: cron_monthly
properties:
loadTestId: ${scheduledTest.id}
starts: 2024-12-25T10:00:00Z
cron:
- schedule: 0 10 1 * *
timezone: UTC
daily:
type: grafana:k6:Schedule
properties:
loadTestId: ${scheduledTest.id}
starts: 2024-12-25T10:00:00Z
recurrenceRule:
- frequency: DAILY
interval: 1
weekly:
type: grafana:k6:Schedule
properties:
loadTestId: ${scheduledTest.id}
starts: 2024-12-25T09:00:00Z
recurrenceRule:
- frequency: WEEKLY
interval: 1
bydays:
- MO
- WE
- FR
# Example with YEARLY frequency and count
yearly:
type: grafana:k6:Schedule
properties:
loadTestId: ${scheduledTest.id}
starts: 2024-01-01T12:00:00Z
recurrenceRule:
- frequency: YEARLY
interval: 1
count: 5
# One-time schedule without recurrence
oneTime:
type: grafana:k6:Schedule
name: one_time
properties:
loadTestId: ${scheduledTest.id}
starts: 2024-12-25T15:00:00Z
Create Schedule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);@overload
def Schedule(resource_name: str,
args: ScheduleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Schedule(resource_name: str,
opts: Optional[ResourceOptions] = None,
load_test_id: Optional[str] = None,
starts: Optional[str] = None,
cron: Optional[ScheduleCronArgs] = None,
recurrence_rule: Optional[ScheduleRecurrenceRuleArgs] = None)func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)
public Schedule(String name, ScheduleArgs args)
public Schedule(String name, ScheduleArgs args, CustomResourceOptions options)
type: grafana:k6:Schedule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var scheduleResource = new Grafana.K6.Schedule("scheduleResource", new()
{
LoadTestId = "string",
Starts = "string",
Cron = new Grafana.K6.Inputs.ScheduleCronArgs
{
Schedule = "string",
Timezone = "string",
},
RecurrenceRule = new Grafana.K6.Inputs.ScheduleRecurrenceRuleArgs
{
Bydays = new[]
{
"string",
},
Count = 0,
Frequency = "string",
Interval = 0,
Until = "string",
},
});
example, err := k6.NewSchedule(ctx, "scheduleResource", &k6.ScheduleArgs{
LoadTestId: pulumi.String("string"),
Starts: pulumi.String("string"),
Cron: &k6.ScheduleCronArgs{
Schedule: pulumi.String("string"),
Timezone: pulumi.String("string"),
},
RecurrenceRule: &k6.ScheduleRecurrenceRuleArgs{
Bydays: pulumi.StringArray{
pulumi.String("string"),
},
Count: pulumi.Int(0),
Frequency: pulumi.String("string"),
Interval: pulumi.Int(0),
Until: pulumi.String("string"),
},
})
var scheduleResource = new com.pulumi.grafana.k6.Schedule("scheduleResource", com.pulumi.grafana.k6.ScheduleArgs.builder()
.loadTestId("string")
.starts("string")
.cron(ScheduleCronArgs.builder()
.schedule("string")
.timezone("string")
.build())
.recurrenceRule(ScheduleRecurrenceRuleArgs.builder()
.bydays("string")
.count(0)
.frequency("string")
.interval(0)
.until("string")
.build())
.build());
schedule_resource = grafana.k6.Schedule("scheduleResource",
load_test_id="string",
starts="string",
cron={
"schedule": "string",
"timezone": "string",
},
recurrence_rule={
"bydays": ["string"],
"count": 0,
"frequency": "string",
"interval": 0,
"until": "string",
})
const scheduleResource = new grafana.k6.Schedule("scheduleResource", {
loadTestId: "string",
starts: "string",
cron: {
schedule: "string",
timezone: "string",
},
recurrenceRule: {
bydays: ["string"],
count: 0,
frequency: "string",
interval: 0,
until: "string",
},
});
type: grafana:k6:Schedule
properties:
cron:
schedule: string
timezone: string
loadTestId: string
recurrenceRule:
bydays:
- string
count: 0
frequency: string
interval: 0
until: string
starts: string
Schedule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Schedule resource accepts the following input properties:
- Load
Test stringId - The identifier of the load test to schedule.
- Starts string
- The start time for the schedule (RFC3339 format).
- Cron
Pulumiverse.
Grafana. K6. Inputs. Schedule Cron - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - Recurrence
Rule Pulumiverse.Grafana. K6. Inputs. Schedule Recurrence Rule - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set.
- Load
Test stringId - The identifier of the load test to schedule.
- Starts string
- The start time for the schedule (RFC3339 format).
- Cron
Schedule
Cron Args - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - Recurrence
Rule ScheduleRecurrence Rule Args - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set.
- load
Test StringId - The identifier of the load test to schedule.
- starts String
- The start time for the schedule (RFC3339 format).
- cron
Schedule
Cron - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - recurrence
Rule ScheduleRecurrence Rule - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set.
- load
Test stringId - The identifier of the load test to schedule.
- starts string
- The start time for the schedule (RFC3339 format).
- cron
Schedule
Cron - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - recurrence
Rule ScheduleRecurrence Rule - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set.
- load_
test_ strid - The identifier of the load test to schedule.
- starts str
- The start time for the schedule (RFC3339 format).
- cron
Schedule
Cron Args - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - recurrence_
rule ScheduleRecurrence Rule Args - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set.
- load
Test StringId - The identifier of the load test to schedule.
- starts String
- The start time for the schedule (RFC3339 format).
- cron Property Map
- The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - recurrence
Rule Property Map - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set.
Outputs
All input properties are implicitly available as output properties. Additionally, the Schedule resource produces the following output properties:
- Created
By string - The email of the user who created the schedule.
- Deactivated bool
- Whether the schedule is deactivated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Next
Run string - The next scheduled execution time.
- Created
By string - The email of the user who created the schedule.
- Deactivated bool
- Whether the schedule is deactivated.
- Id string
- The provider-assigned unique ID for this managed resource.
- Next
Run string - The next scheduled execution time.
- created
By String - The email of the user who created the schedule.
- deactivated Boolean
- Whether the schedule is deactivated.
- id String
- The provider-assigned unique ID for this managed resource.
- next
Run String - The next scheduled execution time.
- created
By string - The email of the user who created the schedule.
- deactivated boolean
- Whether the schedule is deactivated.
- id string
- The provider-assigned unique ID for this managed resource.
- next
Run string - The next scheduled execution time.
- created_
by str - The email of the user who created the schedule.
- deactivated bool
- Whether the schedule is deactivated.
- id str
- The provider-assigned unique ID for this managed resource.
- next_
run str - The next scheduled execution time.
- created
By String - The email of the user who created the schedule.
- deactivated Boolean
- Whether the schedule is deactivated.
- id String
- The provider-assigned unique ID for this managed resource.
- next
Run String - The next scheduled execution time.
Look up Existing Schedule Resource
Get an existing Schedule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ScheduleState, opts?: CustomResourceOptions): Schedule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_by: Optional[str] = None,
cron: Optional[ScheduleCronArgs] = None,
deactivated: Optional[bool] = None,
load_test_id: Optional[str] = None,
next_run: Optional[str] = None,
recurrence_rule: Optional[ScheduleRecurrenceRuleArgs] = None,
starts: Optional[str] = None) -> Schedulefunc GetSchedule(ctx *Context, name string, id IDInput, state *ScheduleState, opts ...ResourceOption) (*Schedule, error)public static Schedule Get(string name, Input<string> id, ScheduleState? state, CustomResourceOptions? opts = null)public static Schedule get(String name, Output<String> id, ScheduleState state, CustomResourceOptions options)resources: _: type: grafana:k6:Schedule get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created
By string - The email of the user who created the schedule.
- Cron
Pulumiverse.
Grafana. K6. Inputs. Schedule Cron - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - Deactivated bool
- Whether the schedule is deactivated.
- Load
Test stringId - The identifier of the load test to schedule.
- Next
Run string - The next scheduled execution time.
- Recurrence
Rule Pulumiverse.Grafana. K6. Inputs. Schedule Recurrence Rule - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - Starts string
- The start time for the schedule (RFC3339 format).
- Created
By string - The email of the user who created the schedule.
- Cron
Schedule
Cron Args - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - Deactivated bool
- Whether the schedule is deactivated.
- Load
Test stringId - The identifier of the load test to schedule.
- Next
Run string - The next scheduled execution time.
- Recurrence
Rule ScheduleRecurrence Rule Args - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - Starts string
- The start time for the schedule (RFC3339 format).
- created
By String - The email of the user who created the schedule.
- cron
Schedule
Cron - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - deactivated Boolean
- Whether the schedule is deactivated.
- load
Test StringId - The identifier of the load test to schedule.
- next
Run String - The next scheduled execution time.
- recurrence
Rule ScheduleRecurrence Rule - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - starts String
- The start time for the schedule (RFC3339 format).
- created
By string - The email of the user who created the schedule.
- cron
Schedule
Cron - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - deactivated boolean
- Whether the schedule is deactivated.
- load
Test stringId - The identifier of the load test to schedule.
- next
Run string - The next scheduled execution time.
- recurrence
Rule ScheduleRecurrence Rule - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - starts string
- The start time for the schedule (RFC3339 format).
- created_
by str - The email of the user who created the schedule.
- cron
Schedule
Cron Args - The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - deactivated bool
- Whether the schedule is deactivated.
- load_
test_ strid - The identifier of the load test to schedule.
- next_
run str - The next scheduled execution time.
- recurrence_
rule ScheduleRecurrence Rule Args - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - starts str
- The start time for the schedule (RFC3339 format).
- created
By String - The email of the user who created the schedule.
- cron Property Map
- The cron schedule to trigger the test periodically. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - deactivated Boolean
- Whether the schedule is deactivated.
- load
Test StringId - The identifier of the load test to schedule.
- next
Run String - The next scheduled execution time.
- recurrence
Rule Property Map - The schedule recurrence settings. If not specified, the test will run only once on the 'starts' date. Only one of
recurrence_ruleandcroncan be set. - starts String
- The start time for the schedule (RFC3339 format).
Supporting Types
ScheduleCron, ScheduleCronArgs
ScheduleRecurrenceRule, ScheduleRecurrenceRuleArgs
- 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, YEARLY).
- Interval int
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY). Defaults to 1.
- 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, YEARLY).
- Interval int
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY). Defaults to 1.
- 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, YEARLY).
- interval Integer
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY). Defaults to 1.
- 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, YEARLY).
- interval number
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY). Defaults to 1.
- 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, YEARLY).
- interval int
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY). Defaults to 1.
- 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, YEARLY).
- interval Number
- The interval between each frequency iteration (e.g., 2 = every 2 hours for HOURLY). Defaults to 1.
- until String
- The end time for the recurrence (RFC3339 format).
Import
$ pulumi import grafana:k6/schedule:Schedule name "{{ load_test_id }}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafanaTerraform Provider.
