We announced the upcoming end-of-support for AWS SDK for JavaScript v2.
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Class: AWS.Scheduler

Inherits:
AWS.Service show all
Identifier:
scheduler
API Version:
2021-06-30
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

Amazon EventBridge Scheduler is a serverless scheduler that allows you to create, run, and manage tasks from one central, managed service. EventBridge Scheduler delivers your tasks reliably, with built-in mechanisms that adjust your schedules based on the availability of downstream targets. The following reference lists the available API actions, and data types for EventBridge Scheduler.

Sending a Request Using Scheduler

var scheduler = new AWS.Scheduler();
scheduler.createSchedule(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the Scheduler object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var scheduler = new AWS.Scheduler({apiVersion: '2021-06-30'});

You can also set the API version globally in AWS.config.apiVersions using the scheduler service identifier:

AWS.config.apiVersions = {
  scheduler: '2021-06-30',
  // other service API versions
};

var scheduler = new AWS.Scheduler();

Version:

  • 2021-06-30

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.Scheduler(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a Scheduler object

var scheduler = new AWS.Scheduler({apiVersion: '2021-06-30'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.Scheduler.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.Scheduler.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.Scheduler.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

  • useFipsEndpoint (Boolean)

    Enables FIPS compatible endpoints. Defaults to false.

  • useDualstackEndpoint (Boolean)

    Enables IPv6 dualstack endpoint. Defaults to false.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createSchedule(params = {}, callback) ⇒ AWS.Request

Creates the specified schedule.

Service Reference:

Examples:

Calling the createSchedule operation

var params = {
  FlexibleTimeWindow: { /* required */
    Mode: OFF | FLEXIBLE, /* required */
    MaximumWindowInMinutes: 'NUMBER_VALUE'
  },
  Name: 'STRING_VALUE', /* required */
  ScheduleExpression: 'STRING_VALUE', /* required */
  Target: { /* required */
    Arn: 'STRING_VALUE', /* required */
    RoleArn: 'STRING_VALUE', /* required */
    DeadLetterConfig: {
      Arn: 'STRING_VALUE'
    },
    EcsParameters: {
      TaskDefinitionArn: 'STRING_VALUE', /* required */
      CapacityProviderStrategy: [
        {
          capacityProvider: 'STRING_VALUE', /* required */
          base: 'NUMBER_VALUE',
          weight: 'NUMBER_VALUE'
        },
        /* more items */
      ],
      EnableECSManagedTags: true || false,
      EnableExecuteCommand: true || false,
      Group: 'STRING_VALUE',
      LaunchType: EC2 | FARGATE | EXTERNAL,
      NetworkConfiguration: {
        awsvpcConfiguration: {
          Subnets: [ /* required */
            'STRING_VALUE',
            /* more items */
          ],
          AssignPublicIp: ENABLED | DISABLED,
          SecurityGroups: [
            'STRING_VALUE',
            /* more items */
          ]
        }
      },
      PlacementConstraints: [
        {
          expression: 'STRING_VALUE',
          type: distinctInstance | memberOf
        },
        /* more items */
      ],
      PlacementStrategy: [
        {
          field: 'STRING_VALUE',
          type: random | spread | binpack
        },
        /* more items */
      ],
      PlatformVersion: 'STRING_VALUE',
      PropagateTags: TASK_DEFINITION,
      ReferenceId: 'STRING_VALUE',
      Tags: [
        {
          '<TagKey>': 'STRING_VALUE',
          /* '<TagKey>': ... */
        },
        /* more items */
      ],
      TaskCount: 'NUMBER_VALUE'
    },
    EventBridgeParameters: {
      DetailType: 'STRING_VALUE', /* required */
      Source: 'STRING_VALUE' /* required */
    },
    Input: 'STRING_VALUE',
    KinesisParameters: {
      PartitionKey: 'STRING_VALUE' /* required */
    },
    RetryPolicy: {
      MaximumEventAgeInSeconds: 'NUMBER_VALUE',
      MaximumRetryAttempts: 'NUMBER_VALUE'
    },
    SageMakerPipelineParameters: {
      PipelineParameterList: [
        {
          Name: 'STRING_VALUE', /* required */
          Value: 'STRING_VALUE' /* required */
        },
        /* more items */
      ]
    },
    SqsParameters: {
      MessageGroupId: 'STRING_VALUE'
    }
  },
  ActionAfterCompletion: NONE | DELETE,
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  EndDate: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  GroupName: 'STRING_VALUE',
  KmsKeyArn: 'STRING_VALUE',
  ScheduleExpressionTimezone: 'STRING_VALUE',
  StartDate: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  State: ENABLED | DISABLED
};
scheduler.createSchedule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ActionAfterCompletion — (String)

      Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.

      Possible values include:
      • "NONE"
      • "DELETE"
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.

      If a token is not provided, the SDK will use a version 4 UUID.
    • Description — (String)

      The description you specify for the schedule.

    • EndDate — (Date)

      The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time schedules.

    • FlexibleTimeWindow — (map)

      Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.

      • MaximumWindowInMinutes — (Integer)

        The maximum time window during which a schedule can be invoked.

      • Moderequired — (String)

        Determines whether the schedule is invoked within a flexible time window.

        Possible values include:
        • "OFF"
        • "FLEXIBLE"
    • GroupName — (String)

      The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.

    • KmsKeyArn — (String)

      The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.

    • Name — (String)

      The name of the schedule that you are creating.

    • ScheduleExpression — (String)

      The expression that defines when the schedule runs. The following formats are supported.

      • at expression - at(yyyy-mm-ddThh:mm:ss)

      • rate expression - rate(value unit)

      • cron expression - cron(fields)

      You can use at expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use rate and cron expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.

      A cron expression consists of six fields separated by white spaces: (minutes hours day_of_month month day_of_week year).

      A rate expression consists of a value as a positive integer, and a unit with the following options: minute | minutes | hour | hours | day | days

      For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.

    • ScheduleExpressionTimezone — (String)

      The timezone in which the scheduling expression is evaluated.

    • StartDate — (Date)

      The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for one-time schedules.

    • State — (String)

      Specifies whether the schedule is enabled or disabled.

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • Target — (map)

      The schedule's target.

      • Arnrequired — (String)

        The Amazon Resource Name (ARN) of the target.

      • DeadLetterConfig — (map)

        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.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.

      • EcsParameters — (map)

        The templated target type for the Amazon ECS RunTask API operation.

        • CapacityProviderStrategy — (Array<map>)

          The capacity provider strategy to use for the task.

          • base — (Integer)

            The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.

          • capacityProviderrequired — (String)

            The short name of the capacity provider.

          • weight — (Integer)

            The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.

        • EnableECSManagedTags — (Boolean)

          Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS Resources in the Amazon ECS Developer Guide.

        • EnableExecuteCommand — (Boolean)

          Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.

        • Group — (String)

          Specifies an ECS task group for the task. The maximum length is 255 characters.

        • LaunchType — (String)

          Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The FARGATE value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see AWS Fargate on Amazon ECS in the Amazon ECS Developer Guide.

          Possible values include:
          • "EC2"
          • "FARGATE"
          • "EXTERNAL"
        • NetworkConfiguration — (map)

          This structure specifies the network configuration for an ECS task.

          • awsvpcConfiguration — (map)

            Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.

            • AssignPublicIp — (String)

              Specifies whether the task's elastic network interface receives a public IP address. You can specify ENABLED only when LaunchType in EcsParameters is set to FARGATE.

              Possible values include:
              • "ENABLED"
              • "DISABLED"
            • SecurityGroups — (Array<String>)

              Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.

            • Subnetsrequired — (Array<String>)

              Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.

        • PlacementConstraints — (Array<map>)

          An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).

          • expression — (String)

            A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is distinctInstance. For more information, see Cluster query language in the Amazon ECS Developer Guide.

          • type — (String)

            The type of constraint. Use distinctInstance to ensure that each task in a particular group is running on a different container instance. Use memberOf to restrict the selection to a group of valid candidates.

            Possible values include:
            • "distinctInstance"
            • "memberOf"
        • PlacementStrategy — (Array<map>)

          The task placement strategy for a task or service.

          • field — (String)

            The field to apply the placement strategy against. For the spread placement strategy, valid values are instanceId (or instanceId, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are cpu and memory. For the random placement strategy, this field is not used.

          • type — (String)

            The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).

            Possible values include:
            • "random"
            • "spread"
            • "binpack"
        • PlatformVersion — (String)

          Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0.

        • PropagateTags — (String)

          Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's TagResource API action.

          Possible values include:
          • "TASK_DEFINITION"
        • ReferenceId — (String)

          The reference ID to use for the task.

        • Tags — (Array<map<String>>)

          The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see RunTask in the Amazon ECS API Reference.

        • TaskCount — (Integer)

          The number of tasks to create based on TaskDefinition. The default is 1.

        • TaskDefinitionArnrequired — (String)

          The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.

      • EventBridgeParameters — (map)

        The templated target type for the EventBridge PutEvents API operation.

        • DetailTyperequired — (String)

          A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.

        • Sourcerequired — (String)

          The source of the event.

      • Input — (String)

        The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.

      • KinesisParameters — (map)

        The templated target type for the Amazon Kinesis PutRecord API operation.

      • RetryPolicy — (map)

        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.

        • MaximumEventAgeInSeconds — (Integer)

          The maximum amount of time, in seconds, to continue to make retry attempts.

        • MaximumRetryAttempts — (Integer)

          The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the MaximumEventAgeInSeconds is reached.

      • RoleArnrequired — (String)

        The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.

      • SageMakerPipelineParameters — (map)

        The templated target type for the Amazon SageMaker StartPipelineExecution API operation.

        • PipelineParameterList — (Array<map>)

          List of parameter names and values to use when executing the SageMaker Model Building Pipeline.

          • Namerequired — (String)

            Name of parameter to start execution of a SageMaker Model Building Pipeline.

          • Valuerequired — (String)

            Value of parameter to start execution of a SageMaker Model Building Pipeline.

      • SqsParameters — (map)

        The templated target type for the Amazon SQS SendMessage API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see Using the Amazon SQS message deduplication ID in the Amazon SQS Developer Guide.

        • MessageGroupId — (String)

          The FIFO message group ID to use as the target.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ScheduleArn — (String)

        The Amazon Resource Name (ARN) of the schedule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createScheduleGroup(params = {}, callback) ⇒ AWS.Request

Creates the specified schedule group.

Service Reference:

Examples:

Calling the createScheduleGroup operation

var params = {
  Name: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
scheduler.createScheduleGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.

      If a token is not provided, the SDK will use a version 4 UUID.
    • Name — (String)

      The name of the schedule group that you are creating.

    • Tags — (Array<map>)

      The list of tags to associate with the schedule group.

      • Keyrequired — (String)

        The key for the tag.

      • Valuerequired — (String)

        The value for the tag.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ScheduleGroupArn — (String)

        The Amazon Resource Name (ARN) of the schedule group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteSchedule(params = {}, callback) ⇒ AWS.Request

Deletes the specified schedule.

Service Reference:

Examples:

Calling the deleteSchedule operation

var params = {
  Name: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE',
  GroupName: 'STRING_VALUE'
};
scheduler.deleteSchedule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.

      If a token is not provided, the SDK will use a version 4 UUID.
    • GroupName — (String)

      The name of the schedule group associated with this schedule. If you omit this, the default schedule group is used.

    • Name — (String)

      The name of the schedule to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteScheduleGroup(params = {}, callback) ⇒ AWS.Request

Deletes the specified schedule group. Deleting a schedule group results in EventBridge Scheduler deleting all schedules associated with the group. When you delete a group, it remains in a DELETING state until all of its associated schedules are deleted. Schedules associated with the group that are set to run while the schedule group is in the process of being deleted might continue to invoke their targets until the schedule group and its associated schedules are deleted.

Note: This operation is eventually consistent.

Service Reference:

Examples:

Calling the deleteScheduleGroup operation

var params = {
  Name: 'STRING_VALUE', /* required */
  ClientToken: 'STRING_VALUE'
};
scheduler.deleteScheduleGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.

      If a token is not provided, the SDK will use a version 4 UUID.
    • Name — (String)

      The name of the schedule group to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSchedule(params = {}, callback) ⇒ AWS.Request

Retrieves the specified schedule.

Service Reference:

Examples:

Calling the getSchedule operation

var params = {
  Name: 'STRING_VALUE', /* required */
  GroupName: 'STRING_VALUE'
};
scheduler.getSchedule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      The name of the schedule group associated with this schedule. If you omit this, EventBridge Scheduler assumes that the schedule is associated with the default group.

    • Name — (String)

      The name of the schedule to retrieve.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ActionAfterCompletion — (String)

        Indicates the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.

        Possible values include:
        • "NONE"
        • "DELETE"
      • Arn — (String)

        The Amazon Resource Name (ARN) of the schedule.

      • CreationDate — (Date)

        The time at which the schedule was created.

      • Description — (String)

        The description of the schedule.

      • EndDate — (Date)

        The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time schedules.

      • FlexibleTimeWindow — (map)

        Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.

        • MaximumWindowInMinutes — (Integer)

          The maximum time window during which a schedule can be invoked.

        • Moderequired — (String)

          Determines whether the schedule is invoked within a flexible time window.

          Possible values include:
          • "OFF"
          • "FLEXIBLE"
      • GroupName — (String)

        The name of the schedule group associated with this schedule.

      • KmsKeyArn — (String)

        The ARN for a customer managed KMS Key that is be used to encrypt and decrypt your data.

      • LastModificationDate — (Date)

        The time at which the schedule was last modified.

      • Name — (String)

        The name of the schedule.

      • ScheduleExpression — (String)

        The expression that defines when the schedule runs. The following formats are supported.

        • at expression - at(yyyy-mm-ddThh:mm:ss)

        • rate expression - rate(value unit)

        • cron expression - cron(fields)

        You can use at expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use rate and cron expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.

        A cron expression consists of six fields separated by white spaces: (minutes hours day_of_month month day_of_week year).

        A rate expression consists of a value as a positive integer, and a unit with the following options: minute | minutes | hour | hours | day | days

        For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.

      • ScheduleExpressionTimezone — (String)

        The timezone in which the scheduling expression is evaluated.

      • StartDate — (Date)

        The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for one-time schedules.

      • State — (String)

        Specifies whether the schedule is enabled or disabled.

        Possible values include:
        • "ENABLED"
        • "DISABLED"
      • Target — (map)

        The schedule target.

        • Arnrequired — (String)

          The Amazon Resource Name (ARN) of the target.

        • DeadLetterConfig — (map)

          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.

          • Arn — (String)

            The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.

        • EcsParameters — (map)

          The templated target type for the Amazon ECS RunTask API operation.

          • CapacityProviderStrategy — (Array<map>)

            The capacity provider strategy to use for the task.

            • base — (Integer)

              The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.

            • capacityProviderrequired — (String)

              The short name of the capacity provider.

            • weight — (Integer)

              The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.

          • EnableECSManagedTags — (Boolean)

            Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS Resources in the Amazon ECS Developer Guide.

          • EnableExecuteCommand — (Boolean)

            Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.

          • Group — (String)

            Specifies an ECS task group for the task. The maximum length is 255 characters.

          • LaunchType — (String)

            Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The FARGATE value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see AWS Fargate on Amazon ECS in the Amazon ECS Developer Guide.

            Possible values include:
            • "EC2"
            • "FARGATE"
            • "EXTERNAL"
          • NetworkConfiguration — (map)

            This structure specifies the network configuration for an ECS task.

            • awsvpcConfiguration — (map)

              Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.

              • AssignPublicIp — (String)

                Specifies whether the task's elastic network interface receives a public IP address. You can specify ENABLED only when LaunchType in EcsParameters is set to FARGATE.

                Possible values include:
                • "ENABLED"
                • "DISABLED"
              • SecurityGroups — (Array<String>)

                Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.

              • Subnetsrequired — (Array<String>)

                Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.

          • PlacementConstraints — (Array<map>)

            An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).

            • expression — (String)

              A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is distinctInstance. For more information, see Cluster query language in the Amazon ECS Developer Guide.

            • type — (String)

              The type of constraint. Use distinctInstance to ensure that each task in a particular group is running on a different container instance. Use memberOf to restrict the selection to a group of valid candidates.

              Possible values include:
              • "distinctInstance"
              • "memberOf"
          • PlacementStrategy — (Array<map>)

            The task placement strategy for a task or service.

            • field — (String)

              The field to apply the placement strategy against. For the spread placement strategy, valid values are instanceId (or instanceId, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are cpu and memory. For the random placement strategy, this field is not used.

            • type — (String)

              The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).

              Possible values include:
              • "random"
              • "spread"
              • "binpack"
          • PlatformVersion — (String)

            Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0.

          • PropagateTags — (String)

            Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's TagResource API action.

            Possible values include:
            • "TASK_DEFINITION"
          • ReferenceId — (String)

            The reference ID to use for the task.

          • Tags — (Array<map<String>>)

            The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see RunTask in the Amazon ECS API Reference.

          • TaskCount — (Integer)

            The number of tasks to create based on TaskDefinition. The default is 1.

          • TaskDefinitionArnrequired — (String)

            The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.

        • EventBridgeParameters — (map)

          The templated target type for the EventBridge PutEvents API operation.

          • DetailTyperequired — (String)

            A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.

          • Sourcerequired — (String)

            The source of the event.

        • Input — (String)

          The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.

        • KinesisParameters — (map)

          The templated target type for the Amazon Kinesis PutRecord API operation.

        • RetryPolicy — (map)

          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.

          • MaximumEventAgeInSeconds — (Integer)

            The maximum amount of time, in seconds, to continue to make retry attempts.

          • MaximumRetryAttempts — (Integer)

            The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the MaximumEventAgeInSeconds is reached.

        • RoleArnrequired — (String)

          The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.

        • SageMakerPipelineParameters — (map)

          The templated target type for the Amazon SageMaker StartPipelineExecution API operation.

          • PipelineParameterList — (Array<map>)

            List of parameter names and values to use when executing the SageMaker Model Building Pipeline.

            • Namerequired — (String)

              Name of parameter to start execution of a SageMaker Model Building Pipeline.

            • Valuerequired — (String)

              Value of parameter to start execution of a SageMaker Model Building Pipeline.

        • SqsParameters — (map)

          The templated target type for the Amazon SQS SendMessage API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see Using the Amazon SQS message deduplication ID in the Amazon SQS Developer Guide.

          • MessageGroupId — (String)

            The FIFO message group ID to use as the target.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getScheduleGroup(params = {}, callback) ⇒ AWS.Request

Retrieves the specified schedule group.

Service Reference:

Examples:

Calling the getScheduleGroup operation

var params = {
  Name: 'STRING_VALUE' /* required */
};
scheduler.getScheduleGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name of the schedule group to retrieve.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Arn — (String)

        The Amazon Resource Name (ARN) of the schedule group.

      • CreationDate — (Date)

        The time at which the schedule group was created.

      • LastModificationDate — (Date)

        The time at which the schedule group was last modified.

      • Name — (String)

        The name of the schedule group.

      • State — (String)

        Specifies the state of the schedule group.

        Possible values include:
        • "ACTIVE"
        • "DELETING"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listScheduleGroups(params = {}, callback) ⇒ AWS.Request

Returns a paginated list of your schedule groups.

Service Reference:

Examples:

Calling the listScheduleGroups operation

var params = {
  MaxResults: 'NUMBER_VALUE',
  NamePrefix: 'STRING_VALUE',
  NextToken: 'STRING_VALUE'
};
scheduler.listScheduleGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • MaxResults — (Integer)

      If specified, limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.

    • NamePrefix — (String)

      The name prefix that you can use to return a filtered list of your schedule groups.

    • NextToken — (String)

      The token returned by a previous call to retrieve the next set of results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NextToken — (String)

        Indicates whether there are additional results to retrieve. If the value is null, there are no more results.

      • ScheduleGroups — (Array<map>)

        The schedule groups that match the specified criteria.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the schedule group.

        • CreationDate — (Date)

          The time at which the schedule group was created.

        • LastModificationDate — (Date)

          The time at which the schedule group was last modified.

        • Name — (String)

          The name of the schedule group.

        • State — (String)

          Specifies the state of the schedule group.

          Possible values include:
          • "ACTIVE"
          • "DELETING"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listSchedules(params = {}, callback) ⇒ AWS.Request

Returns a paginated list of your EventBridge Scheduler schedules.

Service Reference:

Examples:

Calling the listSchedules operation

var params = {
  GroupName: 'STRING_VALUE',
  MaxResults: 'NUMBER_VALUE',
  NamePrefix: 'STRING_VALUE',
  NextToken: 'STRING_VALUE',
  State: ENABLED | DISABLED
};
scheduler.listSchedules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • GroupName — (String)

      If specified, only lists the schedules whose associated schedule group matches the given filter.

    • MaxResults — (Integer)

      If specified, limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.

    • NamePrefix — (String)

      Schedule name prefix to return the filtered list of resources.

    • NextToken — (String)

      The token returned by a previous call to retrieve the next set of results.

    • State — (String)

      If specified, only lists the schedules whose current state matches the given filter.

      Possible values include:
      • "ENABLED"
      • "DISABLED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • NextToken — (String)

        Indicates whether there are additional results to retrieve. If the value is null, there are no more results.

      • Schedules — (Array<map>)

        The schedules that match the specified criteria.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the schedule.

        • CreationDate — (Date)

          The time at which the schedule was created.

        • GroupName — (String)

          The name of the schedule group associated with this schedule.

        • LastModificationDate — (Date)

          The time at which the schedule was last modified.

        • Name — (String)

          The name of the schedule.

        • State — (String)

          Specifies whether the schedule is enabled or disabled.

          Possible values include:
          • "ENABLED"
          • "DISABLED"
        • Target — (map)

          The schedule's target details.

          • Arnrequired — (String)

            The Amazon Resource Name (ARN) of the target.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Lists the tags associated with the Scheduler resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  ResourceArn: 'STRING_VALUE' /* required */
};
scheduler.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArn — (String)

      The ARN of the EventBridge Scheduler resource for which you want to view tags.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Tags — (Array<map>)

        The list of tags associated with the specified resource.

        • Keyrequired — (String)

          The key for the tag.

        • Valuerequired — (String)

          The value for the tag.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

Assigns one or more tags (key-value pairs) to the specified EventBridge Scheduler resource. You can only assign tags to schedule groups.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  ResourceArn: 'STRING_VALUE', /* required */
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
scheduler.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArn — (String)

      The Amazon Resource Name (ARN) of the schedule group that you are adding tags to.

    • Tags — (Array<map>)

      The list of tags to associate with the schedule group.

      • Keyrequired — (String)

        The key for the tag.

      • Valuerequired — (String)

        The value for the tag.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Removes one or more tags from the specified EventBridge Scheduler schedule group.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  ResourceArn: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
scheduler.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArn — (String)

      The Amazon Resource Name (ARN) of the schedule group from which you are removing tags.

    • TagKeys — (Array<String>)

      The list of tag keys to remove from the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateSchedule(params = {}, callback) ⇒ AWS.Request

Updates the specified schedule. When you call UpdateSchedule, EventBridge Scheduler uses all values, including empty values, specified in the request and overrides the existing schedule. This is by design. This means that if you do not set an optional field in your request, that field will be set to its system-default value after the update.

Before calling this operation, we recommend that you call the GetSchedule API operation and make a note of all optional parameters for your UpdateSchedule call.

Service Reference:

Examples:

Calling the updateSchedule operation

var params = {
  FlexibleTimeWindow: { /* required */
    Mode: OFF | FLEXIBLE, /* required */
    MaximumWindowInMinutes: 'NUMBER_VALUE'
  },
  Name: 'STRING_VALUE', /* required */
  ScheduleExpression: 'STRING_VALUE', /* required */
  Target: { /* required */
    Arn: 'STRING_VALUE', /* required */
    RoleArn: 'STRING_VALUE', /* required */
    DeadLetterConfig: {
      Arn: 'STRING_VALUE'
    },
    EcsParameters: {
      TaskDefinitionArn: 'STRING_VALUE', /* required */
      CapacityProviderStrategy: [
        {
          capacityProvider: 'STRING_VALUE', /* required */
          base: 'NUMBER_VALUE',
          weight: 'NUMBER_VALUE'
        },
        /* more items */
      ],
      EnableECSManagedTags: true || false,
      EnableExecuteCommand: true || false,
      Group: 'STRING_VALUE',
      LaunchType: EC2 | FARGATE | EXTERNAL,
      NetworkConfiguration: {
        awsvpcConfiguration: {
          Subnets: [ /* required */
            'STRING_VALUE',
            /* more items */
          ],
          AssignPublicIp: ENABLED | DISABLED,
          SecurityGroups: [
            'STRING_VALUE',
            /* more items */
          ]
        }
      },
      PlacementConstraints: [
        {
          expression: 'STRING_VALUE',
          type: distinctInstance | memberOf
        },
        /* more items */
      ],
      PlacementStrategy: [
        {
          field: 'STRING_VALUE',
          type: random | spread | binpack
        },
        /* more items */
      ],
      PlatformVersion: 'STRING_VALUE',
      PropagateTags: TASK_DEFINITION,
      ReferenceId: 'STRING_VALUE',
      Tags: [
        {
          '<TagKey>': 'STRING_VALUE',
          /* '<TagKey>': ... */
        },
        /* more items */
      ],
      TaskCount: 'NUMBER_VALUE'
    },
    EventBridgeParameters: {
      DetailType: 'STRING_VALUE', /* required */
      Source: 'STRING_VALUE' /* required */
    },
    Input: 'STRING_VALUE',
    KinesisParameters: {
      PartitionKey: 'STRING_VALUE' /* required */
    },
    RetryPolicy: {
      MaximumEventAgeInSeconds: 'NUMBER_VALUE',
      MaximumRetryAttempts: 'NUMBER_VALUE'
    },
    SageMakerPipelineParameters: {
      PipelineParameterList: [
        {
          Name: 'STRING_VALUE', /* required */
          Value: 'STRING_VALUE' /* required */
        },
        /* more items */
      ]
    },
    SqsParameters: {
      MessageGroupId: 'STRING_VALUE'
    }
  },
  ActionAfterCompletion: NONE | DELETE,
  ClientToken: 'STRING_VALUE',
  Description: 'STRING_VALUE',
  EndDate: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  GroupName: 'STRING_VALUE',
  KmsKeyArn: 'STRING_VALUE',
  ScheduleExpressionTimezone: 'STRING_VALUE',
  StartDate: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  State: ENABLED | DISABLED
};
scheduler.updateSchedule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ActionAfterCompletion — (String)

      Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.

      Possible values include:
      • "NONE"
      • "DELETE"
    • ClientToken — (String)

      Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.

      If a token is not provided, the SDK will use a version 4 UUID.
    • Description — (String)

      The description you specify for the schedule.

    • EndDate — (Date)

      The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time schedules.

    • FlexibleTimeWindow — (map)

      Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.

      • MaximumWindowInMinutes — (Integer)

        The maximum time window during which a schedule can be invoked.

      • Moderequired — (String)

        Determines whether the schedule is invoked within a flexible time window.

        Possible values include:
        • "OFF"
        • "FLEXIBLE"
    • GroupName — (String)

      The name of the schedule group with which the schedule is associated. You must provide this value in order for EventBridge Scheduler to find the schedule you want to update. If you omit this value, EventBridge Scheduler assumes the group is associated to the default group.

    • KmsKeyArn — (String)

      The ARN for the customer managed KMS key that that you want EventBridge Scheduler to use to encrypt and decrypt your data.

    • Name — (String)

      The name of the schedule that you are updating.

    • ScheduleExpression — (String)

      The expression that defines when the schedule runs. The following formats are supported.

      • at expression - at(yyyy-mm-ddThh:mm:ss)

      • rate expression - rate(value unit)

      • cron expression - cron(fields)

      You can use at expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use rate and cron expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.

      A cron expression consists of six fields separated by white spaces: (minutes hours day_of_month month day_of_week year).

      A rate expression consists of a value as a positive integer, and a unit with the following options: minute | minutes | hour | hours | day | days

      For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.

    • ScheduleExpressionTimezone — (String)

      The timezone in which the scheduling expression is evaluated.

    • StartDate — (Date)

      The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule's recurrence expression, invocations might occur on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for one-time schedules.

    • State — (String)

      Specifies whether the schedule is enabled or disabled.

      Possible values include:
      • "ENABLED"
      • "DISABLED"
    • Target — (map)

      The schedule target. You can use this operation to change the target that your schedule invokes.

      • Arnrequired — (String)

        The Amazon Resource Name (ARN) of the target.

      • DeadLetterConfig — (map)

        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.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the SQS queue specified as the destination for the dead-letter queue.

      • EcsParameters — (map)

        The templated target type for the Amazon ECS RunTask API operation.

        • CapacityProviderStrategy — (Array<map>)

          The capacity provider strategy to use for the task.

          • base — (Integer)

            The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.

          • capacityProviderrequired — (String)

            The short name of the capacity provider.

          • weight — (Integer)

            The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.

        • EnableECSManagedTags — (Boolean)

          Specifies whether to enable Amazon ECS managed tags for the task. For more information, see Tagging Your Amazon ECS Resources in the Amazon ECS Developer Guide.

        • EnableExecuteCommand — (Boolean)

          Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.

        • Group — (String)

          Specifies an ECS task group for the task. The maximum length is 255 characters.

        • LaunchType — (String)

          Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The FARGATE value is supported only in the Regions where Fargate with Amazon ECS is supported. For more information, see AWS Fargate on Amazon ECS in the Amazon ECS Developer Guide.

          Possible values include:
          • "EC2"
          • "FARGATE"
          • "EXTERNAL"
        • NetworkConfiguration — (map)

          This structure specifies the network configuration for an ECS task.

          • awsvpcConfiguration — (map)

            Specifies the Amazon VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.

            • AssignPublicIp — (String)

              Specifies whether the task's elastic network interface receives a public IP address. You can specify ENABLED only when LaunchType in EcsParameters is set to FARGATE.

              Possible values include:
              • "ENABLED"
              • "DISABLED"
            • SecurityGroups — (Array<String>)

              Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.

            • Subnetsrequired — (Array<String>)

              Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.

        • PlacementConstraints — (Array<map>)

          An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).

          • expression — (String)

            A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is distinctInstance. For more information, see Cluster query language in the Amazon ECS Developer Guide.

          • type — (String)

            The type of constraint. Use distinctInstance to ensure that each task in a particular group is running on a different container instance. Use memberOf to restrict the selection to a group of valid candidates.

            Possible values include:
            • "distinctInstance"
            • "memberOf"
        • PlacementStrategy — (Array<map>)

          The task placement strategy for a task or service.

          • field — (String)

            The field to apply the placement strategy against. For the spread placement strategy, valid values are instanceId (or instanceId, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are cpu and memory. For the random placement strategy, this field is not used.

          • type — (String)

            The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).

            Possible values include:
            • "random"
            • "spread"
            • "binpack"
        • PlatformVersion — (String)

          Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0.

        • PropagateTags — (String)

          Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use Amazon ECS's TagResource API action.

          Possible values include:
          • "TASK_DEFINITION"
        • ReferenceId — (String)

          The reference ID to use for the task.

        • Tags — (Array<map<String>>)

          The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see RunTask in the Amazon ECS API Reference.

        • TaskCount — (Integer)

          The number of tasks to create based on TaskDefinition. The default is 1.

        • TaskDefinitionArnrequired — (String)

          The Amazon Resource Name (ARN) of the task definition to use if the event target is an Amazon ECS task.

      • EventBridgeParameters — (map)

        The templated target type for the EventBridge PutEvents API operation.

        • DetailTyperequired — (String)

          A free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.

        • Sourcerequired — (String)

          The source of the event.

      • Input — (String)

        The text, or well-formed JSON, passed to the target. If you are configuring a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the input must be a well-formed JSON. For all other target types, a JSON is not required. If you do not specify anything for this field, EventBridge Scheduler delivers a default notification to the target.

      • KinesisParameters — (map)

        The templated target type for the Amazon Kinesis PutRecord API operation.

      • RetryPolicy — (map)

        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.

        • MaximumEventAgeInSeconds — (Integer)

          The maximum amount of time, in seconds, to continue to make retry attempts.

        • MaximumRetryAttempts — (Integer)

          The maximum number of retry attempts to make before the request fails. Retry attempts with exponential backoff continue until either the maximum number of attempts is made or until the duration of the MaximumEventAgeInSeconds is reached.

      • RoleArnrequired — (String)

        The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.

      • SageMakerPipelineParameters — (map)

        The templated target type for the Amazon SageMaker StartPipelineExecution API operation.

        • PipelineParameterList — (Array<map>)

          List of parameter names and values to use when executing the SageMaker Model Building Pipeline.

          • Namerequired — (String)

            Name of parameter to start execution of a SageMaker Model Building Pipeline.

          • Valuerequired — (String)

            Value of parameter to start execution of a SageMaker Model Building Pipeline.

      • SqsParameters — (map)

        The templated target type for the Amazon SQS SendMessage API operation. Contains the message group ID to use when the target is a FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue must have content-based deduplication enabled. For more information, see Using the Amazon SQS message deduplication ID in the Amazon SQS Developer Guide.

        • MessageGroupId — (String)

          The FIFO message group ID to use as the target.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ScheduleArn — (String)

        The Amazon Resource Name (ARN) of the schedule that you updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.