class Group (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Scheduler.Alpha.Group |
![]() | github.com/aws/aws-cdk-go/awscdkscheduleralpha/v2#Group |
![]() | software.amazon.awscdk.services.scheduler.alpha.Group |
![]() | aws_cdk.aws_scheduler_alpha.Group |
![]() | @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. |
applyRemovalPolicy(policy)
public 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.
grantDeleteSchedules(identity)
public grantDeleteSchedules(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Grant delete schedule permission for schedules in this group to the given principal.
grantReadSchedules(identity)
public grantReadSchedules(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Grant list and get schedule permissions for schedules in this group to the given principal.
grantWriteSchedules(identity)
public 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.
metricAttempts(props?)
public metricAttempts(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for all invocation attempts.
metricDropped(props?)
public 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.
metricFailedToBeSentToDLQ(errorCode?, props?)
public metricFailedToBeSentToDLQ(errorCode?: string, props?: MetricOptions): Metric
Parameters
- errorCode
string
- props
Metric
Options
Returns
Metric for failed invocations that also failed to deliver to DLQ.
metricSentToDLQ(props?)
public metricSentToDLQ(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for invocations delivered to the DLQ.
metricSentToDLQTruncated(props?)
public 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.
metricTargetErrors(props?)
public metricTargetErrors(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Emitted when the target returns an exception after EventBridge Scheduler calls the target API.
metricTargetThrottled(props?)
public metricTargetThrottled(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for invocation failures due to API throttling by the target.
metricThrottled(props?)
public 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
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromDefaultGroup(scope, id)
public static fromDefaultGroup(scope: Construct, id: string): IGroup
Parameters
- scope
Construct
โ construct scope. - id
string
โ construct id.
Returns
Import a default schedule group.
static fromGroupArn(scope, id, groupArn)
public 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.
static fromGroupName(scope, id, groupName)
public 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.