Skip to content
v2.273.0

ScheduleGroup L2 construct ​

A Schedule Group.

Example ​

ts
declare const target: targets.LambdaInvoke;

const scheduleGroup = new ScheduleGroup(this, "ScheduleGroup", {
    scheduleGroupName: "MyScheduleGroup",
});

new Schedule(this, 'Schedule', {
    schedule: ScheduleExpression.rate(Duration.minutes(10)),
    target,
    scheduleGroup,
});
python
# target: targets.LambdaInvoke


schedule_group = ScheduleGroup(self, "ScheduleGroup",
    schedule_group_name="MyScheduleGroup"
)

Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.minutes(10)),
    target=target,
    schedule_group=schedule_group
)
java
LambdaInvoke target;


ScheduleGroup scheduleGroup = ScheduleGroup.Builder.create(this, "ScheduleGroup")
        .scheduleGroupName("MyScheduleGroup")
        .build();

Schedule.Builder.create(this, "Schedule")
        .schedule(ScheduleExpression.rate(Duration.minutes(10)))
        .target(target)
        .scheduleGroup(scheduleGroup)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
LambdaInvoke target;


var scheduleGroup = new ScheduleGroup(this, "ScheduleGroup", new ScheduleGroupProps {
    ScheduleGroupName = "MyScheduleGroup"
});

new Schedule(this, "Schedule", new ScheduleProps {
    Schedule = ScheduleExpression.Rate(Duration.Minutes(10)),
    Target = target,
    ScheduleGroup = scheduleGroup
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var target LambdaInvoke


scheduleGroup := awscdk.NewScheduleGroup(this, jsii.String("ScheduleGroup"), &ScheduleGroupProps{
	ScheduleGroupName: jsii.String("MyScheduleGroup"),
})

awscdk.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{
	Schedule: awscdk.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(10))),
	Target: Target,
	ScheduleGroup: ScheduleGroup,
})

Initializer ​

ts
new ScheduleGroup(scope: Construct, id: string, props?: ScheduleGroupProps)
python
ScheduleGroup(scope: Construct, id: str, props: typing.Optional[ScheduleGroupProps] = None)
java
new ScheduleGroup(Construct scope, String id, ScheduleGroupProps props)
csharp
new ScheduleGroup(Construct scope, string id, ScheduleGroupProps? props = null)
go
NewScheduleGroup(Scope Construct, Id *string, Props ScheduleGroupProps)

Construct Props ​

removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#
The removal policy for the group.

If the group is removed also all schedules are removed.

scheduleGroupNamestringschedule_group_namestrscheduleGroupNameStringScheduleGroupNamestringScheduleGroupName*string= A unique name will be generated#
The name of the schedule group.

Up to 64 letters (uppercase and lowercase), numbers, hyphens, underscores and dots are allowed.

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

Collection of grant methods for a ScheduleGroup.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
scheduleGroupArnstringschedule_group_arnstrscheduleGroupArnStringScheduleGroupArnstringScheduleGroupArn*stringrequired#
The arn of the schedule group.
scheduleGroupNamestringschedule_group_namestrscheduleGroupNameStringScheduleGroupNamestringScheduleGroupName*stringrequired#
The name of the schedule group.
scheduleGroupRefScheduleGroupReferenceschedule_group_refScheduleGroupReferencescheduleGroupRefScheduleGroupReferenceScheduleGroupRefScheduleGroupReferenceScheduleGroupRefScheduleGroupReferencerequired#
A reference to a ScheduleGroup resource.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

fromDefaultScheduleGroup(scope: Construct, id: string): IScheduleGroup@staticmethod def from_default_schedule_group(scope: Construct, id: str) -> IScheduleGrouppublic static IScheduleGroup fromDefaultScheduleGroup(Construct scope, String id)public static IScheduleGroup FromDefaultScheduleGroup(Construct scope, string id)func FromDefaultScheduleGroup(Scope Construct, Id *string) IScheduleGroupstatic#
Import a default schedule group.
2 parameters

Parameters

  • scopescopescopescopeScope — construct scope.
  • ididididId — construct id.
fromScheduleGroupArn(scope: Construct, id: string, scheduleGroupArn: string): IScheduleGroup@staticmethod def from_schedule_group_arn(scope: Construct, id: str, schedule_group_arn: str) -> IScheduleGrouppublic static IScheduleGroup fromScheduleGroupArn(Construct scope, String id, String scheduleGroupArn)public static IScheduleGroup FromScheduleGroupArn(Construct scope, string id, string scheduleGroupArn)func FromScheduleGroupArn(Scope Construct, Id *string, ScheduleGroupArn *string) IScheduleGroupstatic#
Import an external schedule group by ARN.
3 parameters

Parameters

  • scopescopescopescopeScope — construct scope.
  • ididididId — construct id.
  • scheduleGroupArnschedule_group_arnscheduleGroupArnscheduleGroupArnScheduleGroupArn — the ARN of the schedule group to import (e.g. arn:aws:scheduler:region:account-id:schedule-group/group-name).
