class Group (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Scheduler.Alpha.Group |
Go | github.com/aws/aws-cdk-go/awscdkscheduleralpha/v2#Group |
Java | software.amazon.awscdk.services.scheduler.alpha.Group |
Python | aws_cdk.aws_scheduler_alpha.Group |
TypeScript (source) | @aws-cdk/aws-scheduler-alpha ยป Group |
Implements
IConstruct
, IDependable
, IResource
, IGroup
Example
declare const target: targets.LambdaInvoke;
const group = new Group(this, "Group", {
groupName: "MyGroup",
});
new Schedule(this, 'Schedule', {
schedule: ScheduleExpression.rate(Duration.minutes(10)),
target,
group,
});
Initializer
new Group(scope: Construct, id: string, props: GroupProps)
Parameters
- scope
Construct
- id
string
- props
Group
Props
Construct Props
Name | Type | Description |
---|---|---|
group | string | The name of the schedule group. |
removal | Removal | The removal policy for the group. |
groupName?
Type:
string
(optional, default: 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.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.RETAIN)
The removal policy for the group.
If the group is removed also all schedules are removed.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
group | string | The arn of the schedule group. |
group | string | The name of the schedule group. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
groupArn
Type:
string
The arn of the schedule group.
groupName
Type:
string
The name of the schedule group.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
grant(grantee, ...actions) | Grant the indicated permissions on this group to the given principal. |
grant | Grant delete schedule permission for schedules in this group to the given principal. |
grant | Grant list and get schedule permissions for schedules in this group to the given principal. |
grant | Grant create and update schedule permissions for schedules in this group to the given principal. |
metric(metricName, props?) | Return the given named metric for this group schedules. |
metric | Metric for all invocation attempts. |
metric | Metric for dropped invocations when EventBridge Scheduler stops attempting to invoke the target after a schedule's retry policy has been exhausted. |
metric | Metric for failed invocations that also failed to deliver to DLQ. |
metric | Metric for invocations delivered to the DLQ. |
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. |
metric | Emitted when the target returns an exception after EventBridge Scheduler calls the target API. |
metric | Metric for invocation failures due to API throttling by the target. |
metric | Metric for the number of invocations that were throttled because it exceeds your service quotas. |
to | Returns a string representation of this construct. |
static from | Import a default schedule group. |
static from | Import an external group by ARN. |
static from | Import an existing group with a given name. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
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
).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantable
- actions
string
Returns
Grant the indicated permissions on this group to the given principal.
DeleteSchedules(identity)
grantpublic grantDeleteSchedules(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Grant delete schedule permission for schedules in this group to the given principal.
ReadSchedules(identity)
grantpublic grantReadSchedules(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Grant list and get schedule permissions for schedules in this group to the given principal.
WriteSchedules(identity)
grantpublic grantWriteSchedules(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Grant create and update schedule permissions for schedules in this group to the given principal.
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string
- props
Metric
Options
Returns
Return the given named metric for this group schedules.
Attempts(props?)
metricpublic metricAttempts(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for all invocation attempts.
Dropped(props?)
metricpublic metricDropped(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for dropped invocations when EventBridge Scheduler stops attempting to invoke the target after a schedule's retry policy has been exhausted.
FailedToBeSentToDLQ(errorCode?, props?)
metricpublic metricFailedToBeSentToDLQ(errorCode?: string, props?: MetricOptions): Metric
Parameters
- errorCode
string
- props
Metric
Options
Returns
Metric for failed invocations that also failed to deliver to DLQ.
SentToDLQ(props?)
metricpublic metricSentToDLQ(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for invocations delivered to the DLQ.
SentToDLQTruncated(props?)
metricpublic metricSentToDLQTruncated(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
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.
TargetErrors(props?)
metricpublic metricTargetErrors(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Emitted when the target returns an exception after EventBridge Scheduler calls the target API.
TargetThrottled(props?)
metricpublic metricTargetThrottled(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for invocation failures due to API throttling by the target.
Throttled(props?)
metricpublic metricThrottled(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of invocations that were throttled because it exceeds your service quotas.
See also: https://docs.aws.amazon.com/scheduler/latest/UserGuide/scheduler-quotas.html
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
DefaultGroup(scope, id)
static frompublic static fromDefaultGroup(scope: Construct, id: string): IGroup
Parameters
- scope
Construct
โ construct scope. - id
string
โ construct id.
Returns
Import a default schedule group.
GroupArn(scope, id, groupArn)
static frompublic static fromGroupArn(scope: Construct, id: string, groupArn: string): IGroup
Parameters
- scope
Construct
โ construct scope. - id
string
โ construct id. - groupArn
string
โ the ARN of the group to import (e.g.arn:aws:scheduler:region:account-id:schedule-group/group-name
).
Returns
Import an external group by ARN.
GroupName(scope, id, groupName)
static frompublic static fromGroupName(scope: Construct, id: string, groupName: string): IGroup
Parameters
- scope
Construct
โ construct scope. - id
string
โ construct id. - groupName
string
โ the name of the existing group to import.
Returns
Import an existing group with a given name.