ScheduleArgs

data class ScheduleArgs(val description: Output<String>? = null, val endDate: Output<String>? = null, val flexibleTimeWindow: Output<ScheduleFlexibleTimeWindowArgs>? = null, val groupName: Output<String>? = null, val kmsKeyArn: Output<String>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val scheduleExpression: Output<String>? = null, val scheduleExpressionTimezone: Output<String>? = null, val startDate: Output<String>? = null, val state: Output<String>? = null, val target: Output<ScheduleTargetArgs>? = null) : ConvertibleToJava<ScheduleArgs>

Provides an EventBridge Scheduler Schedule resource. You can find out more about EventBridge Scheduler in the User Guide.

Note: EventBridge was formerly known as CloudWatch Events. The functionality is identical.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.scheduler.Schedule;
import com.pulumi.aws.scheduler.ScheduleArgs;
import com.pulumi.aws.scheduler.inputs.ScheduleFlexibleTimeWindowArgs;
import com.pulumi.aws.scheduler.inputs.ScheduleTargetArgs;
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 example = new Schedule("example", ScheduleArgs.builder()
.groupName("default")
.flexibleTimeWindow(ScheduleFlexibleTimeWindowArgs.builder()
.mode("OFF")
.build())
.scheduleExpression("rate(1 hour)")
.target(ScheduleTargetArgs.builder()
.arn(aws_sqs_queue.example().arn())
.roleArn(aws_iam_role.example().arn())
.build())
.build());
}
}

Universal Target

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sqs.Queue;
import com.pulumi.aws.scheduler.Schedule;
import com.pulumi.aws.scheduler.ScheduleArgs;
import com.pulumi.aws.scheduler.inputs.ScheduleFlexibleTimeWindowArgs;
import com.pulumi.aws.scheduler.inputs.ScheduleTargetArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 exampleQueue = new Queue("exampleQueue");
var exampleSchedule = new Schedule("exampleSchedule", ScheduleArgs.builder()
.flexibleTimeWindow(ScheduleFlexibleTimeWindowArgs.builder()
.mode("OFF")
.build())
.scheduleExpression("rate(1 hour)")
.target(ScheduleTargetArgs.builder()
.arn("arn:aws:scheduler:::aws-sdk:sqs:sendMessage")
.roleArn(aws_iam_role.example().arn())
.input(exampleQueue.url().applyValue(url -> serializeJson(
jsonObject(
jsonProperty("MessageBody", "Greetings, programs!"),
jsonProperty("QueueUrl", url)
))))
.build())
.build());
}
}

Import

Schedules can be imported using the combination group_name/name. For example

$ pulumi import aws:scheduler/schedule:Schedule example my-schedule-group/my-schedule

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, endDate: Output<String>? = null, flexibleTimeWindow: Output<ScheduleFlexibleTimeWindowArgs>? = null, groupName: Output<String>? = null, kmsKeyArn: Output<String>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, scheduleExpression: Output<String>? = null, scheduleExpressionTimezone: Output<String>? = null, startDate: Output<String>? = null, state: Output<String>? = null, target: Output<ScheduleTargetArgs>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

Brief description of the schedule.

Link copied to clipboard
val endDate: Output<String>? = null

The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the end date you specify. EventBridge Scheduler ignores the end date for one-time schedules. Example: 2030-01-01T01:00:00Z.

Link copied to clipboard

Configures a time window during which EventBridge Scheduler invokes the schedule. Detailed below.

Link copied to clipboard
val groupName: Output<String>? = null

Name of the schedule group to associate with this schedule. When omitted, the default schedule group is used.

Link copied to clipboard
val kmsKeyArn: Output<String>? = null

ARN for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.

Link copied to clipboard
val name: Output<String>? = null

Name of the schedule. If omitted, the provider will assign a random, unique name. Conflicts with name_prefix.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with name.

Link copied to clipboard
val scheduleExpression: Output<String>? = null

Defines when the schedule runs. Read more in Schedule types on EventBridge Scheduler.

Link copied to clipboard
val scheduleExpressionTimezone: Output<String>? = null

Timezone in which the scheduling expression is evaluated. Defaults to UTC. Example: Australia/Sydney.

Link copied to clipboard
val startDate: Output<String>? = null

The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the start date you specify. EventBridge Scheduler ignores the start date for one-time schedules. Example: 2030-01-01T01:00:00Z.

Link copied to clipboard
val state: Output<String>? = null

Specifies whether the schedule is enabled or disabled. One of: ENABLED (default), DISABLED.

Link copied to clipboard
val target: Output<ScheduleTargetArgs>? = null

Configures the target of the schedule. Detailed below. The following arguments are optional:

Functions

Link copied to clipboard
open override fun toJava(): ScheduleArgs