ScheduleGroup L2 construct
A Schedule Group.
Example
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,
});
# 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
)
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();
// 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
});
// 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
new ScheduleGroup(scope: Construct, id: string, props?: ScheduleGroupProps)
ScheduleGroup(scope: Construct, id: str, props: typing.Optional[ScheduleGroupProps] = None)
new ScheduleGroup(Construct scope, String id, ScheduleGroupProps props)
new ScheduleGroup(Construct scope, string id, ScheduleGroupProps? props = null)
NewScheduleGroup(Scope Construct, Id *string, Props ScheduleGroupProps)
Construct Props
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#If the group is removed also all schedules are removed.
scheduleGroupNamestringschedule_group_namestrscheduleGroupNameStringScheduleGroupNamestringScheduleGroupName*string= A unique name will be generated#Up to 64 letters (uppercase and lowercase), numbers, hyphens, underscores and dots are allowed.
Properties
envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#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.
grantsScheduleGroupGrantsgrantsScheduleGroupGrantsgrantsScheduleGroupGrantsGrantsScheduleGroupGrantsGrantsScheduleGroupGrantsrequired#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#scheduleGroupArnstringschedule_group_arnstrscheduleGroupArnStringScheduleGroupArnstringScheduleGroupArn*stringrequired#scheduleGroupNamestringschedule_group_namestrscheduleGroupNameStringScheduleGroupNamestringScheduleGroupName*stringrequired#scheduleGroupRefScheduleGroupReferenceschedule_group_refScheduleGroupReferencescheduleGroupRefScheduleGroupReferenceScheduleGroupRefScheduleGroupReferenceScheduleGroupRefScheduleGroupReferencerequired#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)#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)#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.