Schedule

class Schedule : KotlinCustomResource

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

Properties

Link copied to clipboard
val arn: Output<String>

ARN of the target of this schedule, such as a SQS queue or ECS cluster. For universal targets, this is a Service ARN specific to the target service.

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

Brief description of the schedule.

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

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>

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

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

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>

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>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

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

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>?

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

Link copied to clipboard
val target: Output<ScheduleTarget>

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

Link copied to clipboard
val urn: Output<String>