fromScheduleGroupName(scope: Construct, id: string, scheduleGroupName: string): IScheduleGroup@staticmethod def from_schedule_group_name(scope: Construct, id: str, schedule_group_name: str) -> IScheduleGrouppublic static IScheduleGroup fromScheduleGroupName(Construct scope, String id, String scheduleGroupName)public static IScheduleGroup FromScheduleGroupName(Construct scope, string id, string scheduleGroupName)func FromScheduleGroupName(Scope Construct, Id *string, ScheduleGroupName *string) IScheduleGroupstatic#
Import an existing schedule group with a given name.
3 parameters

Parameters

  • scopescopescopescopeScope — construct scope.
  • ididididId — construct id.
  • scheduleGroupNameschedule_group_namescheduleGroupNamescheduleGroupNameScheduleGroupName — the name of the existing schedule group to import.
grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) Grant#
Grant the indicated permissions on this schedule group to the given principal [disable-awslint:no-grants].
grantDeleteSchedules(identity: IGrantable): Grantdef grant_delete_schedules(self, identity: IGrantable) -> Grantpublic Grant grantDeleteSchedules(IGrantable identity)public Grant GrantDeleteSchedules(IGrantable identity)func GrantDeleteSchedules(Identity IGrantable) Grant#
Grant delete schedule permission for schedules in this group to the given principal.

The use of this method is discouraged. Please use grants.deleteSchedules() instead.

[disable-awslint:no-grants]

grantReadSchedules(identity: IGrantable): Grantdef grant_read_schedules(self, identity: IGrantable) -> Grantpublic Grant grantReadSchedules(IGrantable identity)public Grant GrantReadSchedules(IGrantable identity)func GrantReadSchedules(Identity IGrantable) Grant#
Grant list and get schedule permissions for schedules in this group to the given principal.

The use of this method is discouraged. Please use grants.readSchedules() instead.

[disable-awslint:no-grants]

grantWriteSchedules(identity: IGrantable): Grantdef grant_write_schedules(self, identity: IGrantable) -> Grantpublic Grant grantWriteSchedules(IGrantable identity)public Grant GrantWriteSchedules(IGrantable identity)func GrantWriteSchedules(Identity IGrantable) Grant#
Grant create and update schedule permissions for schedules in this group to the given principal.

The use of this method is discouraged. Please use grants.writeSchedules() instead.

[disable-awslint:no-grants]

isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return the given named metric for this schedule group.
metricAttempts(props?: MetricOptions): Metricdef metric_attempts(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricAttempts(MetricOptions props)public Metric MetricAttempts(MetricOptions? props = null)func MetricAttempts(Props MetricOptions) Metric#
Metric for all invocation attempts.
metricDropped(props?: MetricOptions): Metricdef metric_dropped(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricDropped(MetricOptions props)public Metric MetricDropped(MetricOptions? props = null)func MetricDropped(Props MetricOptions) Metric#
Metric for dropped invocations when EventBridge Scheduler stops attempting to invoke the target after a schedule's retry policy has been exhausted.
metricFailedToBeSentToDLQ(errorCode?: string, props?: MetricOptions): Metricdef metric_failed_to_be_sent_to_dlq(self, error_code: typing.Optional[str] = None, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFailedToBeSentToDLQ(String errorCode, MetricOptions props)public Metric MetricFailedToBeSentToDLQ(string? errorCode = null, MetricOptions? props = null)func MetricFailedToBeSentToDLQ(ErrorCode *string, Props MetricOptions) Metric#
Metric for failed invocations that also failed to deliver to DLQ.
metricSentToDLQ(props?: MetricOptions): Metricdef metric_sent_to_dlq(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSentToDLQ(MetricOptions props)public Metric MetricSentToDLQ(MetricOptions? props = null)func MetricSentToDLQ(Props MetricOptions) Metric#
Metric for invocations delivered to the DLQ.
metricSentToDLQTruncated(props?: MetricOptions): Metricdef metric_sent_to_dlq_truncated(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSentToDLQTruncated(MetricOptions props)public Metric MetricSentToDLQTruncated(MetricOptions? props = null)func MetricSentToDLQTruncated(Props MetricOptions) Metric#
Metric for delivery of failed invocations to DLQ when the payload of the event sent to the DLQ exceeds the maximum size allowed by Amazon SQS.
metricTargetErrors(props?: MetricOptions): Metricdef metric_target_errors(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricTargetErrors(MetricOptions props)public Metric MetricTargetErrors(MetricOptions? props = null)func MetricTargetErrors(Props MetricOptions) Metric#
Emitted when the target returns an exception after EventBridge Scheduler calls the target API.
metricTargetThrottled(props?: MetricOptions): Metricdef metric_target_throttled(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricTargetThrottled(MetricOptions props)public Metric MetricTargetThrottled(MetricOptions? props = null)func MetricTargetThrottled(Props MetricOptions) Metric#
Metric for invocation failures due to API throttling by the target.
metricThrottled(props?: MetricOptions): Metricdef metric_throttled(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricThrottled(MetricOptions props)public Metric MetricThrottled(MetricOptions? props = null)func MetricThrottled(Props MetricOptions) Metric#
Metric for the number of invocations that were throttled because it exceeds your service quotas.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.