Documentation ¶
Overview ¶
The CDK Construct Library for Amazon Scheduler
Index ¶
- func ContextAttribute_AttemptNumber() *string
- func ContextAttribute_ExecutionId() *string
- func ContextAttribute_FromName(name *string) *string
- func ContextAttribute_ScheduleArn() *string
- func ContextAttribute_ScheduledTime() *string
- func Group_IsConstruct(x interface{}) *bool
- func Group_IsOwnedResource(construct constructs.IConstruct) *bool
- func Group_IsResource(construct constructs.IConstruct) *bool
- func NewGroup_Override(g Group, scope constructs.Construct, id *string, props *GroupProps)
- func NewScheduleExpression_Override(s ScheduleExpression)
- func NewScheduleTargetInput_Override(s ScheduleTargetInput)
- func NewSchedule_Override(s Schedule, scope constructs.Construct, id *string, props *ScheduleProps)
- func Schedule_IsConstruct(x interface{}) *bool
- func Schedule_IsOwnedResource(construct constructs.IConstruct) *bool
- func Schedule_IsResource(construct constructs.IConstruct) *bool
- func Schedule_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllAttempts(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllDropped(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllFailedToBeSentToDLQ(errorCode *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllSentToDLQ(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllSentToDLQTruncated(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllTargetThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- func Schedule_MetricAllThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
- type ContextAttribute
- type CronOptionsWithTimezone
- type Group
- type GroupProps
- type IGroup
- type ISchedule
- type IScheduleTarget
- type Schedule
- type ScheduleExpression
- func ScheduleExpression_At(date *time.Time, timeZone awscdk.TimeZone) ScheduleExpression
- func ScheduleExpression_Cron(options *CronOptionsWithTimezone) ScheduleExpression
- func ScheduleExpression_Expression(expression *string, timeZone awscdk.TimeZone) ScheduleExpression
- func ScheduleExpression_Rate(duration awscdk.Duration) ScheduleExpression
- type ScheduleProps
- type ScheduleTargetConfig
- type ScheduleTargetInput
- type TimeWindow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextAttribute_AttemptNumber ¶
func ContextAttribute_AttemptNumber() *string
func ContextAttribute_ExecutionId ¶
func ContextAttribute_ExecutionId() *string
func ContextAttribute_FromName ¶
Escape hatch for other Context Attributes that may be added in the future. Experimental.
func ContextAttribute_ScheduleArn ¶
func ContextAttribute_ScheduleArn() *string
func ContextAttribute_ScheduledTime ¶
func ContextAttribute_ScheduledTime() *string
func Group_IsConstruct ¶
func Group_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
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.
Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.
func Group_IsOwnedResource ¶
func Group_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Experimental.
func Group_IsResource ¶
func Group_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func NewGroup_Override ¶
func NewGroup_Override(g Group, scope constructs.Construct, id *string, props *GroupProps)
Experimental.
func NewScheduleExpression_Override ¶
func NewScheduleExpression_Override(s ScheduleExpression)
Experimental.
func NewScheduleTargetInput_Override ¶
func NewScheduleTargetInput_Override(s ScheduleTargetInput)
Experimental.
func NewSchedule_Override ¶
func NewSchedule_Override(s Schedule, scope constructs.Construct, id *string, props *ScheduleProps)
Experimental.
func Schedule_IsConstruct ¶
func Schedule_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
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.
Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.
func Schedule_IsOwnedResource ¶
func Schedule_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise. Experimental.
func Schedule_IsResource ¶
func Schedule_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource. Experimental.
func Schedule_MetricAll ¶
func Schedule_MetricAll(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Return the given named metric for all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllAttempts ¶
func Schedule_MetricAllAttempts(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for all invocation attempts across all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllDropped ¶
func Schedule_MetricAllDropped(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for dropped invocations when EventBridge Scheduler stops attempting to invoke the target after a schedule's retry policy has been exhausted.
Metric is calculated for all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllErrors ¶
func Schedule_MetricAllErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Emitted when the target returns an exception after EventBridge Scheduler calls the target API across all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllFailedToBeSentToDLQ ¶
func Schedule_MetricAllFailedToBeSentToDLQ(errorCode *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for failed invocations that also failed to deliver to DLQ across all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllSentToDLQ ¶
func Schedule_MetricAllSentToDLQ(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for invocations delivered to the DLQ across all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllSentToDLQTruncated ¶
func Schedule_MetricAllSentToDLQTruncated(props *awscloudwatch.MetricOptions) awscloudwatch.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 is calculated for all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllTargetThrottled ¶
func Schedule_MetricAllTargetThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for invocation failures due to API throttling by the target across all schedules. Default: - sum over 5 minutes.
Experimental.
func Schedule_MetricAllThrottled ¶
func Schedule_MetricAllThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
Metric for the number of invocations that were throttled across all schedules. See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/scheduler-quotas.html
Default: - sum over 5 minutes.
Experimental.
Types ¶
type ContextAttribute ¶
type ContextAttribute interface { // Experimental. Name() *string // Convert the path to the field in the event pattern to JSON. // Experimental. ToString() *string }
A set of convenient static methods representing the Scheduler Context Attributes.
These Context Attributes keywords can be used inside a ScheduleTargetInput. See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-schedule-context-attributes.html
Experimental.
type CronOptionsWithTimezone ¶
type CronOptionsWithTimezone struct { // The day of the month to run this rule at. // Default: - Every day of the month. // // Experimental. Day *string `field:"optional" json:"day" yaml:"day"` // The hour to run this rule at. // Default: - Every hour. // // Experimental. Hour *string `field:"optional" json:"hour" yaml:"hour"` // The minute to run this rule at. // Default: - Every minute. // // Experimental. Minute *string `field:"optional" json:"minute" yaml:"minute"` // The month to run this rule at. // Default: - Every month. // // Experimental. Month *string `field:"optional" json:"month" yaml:"month"` // The day of the week to run this rule at. // Default: - Any day of the week. // // Experimental. WeekDay *string `field:"optional" json:"weekDay" yaml:"weekDay"` // The year to run this rule at. // Default: - Every year. // // Experimental. Year *string `field:"optional" json:"year" yaml:"year"` // The timezone to run the schedule in. // Default: - TimeZone.ETC_UTC // // Experimental. TimeZone awscdk.TimeZone `field:"optional" json:"timeZone" yaml:"timeZone"` }
Options to configure a cron expression.
All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.
Example:
var target lambdaInvoke rateBasedSchedule := awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(10))), Target: Target, Description: jsii.String("This is a test rate-based schedule"), }) cronBasedSchedule := awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Cron(&CronOptionsWithTimezone{ Minute: jsii.String("0"), Hour: jsii.String("23"), Day: jsii.String("20"), Month: jsii.String("11"), TimeZone: awscdk.TimeZone_AMERICA_NEW_YORK(), }), Target: Target, Description: jsii.String("This is a test cron-based schedule that will run at 11:00 PM, on day 20 of the month, only in November in New York timezone"), })
See: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions
Experimental.
type Group ¶
type Group interface { awscdk.Resource IGroup // 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. // Experimental. Env() *awscdk.ResourceEnvironment // The arn of the schedule group. // Experimental. GroupArn() *string // The name of the schedule group. // Experimental. GroupName() *string // The tree node. // Experimental. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // 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`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Grant the indicated permissions on this group to the given principal. // Experimental. Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant // Grant delete schedule permission for schedules in this group to the given principal. // Experimental. GrantDeleteSchedules(identity awsiam.IGrantable) awsiam.Grant // Grant list and get schedule permissions for schedules in this group to the given principal. // Experimental. GrantReadSchedules(identity awsiam.IGrantable) awsiam.Grant // Grant create and update schedule permissions for schedules in this group to the given principal. // Experimental. GrantWriteSchedules(identity awsiam.IGrantable) awsiam.Grant // Return the given named metric for this group schedules. // Default: - sum over 5 minutes. // // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for all invocation attempts. // Default: - sum over 5 minutes. // // Experimental. MetricAttempts(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for dropped invocations when EventBridge Scheduler stops attempting to invoke the target after a schedule's retry policy has been exhausted. // Default: - sum over 5 minutes. // // Experimental. MetricDropped(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for failed invocations that also failed to deliver to DLQ. // Default: - sum over 5 minutes. // // Experimental. MetricFailedToBeSentToDLQ(errorCode *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for invocations delivered to the DLQ. // Default: - sum over 5 minutes. // // Experimental. MetricSentToDLQ(props *awscloudwatch.MetricOptions) awscloudwatch.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. // Default: - sum over 5 minutes. // // Experimental. MetricSentToDLQTruncated(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Emitted when the target returns an exception after EventBridge Scheduler calls the target API. // Default: - sum over 5 minutes. // // Experimental. MetricTargetErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for invocation failures due to API throttling by the target. // Default: - sum over 5 minutes. // // Experimental. MetricTargetThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of invocations that were throttled because it exceeds your service quotas. // See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/scheduler-quotas.html // // Default: - sum over 5 minutes. // // Experimental. MetricThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Returns a string representation of this construct. // Experimental. ToString() *string }
Example:
var target lambdaInvoke group := awscdkscheduleralpha.NewGroup(this, jsii.String("Group"), &GroupProps{ GroupName: jsii.String("MyGroup"), }) awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(10))), Target: Target, Group: Group, })
Experimental.
func NewGroup ¶
func NewGroup(scope constructs.Construct, id *string, props *GroupProps) Group
Experimental.
type GroupProps ¶
type GroupProps struct { // The name of the schedule group. // // Up to 64 letters (uppercase and lowercase), numbers, hyphens, underscores and dots are allowed. // Default: - A unique name will be generated. // // Experimental. GroupName *string `field:"optional" json:"groupName" yaml:"groupName"` // The removal policy for the group. // // If the group is removed also all schedules are removed. // Default: RemovalPolicy.RETAIN // // Experimental. RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"` }
Example:
var target lambdaInvoke group := awscdkscheduleralpha.NewGroup(this, jsii.String("Group"), &GroupProps{ GroupName: jsii.String("MyGroup"), }) awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(10))), Target: Target, Group: Group, })
Experimental.
type IGroup ¶
type IGroup interface { awscdk.IResource // Grant the indicated permissions on this group to the given principal. // Experimental. Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant // Grant delete schedule permission for schedules in this group to the given principal. // Experimental. GrantDeleteSchedules(identity awsiam.IGrantable) awsiam.Grant // Grant list and get schedule permissions for schedules in this group to the given principal. // Experimental. GrantReadSchedules(identity awsiam.IGrantable) awsiam.Grant // Grant create and update schedule permissions for schedules in this group to the given principal. // Experimental. GrantWriteSchedules(identity awsiam.IGrantable) awsiam.Grant // Return the given named metric for this group schedules. // Default: - sum over 5 minutes. // // Experimental. Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for all invocation attempts. // Default: - sum over 5 minutes. // // Experimental. MetricAttempts(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for dropped invocations when EventBridge Scheduler stops attempting to invoke the target after a schedule's retry policy has been exhausted. // Default: - sum over 5 minutes. // // Experimental. MetricDropped(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for failed invocations that also failed to deliver to DLQ. // Default: - sum over 5 minutes. // // Experimental. MetricFailedToBeSentToDLQ(errorCode *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for invocations delivered to the DLQ. // Default: - sum over 5 minutes. // // Experimental. MetricSentToDLQ(props *awscloudwatch.MetricOptions) awscloudwatch.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. // Default: - sum over 5 minutes. // // Experimental. MetricSentToDLQTruncated(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Emitted when the target returns an exception after EventBridge Scheduler calls the target API. // Default: - sum over 5 minutes. // // Experimental. MetricTargetErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for invocation failures due to API throttling by the target. // Default: - sum over 5 minutes. // // Experimental. MetricTargetThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // Metric for the number of invocations that were throttled because it exceeds your service quotas. // See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/scheduler-quotas.html // // Default: - sum over 5 minutes. // // Experimental. MetricThrottled(props *awscloudwatch.MetricOptions) awscloudwatch.Metric // The arn of the schedule group. // Experimental. GroupArn() *string // The name of the schedule group. // Experimental. GroupName() *string }
Experimental.
func Group_FromDefaultGroup ¶
Import a default schedule group. Experimental.
func Group_FromGroupArn ¶
Import an external group by ARN. Experimental.
func Group_FromGroupName ¶
Import an existing group with a given name. Experimental.
type ISchedule ¶
type ISchedule interface { awscdk.IResource // The schedule group associated with this schedule. // Experimental. Group() IGroup // The arn of the schedule. // Experimental. ScheduleArn() *string // The name of the schedule. // Experimental. ScheduleName() *string }
Interface representing a created or an imported `Schedule`. Experimental.
type IScheduleTarget ¶
type IScheduleTarget interface { // Returns the schedule target specification. // Experimental. Bind(_schedule ISchedule) *ScheduleTargetConfig }
Interface representing a Event Bridge Schedule Target. Experimental.
type Schedule ¶
type Schedule interface { awscdk.Resource ISchedule // 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. // Experimental. Env() *awscdk.ResourceEnvironment // The schedule group associated with this schedule. // Experimental. Group() IGroup // The customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data. // Experimental. Key() awskms.IKey // The tree node. // Experimental. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. // Experimental. PhysicalName() *string // The arn of the schedule. // Experimental. ScheduleArn() *string // The name of the schedule. // Experimental. ScheduleName() *string // The stack in which this resource is defined. // Experimental. Stack() awscdk.Stack // 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`). // Experimental. ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Experimental. GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. // Experimental. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. // Experimental. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. // Experimental. ToString() *string }
An EventBridge Schedule.
Example:
import firehose "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" var deliveryStream iDeliveryStream payload := map[string]*string{ "Data": jsii.String("record"), } awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(60))), Target: targets.NewKinesisDataFirehosePutRecord(deliveryStream, &ScheduleTargetBaseProps{ Input: awscdkscheduleralpha.ScheduleTargetInput_FromObject(payload), }), })
Experimental.
func NewSchedule ¶
func NewSchedule(scope constructs.Construct, id *string, props *ScheduleProps) Schedule
Experimental.
type ScheduleExpression ¶
type ScheduleExpression interface { // Retrieve the expression for this schedule. // Experimental. ExpressionString() *string // Retrieve the expression for this schedule. // Experimental. TimeZone() awscdk.TimeZone }
ScheduleExpression for EventBridge Schedule.
You can choose from three schedule types when configuring your schedule: rate-based, cron-based, and one-time schedules. Both rate-based and cron-based schedules are recurring schedules.
Example:
import firehose "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" var deliveryStream iDeliveryStream payload := map[string]*string{ "Data": jsii.String("record"), } awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(60))), Target: targets.NewKinesisDataFirehosePutRecord(deliveryStream, &ScheduleTargetBaseProps{ Input: awscdkscheduleralpha.ScheduleTargetInput_FromObject(payload), }), })
See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html
Experimental.
func ScheduleExpression_At ¶
func ScheduleExpression_At(date *time.Time, timeZone awscdk.TimeZone) ScheduleExpression
Construct a one-time schedule from a date. Experimental.
func ScheduleExpression_Cron ¶
func ScheduleExpression_Cron(options *CronOptionsWithTimezone) ScheduleExpression
Create a recurring schedule from a set of cron fields and time zone. Experimental.
func ScheduleExpression_Expression ¶
func ScheduleExpression_Expression(expression *string, timeZone awscdk.TimeZone) ScheduleExpression
Construct a schedule from a literal schedule expression. Experimental.
func ScheduleExpression_Rate ¶
func ScheduleExpression_Rate(duration awscdk.Duration) ScheduleExpression
Construct a recurring schedule from an interval and a time unit.
Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes. Experimental.
type ScheduleProps ¶
type ScheduleProps struct { // The expression that defines when the schedule runs. // // Can be either a `at`, `rate` // or `cron` expression. // Experimental. Schedule ScheduleExpression `field:"required" json:"schedule" yaml:"schedule"` // The schedule's target details. // Experimental. Target IScheduleTarget `field:"required" json:"target" yaml:"target"` // The description you specify for the schedule. // Default: - no value. // // Experimental. Description *string `field:"optional" json:"description" yaml:"description"` // Indicates whether the schedule is enabled. // Default: true. // // Experimental. Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"` // The date, in UTC, before which the schedule can invoke its target. // // EventBridge Scheduler ignores end for one-time schedules. // Default: - no value. // // Experimental. End *time.Time `field:"optional" json:"end" yaml:"end"` // The schedule's group. // Default: - By default a schedule will be associated with the `default` group. // // Experimental. Group IGroup `field:"optional" json:"group" yaml:"group"` // The customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data. // Default: - All events in Scheduler are encrypted with a key that AWS owns and manages. // // Experimental. Key awskms.IKey `field:"optional" json:"key" yaml:"key"` // The name of the schedule. // // Up to 64 letters (uppercase and lowercase), numbers, hyphens, underscores and dots are allowed. // Default: - A unique name will be generated. // // Experimental. ScheduleName *string `field:"optional" json:"scheduleName" yaml:"scheduleName"` // The date, in UTC, after which the schedule can begin invoking its target. // // EventBridge Scheduler ignores start for one-time schedules. // Default: - no value. // // Experimental. Start *time.Time `field:"optional" json:"start" yaml:"start"` // A time window during which EventBridge Scheduler invokes the schedule. // See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-schedule-flexible-time-windows.html // // Default: TimeWindow.off() // // Experimental. TimeWindow TimeWindow `field:"optional" json:"timeWindow" yaml:"timeWindow"` }
Construction properties for `Schedule`.
Example:
import firehose "github.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha" var deliveryStream iDeliveryStream payload := map[string]*string{ "Data": jsii.String("record"), } awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Minutes(jsii.Number(60))), Target: targets.NewKinesisDataFirehosePutRecord(deliveryStream, &ScheduleTargetBaseProps{ Input: awscdkscheduleralpha.ScheduleTargetInput_FromObject(payload), }), })
Experimental.
type ScheduleTargetConfig ¶
type ScheduleTargetConfig struct { // The Amazon Resource Name (ARN) of the target. // Experimental. Arn *string `field:"required" json:"arn" yaml:"arn"` // Role to use to invoke this event target. // Experimental. Role awsiam.IRole `field:"required" json:"role" yaml:"role"` // An object that contains information about an Amazon SQS queue that EventBridge Scheduler uses as a dead-letter queue for your schedule. // // If specified, EventBridge Scheduler delivers failed events that could not be successfully delivered to a target to the queue.\ // Experimental. DeadLetterConfig *awsscheduler.CfnSchedule_DeadLetterConfigProperty `field:"optional" json:"deadLetterConfig" yaml:"deadLetterConfig"` // The templated target type for the Amazon ECS RunTask API Operation. // Experimental. EcsParameters *awsscheduler.CfnSchedule_EcsParametersProperty `field:"optional" json:"ecsParameters" yaml:"ecsParameters"` // The templated target type for the EventBridge PutEvents API operation. // Experimental. EventBridgeParameters *awsscheduler.CfnSchedule_EventBridgeParametersProperty `field:"optional" json:"eventBridgeParameters" yaml:"eventBridgeParameters"` // What input to pass to the target. // Experimental. Input ScheduleTargetInput `field:"optional" json:"input" yaml:"input"` // The templated target type for the Amazon Kinesis PutRecord API operation. // Experimental. KinesisParameters *awsscheduler.CfnSchedule_KinesisParametersProperty `field:"optional" json:"kinesisParameters" yaml:"kinesisParameters"` // A `RetryPolicy` object 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. // Experimental. RetryPolicy *awsscheduler.CfnSchedule_RetryPolicyProperty `field:"optional" json:"retryPolicy" yaml:"retryPolicy"` // The templated target type for the Amazon SageMaker StartPipelineExecution API operation. // Experimental. SageMakerPipelineParameters *awsscheduler.CfnSchedule_SageMakerPipelineParametersProperty `field:"optional" json:"sageMakerPipelineParameters" yaml:"sageMakerPipelineParameters"` // The templated target type for the Amazon SQS SendMessage API Operation. // Experimental. SqsParameters *awsscheduler.CfnSchedule_SqsParametersProperty `field:"optional" json:"sqsParameters" yaml:"sqsParameters"` }
Config of a Schedule Target used during initialization of Schedule.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import scheduler_alpha "github.com/aws/aws-cdk-go/awscdkscheduleralpha" import "github.com/aws/aws-cdk-go/awscdk" var role role var scheduleTargetInput scheduleTargetInput var tags interface{} scheduleTargetConfig := &ScheduleTargetConfig{ Arn: jsii.String("arn"), Role: role, // the properties below are optional DeadLetterConfig: &DeadLetterConfigProperty{ Arn: jsii.String("arn"), }, EcsParameters: &EcsParametersProperty{ TaskDefinitionArn: jsii.String("taskDefinitionArn"), // the properties below are optional CapacityProviderStrategy: []interface{}{ &CapacityProviderStrategyItemProperty{ CapacityProvider: jsii.String("capacityProvider"), // the properties below are optional Base: jsii.Number(123), Weight: jsii.Number(123), }, }, EnableEcsManagedTags: jsii.Boolean(false), EnableExecuteCommand: jsii.Boolean(false), Group: jsii.String("group"), LaunchType: jsii.String("launchType"), NetworkConfiguration: &NetworkConfigurationProperty{ AwsvpcConfiguration: &AwsVpcConfigurationProperty{ Subnets: []*string{ jsii.String("subnets"), }, // the properties below are optional AssignPublicIp: jsii.String("assignPublicIp"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, }, }, PlacementConstraints: []interface{}{ &PlacementConstraintProperty{ Expression: jsii.String("expression"), Type: jsii.String("type"), }, }, PlacementStrategy: []interface{}{ &PlacementStrategyProperty{ Field: jsii.String("field"), Type: jsii.String("type"), }, }, PlatformVersion: jsii.String("platformVersion"), PropagateTags: jsii.String("propagateTags"), ReferenceId: jsii.String("referenceId"), Tags: tags, TaskCount: jsii.Number(123), }, EventBridgeParameters: &EventBridgeParametersProperty{ DetailType: jsii.String("detailType"), Source: jsii.String("source"), }, Input: scheduleTargetInput, KinesisParameters: &KinesisParametersProperty{ PartitionKey: jsii.String("partitionKey"), }, RetryPolicy: &RetryPolicyProperty{ MaximumEventAgeInSeconds: jsii.Number(123), MaximumRetryAttempts: jsii.Number(123), }, SageMakerPipelineParameters: &SageMakerPipelineParametersProperty{ PipelineParameterList: []interface{}{ &SageMakerPipelineParameterProperty{ Name: jsii.String("name"), Value: jsii.String("value"), }, }, }, SqsParameters: &SqsParametersProperty{ MessageGroupId: jsii.String("messageGroupId"), }, }
Experimental.
type ScheduleTargetInput ¶
type ScheduleTargetInput interface { // Return the input properties for this input object. // Experimental. Bind(schedule ISchedule) *string }
The text or well-formed JSON input passed to the target of the schedule.
Tokens and ContextAttribute may be used in the input.
Example:
import sns "github.com/aws/aws-cdk-go/awscdk" topic := sns.NewTopic(this, jsii.String("Topic")) payload := map[string]*string{ "message": jsii.String("Hello scheduler!"), } target := targets.NewSnsPublish(topic, &ScheduleTargetBaseProps{ Input: awscdkscheduleralpha.ScheduleTargetInput_FromObject(payload), }) awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Hours(jsii.Number(1))), Target: Target, })
Experimental.
func ScheduleTargetInput_FromObject ¶
func ScheduleTargetInput_FromObject(obj interface{}) ScheduleTargetInput
Pass a JSON object to the target.
The object will be transformed into a well-formed JSON string in the final template. Experimental.
func ScheduleTargetInput_FromText ¶
func ScheduleTargetInput_FromText(text *string) ScheduleTargetInput
Pass simple text to the target.
For passing complex values like JSON object to a target use method `ScheduleTargetInput.fromObject()` instead. Experimental.
type TimeWindow ¶
type TimeWindow interface { // The maximum time window during which the schedule can be invoked. // // Must be between 1 to 1440 minutes. // Default: - no value. // // Experimental. MaxWindow() awscdk.Duration // Determines whether the schedule is invoked within a flexible time window. // Experimental. Mode() *string }
A time window during which EventBridge Scheduler invokes the schedule.
Example:
var target lambdaInvoke schedule := awscdkscheduleralpha.NewSchedule(this, jsii.String("Schedule"), &ScheduleProps{ Schedule: awscdkscheduleralpha.ScheduleExpression_Rate(awscdk.Duration_Hours(jsii.Number(12))), Target: Target, TimeWindow: awscdkscheduleralpha.TimeWindow_Flexible(awscdk.Duration_*Hours(jsii.Number(10))), })
Experimental.
func TimeWindow_Flexible ¶
func TimeWindow_Flexible(maxWindow awscdk.Duration) TimeWindow
TimeWindow is enabled. Experimental.
Source Files ¶
- ContextAttribute.go
- ContextAttribute__checks.go
- CronOptionsWithTimezone.go
- Group.go
- GroupProps.go
- Group__checks.go
- IGroup.go
- IGroup__checks.go
- ISchedule.go
- IScheduleTarget.go
- IScheduleTarget__checks.go
- Schedule.go
- ScheduleExpression.go
- ScheduleExpression__checks.go
- ScheduleProps.go
- ScheduleTargetConfig.go
- ScheduleTargetInput.go
- ScheduleTargetInput__checks.go
- Schedule__checks.go
- TimeWindow.go
- TimeWindow__checks.go
- main.go