Class CfnSchedule
- All Implemented Interfaces:
IInspectable,IScheduleRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
Every schedule has a schedule expression that determines when, and with what frequency, the schedule runs. EventBridge Scheduler supports three types of schedules: rate, cron, and one-time schedules. For more information about different schedule types, see Schedule types in the EventBridge Scheduler User Guide .
When you create a schedule, you configure a target for the schedule to invoke. A target is an API operation that EventBridge Scheduler calls on your behalf every time your schedule runs. EventBridge Scheduler supports two types of targets: templated targets invoke common API operations across a core groups of services, and customizeable universal targets that you can use to call more than 6,000 operations across over 270 services. For more information about configuring targets, see Managing targets in the EventBridge Scheduler User Guide .
For more information about managing schedules, changing the schedule state, setting up flexible time windows, and configuring a dead-letter queue for a schedule, see Managing a schedule in the EventBridge Scheduler User Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.scheduler.*;
Object tags;
CfnSchedule cfnSchedule = CfnSchedule.Builder.create(this, "MyCfnSchedule")
.flexibleTimeWindow(FlexibleTimeWindowProperty.builder()
.mode("mode")
// the properties below are optional
.maximumWindowInMinutes(123)
.build())
.scheduleExpression("scheduleExpression")
.target(TargetProperty.builder()
.arn("arn")
.roleArn("roleArn")
// the properties below are optional
.deadLetterConfig(DeadLetterConfigProperty.builder()
.arn("arn")
.build())
.ecsParameters(EcsParametersProperty.builder()
.taskDefinitionArn("taskDefinitionArn")
// the properties below are optional
.capacityProviderStrategy(List.of(CapacityProviderStrategyItemProperty.builder()
.capacityProvider("capacityProvider")
// the properties below are optional
.base(123)
.weight(123)
.build()))
.enableEcsManagedTags(false)
.enableExecuteCommand(false)
.group("group")
.launchType("launchType")
.networkConfiguration(NetworkConfigurationProperty.builder()
.awsvpcConfiguration(AwsVpcConfigurationProperty.builder()
.subnets(List.of("subnets"))
// the properties below are optional
.assignPublicIp("assignPublicIp")
.securityGroups(List.of("securityGroups"))
.build())
.build())
.placementConstraints(List.of(PlacementConstraintProperty.builder()
.expression("expression")
.type("type")
.build()))
.placementStrategy(List.of(PlacementStrategyProperty.builder()
.field("field")
.type("type")
.build()))
.platformVersion("platformVersion")
.propagateTags("propagateTags")
.referenceId("referenceId")
.tags(tags)
.taskCount(123)
.build())
.eventBridgeParameters(EventBridgeParametersProperty.builder()
.detailType("detailType")
.source("source")
.build())
.input("input")
.kinesisParameters(KinesisParametersProperty.builder()
.partitionKey("partitionKey")
.build())
.retryPolicy(RetryPolicyProperty.builder()
.maximumEventAgeInSeconds(123)
.maximumRetryAttempts(123)
.build())
.sageMakerPipelineParameters(SageMakerPipelineParametersProperty.builder()
.pipelineParameterList(List.of(SageMakerPipelineParameterProperty.builder()
.name("name")
.value("value")
.build()))
.build())
.sqsParameters(SqsParametersProperty.builder()
.messageGroupId("messageGroupId")
.build())
.build())
// the properties below are optional
.description("description")
.endDate("endDate")
.groupName("groupName")
.kmsKeyArn("kmsKeyArn")
.name("name")
.scheduleExpressionTimezone("scheduleExpressionTimezone")
.startDate("startDate")
.state("state")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis structure specifies the VPC subnets and security groups for the task, and whether a public IP address is to be used.static final classA fluent builder forCfnSchedule.static interfaceThe details of a capacity provider strategy.static interfaceAn object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule.static interfaceThe templated target type for the Amazon ECSRunTaskAPI operation.static interfaceThe templated target type for the EventBridgePutEventsAPI operation.static interfaceAllows you to configure a time window during which EventBridge Scheduler invokes the schedule.static interfaceThe templated target type for the Amazon KinesisPutRecordAPI operation.static interfaceSpecifies the network configuration for an ECS task.static interfaceAn object representing a constraint on task placement.static interfaceThe task placement strategy for a task or service.static interfaceARetryPolicyobject that includes information about the retry policy settings, including the maximum age of an event, and the maximum number of times EventBridge Scheduler will try to deliver the event to a target.static interfaceThe name and value pair of a parameter to use to start execution of a SageMaker Model Building Pipeline.static interfaceThe templated target type for the Amazon SageMakerStartPipelineExecutionAPI operation.static interfaceThe templated target type for the Amazon SQSSendMessageAPI operation.static interfaceThe schedule's target.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.scheduler.IScheduleRef
IScheduleRef.Jsii$Default, IScheduleRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnSchedule(software.amazon.jsii.JsiiObjectRef objRef) CfnSchedule(software.constructs.Construct scope, String id, CfnScheduleProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IScheduleReffromScheduleArn(software.constructs.Construct scope, String id, String arn) Creates a new IScheduleRef from an ARN.The Amazon Resource Name (ARN) for the Amazon EventBridge Scheduler schedule.The description you specify for the schedule.The date, in UTC, before which the schedule can invoke its target.Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.The name of the schedule group associated with this schedule.The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.getName()The name of the schedule.The expression that defines when the schedule runs.The timezone in which the scheduling expression is evaluated.A reference to a Schedule resource.The date, in UTC, after which the schedule can begin invoking its target.getState()Specifies whether the schedule is enabled or disabled.The schedule's target details.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDescription(String value) The description you specify for the schedule.voidsetEndDate(String value) The date, in UTC, before which the schedule can invoke its target.voidsetFlexibleTimeWindow(IResolvable value) Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.voidAllows you to configure a time window during which EventBridge Scheduler invokes the schedule.voidsetGroupName(String value) The name of the schedule group associated with this schedule.voidsetKmsKeyArn(String value) The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.voidThe name of the schedule.voidsetScheduleExpression(String value) The expression that defines when the schedule runs.voidThe timezone in which the scheduling expression is evaluated.voidsetStartDate(String value) The date, in UTC, after which the schedule can begin invoking its target.voidSpecifies whether the schedule is enabled or disabled.voidsetTarget(IResolvable value) The schedule's target details.voidThe schedule's target details.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnSchedule
protected CfnSchedule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnSchedule
protected CfnSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnSchedule
@Stability(Stable) public CfnSchedule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnScheduleProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromScheduleArn
@Stability(Stable) @NotNull public static IScheduleRef fromScheduleArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IScheduleRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) for the Amazon EventBridge Scheduler schedule. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getScheduleRef
A reference to a Schedule resource.- Specified by:
getScheduleRefin interfaceIScheduleRef
-
getFlexibleTimeWindow
Allows you to configure a time window during which EventBridge Scheduler invokes the schedule. -
setFlexibleTimeWindow
Allows you to configure a time window during which EventBridge Scheduler invokes the schedule. -
setFlexibleTimeWindow
@Stability(Stable) public void setFlexibleTimeWindow(@NotNull CfnSchedule.FlexibleTimeWindowProperty value) Allows you to configure a time window during which EventBridge Scheduler invokes the schedule. -
getScheduleExpression
The expression that defines when the schedule runs.The following formats are supported.
-
setScheduleExpression
The expression that defines when the schedule runs.The following formats are supported.
-
getTarget
The schedule's target details. -
setTarget
The schedule's target details. -
setTarget
The schedule's target details. -
getDescription
The description you specify for the schedule. -
setDescription
The description you specify for the schedule. -
getEndDate
The date, in UTC, before which the schedule can invoke its target. -
setEndDate
The date, in UTC, before which the schedule can invoke its target. -
getGroupName
The name of the schedule group associated with this schedule. -
setGroupName
The name of the schedule group associated with this schedule. -
getKmsKeyArn
The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data. -
setKmsKeyArn
The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data. -
getName
The name of the schedule. -
setName
The name of the schedule. -
getScheduleExpressionTimezone
The timezone in which the scheduling expression is evaluated. -
setScheduleExpressionTimezone
The timezone in which the scheduling expression is evaluated. -
getStartDate
The date, in UTC, after which the schedule can begin invoking its target. -
setStartDate
The date, in UTC, after which the schedule can begin invoking its target. -
getState
Specifies whether the schedule is enabled or disabled. -
setState
Specifies whether the schedule is enabled or disabled.
-