aws-cdk-lib.aws_applicationautoscaling.Schedule

class Schedule

LanguageType name
.NETAmazon.CDK.AWS.ApplicationAutoScaling.Schedule
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapplicationautoscaling#Schedule
Javasoftware.amazon.awscdk.services.applicationautoscaling.Schedule
Pythonaws_cdk.aws_applicationautoscaling.Schedule
TypeScript (source)aws-cdk-lib » aws_applicationautoscaling » Schedule

Schedule for scheduled scaling actions.

Example

const vpc = new ec2.Vpc(this, 'Vpc', { maxAzs: 1 });
const cluster = new ecs.Cluster(this, 'EcsCluster', { vpc });
const scheduledFargateTask = new ecsPatterns.ScheduledFargateTask(this, 'ScheduledFargateTask', {
  cluster,
  scheduledFargateTaskImageOptions: {
    image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
    memoryLimitMiB: 512,
  },
  schedule: appscaling.Schedule.expression('rate(1 minute)'),
  tags: [
    {
      key: 'my-tag',
      value: 'my-tag-value',
    },
  ],
});

Initializer

new Schedule()

Properties

NameTypeDescription
expressionStringstringRetrieve the expression for this schedule.

expressionString

Type: string

Retrieve the expression for this schedule.

Methods

NameDescription
static at(moment)Construct a Schedule from a moment in time.
static cron(options)Create a schedule from a set of cron fields.
static expression(expression)Construct a schedule from a literal schedule expression.
static rate(duration)Construct a schedule from an interval and a time unit.

static at(moment)

public static at(moment: date): Schedule

Parameters

  • moment date

Returns

  • Schedule

Construct a Schedule from a moment in time.


static cron(options)

public static cron(options: CronOptions): Schedule

Parameters

  • options CronOptions

Returns

  • Schedule

Create a schedule from a set of cron fields.


static expression(expression)

public static expression(expression: string): Schedule

Parameters

  • expression string — The expression to use.

Returns

  • Schedule

Construct a schedule from a literal schedule expression.


static rate(duration)

public static rate(duration: Duration): Schedule

Parameters

  • duration Duration

Returns

  • Schedule

Construct a schedule from an interval and a time unit.