Class Schedule


  • public class Schedule
    extends com.pulumi.resources.CustomResource
    Provides an EventBridge Scheduler Schedule resource. You can find out more about EventBridge Scheduler in the [User Guide](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html). > **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.ArrayList;
     import java.util.Arrays;
     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()
                 .flexibleTimeWindow(ScheduleFlexibleTimeWindowArgs.builder()
                     .mode("OFF")
                     .build())
                 .target(ScheduleTargetArgs.builder()
                     .arn(exampleAwsSqsQueue.arn())
                     .roleArn(exampleAwsIamRole.arn())
                     .build())
                 .name("my-schedule")
                 .groupName("default")
                 .scheduleExpression("rate(1 hours)")
                 .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.ArrayList;
     import java.util.Arrays;
     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 Queue("example");
     
             var exampleSchedule = new Schedule("exampleSchedule", ScheduleArgs.builder()
                 .flexibleTimeWindow(ScheduleFlexibleTimeWindowArgs.builder()
                     .mode("OFF")
                     .build())
                 .target(ScheduleTargetArgs.builder()
                     .arn("arn:aws:scheduler:::aws-sdk:sqs:sendMessage")
                     .roleArn(exampleAwsIamRole.arn())
                     .input(example.url().applyValue(_url -> serializeJson(
                         jsonObject(
                             jsonProperty("MessageBody", "Greetings, programs!"),
                             jsonProperty("QueueUrl", _url)
                         ))))
                     .build())
                 .name("my-schedule")
                 .scheduleExpression("rate(1 hours)")
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `groupName` - (String) Name of the schedule group. * `name` - (String) Name of the schedule. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import schedules using the combination `group_name/name`. For example: ```sh $ pulumi import aws:scheduler/schedule:Schedule example my-schedule-group/my-schedule ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Schedule​(java.lang.String name)  
      Schedule​(java.lang.String name, ScheduleArgs args)  
      Schedule​(java.lang.String name, ScheduleArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> actionAfterCompletion()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> endDate()  
      com.pulumi.core.Output<ScheduleFlexibleTimeWindow> flexibleTimeWindow()  
      static Schedule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ScheduleState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> groupName()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyArn()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> namePrefix()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> scheduleExpression()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> scheduleExpressionTimezone()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> startDate()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> state()  
      com.pulumi.core.Output<ScheduleTarget> target()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Schedule

        public Schedule​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Schedule

        public Schedule​(java.lang.String name,
                        ScheduleArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Schedule

        public Schedule​(java.lang.String name,
                        ScheduleArgs args,
                        @Nullable
                        com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • actionAfterCompletion

        public com.pulumi.core.Output<java.lang.String> actionAfterCompletion()
        Returns:
        Action that applies to the schedule after completing invocation of the target. Valid values are `NONE` and `DELETE`. Defaults to `NONE`.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the schedule.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Brief description of the schedule.
      • endDate

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> endDate()
        Returns:
        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`.
      • flexibleTimeWindow

        public com.pulumi.core.Output<ScheduleFlexibleTimeWindow> flexibleTimeWindow()
        Returns:
        Configures a time window during which EventBridge Scheduler invokes the schedule. Detailed below.
      • groupName

        public com.pulumi.core.Output<java.lang.String> groupName()
        Returns:
        Name of the schedule group to associate with this schedule. When omitted, the `default` schedule group is used.
      • kmsKeyArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyArn()
        Returns:
        ARN for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the schedule. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
      • namePrefix

        public com.pulumi.core.Output<java.lang.String> namePrefix()
        Returns:
        Creates a unique name beginning with the specified prefix. Conflicts with `name`.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • scheduleExpression

        public com.pulumi.core.Output<java.lang.String> scheduleExpression()
        Returns:
        Defines when the schedule runs. Read more in [Schedule types on EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html).
      • scheduleExpressionTimezone

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> scheduleExpressionTimezone()
        Returns:
        Timezone in which the scheduling expression is evaluated. Defaults to `UTC`. Example: `Australia/Sydney`.
      • startDate

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> startDate()
        Returns:
        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`.
      • state

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> state()
        Returns:
        Specifies whether the schedule is enabled or disabled. One of: `ENABLED` (default), `DISABLED`.
      • target

        public com.pulumi.core.Output<ScheduleTarget> target()
        Returns:
        Configures the target of the schedule. Detailed below. The following arguments are optional:
      • get

        public static Schedule get​(java.lang.String name,
                                   com.pulumi.core.Output<java.lang.String> id,
                                   @Nullable
                                   ScheduleState state,
                                   @Nullable
                                   com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.