aws-cdk.aws-scheduler-alpha


Nameaws-cdk.aws-scheduler-alpha JSON
Version 2.170.0a0 PyPI version JSON
download
home_pagehttps://github.com/aws/aws-cdk
SummaryThe CDK Construct Library for Amazon Scheduler
upload_time2024-11-22 04:42:44
maintainerNone
docs_urlNone
authorAmazon Web Services
requires_python~=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Amazon EventBridge Scheduler Construct Library

<!--BEGIN STABILITY BANNER-->---


![cdk-constructs: Developer Preview](https://img.shields.io/badge/cdk--constructs-developer--preview-informational.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are in **developer preview** before they
> become stable. We will only make breaking changes to address unforeseen API issues. Therefore,
> these APIs are not subject to [Semantic Versioning](https://semver.org/), and breaking changes
> will be announced in release notes. This means that while you may use them, you may need to
> update your source code when upgrading to a newer version of this package.

---
<!--END STABILITY BANNER-->

[Amazon EventBridge Scheduler](https://aws.amazon.com/blogs/compute/introducing-amazon-eventbridge-scheduler/) is a feature from Amazon EventBridge
that allows you to create, run, and manage scheduled tasks at scale. With EventBridge Scheduler, you can schedule millions of one-time or recurring tasks across various AWS services without provisioning or managing underlying infrastructure.

1. **Schedule**: A schedule is the main resource you create, configure, and manage using Amazon EventBridge Scheduler. Every schedule has a schedule expression that determines when, and with what frequency, the schedule runs. EventBridge Scheduler supports three types of schedules: rate, cron, and one-time schedules. When you create a schedule, you configure a target for the schedule to invoke.
2. **Target**: A target is an API operation that EventBridge Scheduler calls on your behalf every time your schedule runs. EventBridge Scheduler
   supports two types of targets: templated targets and universal targets. Templated targets invoke common API operations across a core groups of
   services. For example, EventBridge Scheduler supports templated targets for invoking AWS Lambda Function or starting execution of Step Functions state
   machine. For API operations that are not supported by templated targets you can use customizable universal targets. Universal targets support calling
   more than 6,000 API operations across over 270 AWS services.
3. **Schedule Group**: A schedule group is an Amazon EventBridge Scheduler resource that you use to organize your schedules. Your AWS account comes
   with a default scheduler group. A new schedule will always be added to a scheduling group. If you do not provide a scheduling group to add to, it
   will be added to the default scheduling group. You can create up to 500 schedule groups in your AWS account. Groups can be used to organize the
   schedules logically, access the schedule metrics and manage permissions at group granularity (see details below). Schedule groups support tagging.
   With EventBridge Scheduler, you apply tags to schedule groups, not to individual schedules to organize your resources.

## Defining a schedule

```python
# fn: lambda.Function


target = targets.LambdaInvoke(fn,
    input=ScheduleTargetInput.from_object({
        "payload": "useful"
    })
)

schedule = Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.minutes(10)),
    target=target,
    description="This is a test schedule that invokes a lambda function every 10 minutes."
)
```

### Schedule Expressions

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. You can configure each recurring schedule type using a schedule expression.

For
cron-based schedules you can specify a time zone in which EventBridge Scheduler evaluates the expression.

```python
# target: targets.LambdaInvoke


rate_based_schedule = Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.minutes(10)),
    target=target,
    description="This is a test rate-based schedule"
)

cron_based_schedule = Schedule(self, "Schedule",
    schedule=ScheduleExpression.cron(
        minute="0",
        hour="23",
        day="20",
        month="11",
        time_zone=TimeZone.AMERICA_NEW_YORK
    ),
    target=target,
    description="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"
)
```

A one-time schedule is a schedule that invokes a target only once. You configure a one-time schedule by specifying the time of day, date,
and time zone in which EventBridge Scheduler evaluates the schedule.

```python
# target: targets.LambdaInvoke


one_time_schedule = Schedule(self, "Schedule",
    schedule=ScheduleExpression.at(
        Date(2022, 10, 20, 19, 20, 23), TimeZone.AMERICA_NEW_YORK),
    target=target,
    description="This is a one-time schedule in New York timezone"
)
```

### Grouping Schedules

Your AWS account comes with a default scheduler group. You can access the default group in CDK with:

```python
default_group = Group.from_default_group(self, "DefaultGroup")
```

You can add a schedule to a custom scheduling group managed by you. If a custom group is not specified, the schedule is added to the default group.

```python
# target: targets.LambdaInvoke


group = Group(self, "Group",
    group_name="MyGroup"
)

Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.minutes(10)),
    target=target,
    group=group
)
```

### Disabling Schedules

By default, a schedule will be enabled. You can disable a schedule by setting the `enabled` property to false:

```python
# target: targets.LambdaInvoke


Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.minutes(10)),
    target=target,
    enabled=False
)
```

### Configuring a start and end time of the Schedule

If you choose a recurring schedule, you can set the start and end time of the Schedule by specifying the `start` and `end`.

```python
# target: targets.LambdaInvoke


Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(cdk.Duration.hours(12)),
    target=target,
    start=Date("2023-01-01T00:00:00.000Z"),
    end=Date("2023-02-01T00:00:00.000Z")
)
```

## Scheduler Targets

The `@aws-cdk/aws-scheduler-targets-alpha` module includes classes that implement the `IScheduleTarget` interface for
various AWS services. EventBridge Scheduler supports two types of targets:

1. **Templated targets** which invoke common API
   operations across a core groups of services, and
2. **Universal targets** that you can customize to call more
   than 6,000 operations across over 270 services.

A list of supported targets can be found at `@aws-cdk/aws-scheduler-targets-alpha`.

### Input

Targets can be invoked with a custom input. The `ScheduleTargetInput` class supports free-form text input and JSON-formatted object input:

```python
input = ScheduleTargetInput.from_object({
    "QueueName": "MyQueue"
})
```

You can include context attributes in your target payload. EventBridge Scheduler will replace each keyword with
its respective value and deliver it to the target. See
[full list of supported context attributes](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-schedule-context-attributes.html):

1. `ContextAttribute.scheduleArn()` – The ARN of the schedule.
2. `ContextAttribute.scheduledTime()` – The time you specified for the schedule to invoke its target, e.g., 2022-03-22T18:59:43Z.
3. `ContextAttribute.executionId()` – The unique ID that EventBridge Scheduler assigns for each attempted invocation of a target, e.g., d32c5kddcf5bb8c3.
4. `ContextAttribute.attemptNumber()` – A counter that identifies the attempt number for the current invocation, e.g., 1.

```python
text = f"Attempt number: {ContextAttribute.attemptNumber}"
input = ScheduleTargetInput.from_text(text)
```

### Specifying an execution role

An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.

The classes for templated schedule targets automatically create an IAM role with all the minimum necessary
permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets
will grant minimal required permissions. For example, the `LambdaInvoke` target will grant the
IAM execution role `lambda:InvokeFunction` permission to invoke the Lambda function.

```python
# fn: lambda.Function


role = iam.Role(self, "Role",
    assumed_by=iam.ServicePrincipal("scheduler.amazonaws.com")
)

target = targets.LambdaInvoke(fn,
    input=ScheduleTargetInput.from_object({
        "payload": "useful"
    }),
    role=role
)
```

### Specifying an encryption key

EventBridge Scheduler integrates with AWS Key Management Service (AWS KMS) to encrypt and decrypt your data using an AWS KMS key.
EventBridge Scheduler supports two types of KMS keys: AWS owned keys, and customer managed keys.

By default, all events in Scheduler are encrypted with a key that AWS owns and manages.
If you wish you can also provide a customer managed key to encrypt and decrypt the payload that your schedule delivers to its target using the `key` property.
Target classes will automatically add AWS `kms:Decrypt` permission to your schedule's execution role permissions policy.

```python
# key: kms.Key
# fn: lambda.Function


target = targets.LambdaInvoke(fn,
    input=ScheduleTargetInput.from_object({
        "payload": "useful"
    })
)

schedule = Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.minutes(10)),
    target=target,
    key=key
)
```

> See [Data protection in Amazon EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/data-protection.html) for more details.

## Configuring flexible time windows

You can configure flexible time windows by specifying the `timeWindow` property.
Flexible time windows are disabled by default.

```python
# target: targets.LambdaInvoke


schedule = Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.hours(12)),
    target=target,
    time_window=TimeWindow.flexible(Duration.hours(10))
)
```

> See [Configuring flexible time windows](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-schedule-flexible-time-windows.html) for more details.

## Error-handling

You can configure how your schedule handles failures, when EventBridge Scheduler is unable to deliver an event
successfully to a target, by using two primary mechanisms: a retry policy, and a dead-letter queue (DLQ).

A retry policy determines the number of times EventBridge Scheduler must retry a failed event, and how long
to keep an unprocessed event.

A DLQ is a standard Amazon SQS queue EventBridge Scheduler uses to deliver failed events to, after the retry
policy has been exhausted. You can use a DLQ to troubleshoot issues with your schedule or its downstream target.
If you've configured a retry policy for your schedule, EventBridge Scheduler delivers the dead-letter event after
exhausting the maximum number of retries you set in the retry policy.

```python
# fn: lambda.Function


dlq = sqs.Queue(self, "DLQ",
    queue_name="MyDLQ"
)

target = targets.LambdaInvoke(fn,
    dead_letter_queue=dlq,
    max_event_age=Duration.minutes(1),
    retry_attempts=3
)
```

## Monitoring

You can monitor Amazon EventBridge Scheduler using CloudWatch, which collects raw data
and processes it into readable, near real-time metrics. EventBridge Scheduler emits
a set of metrics for all schedules, and an additional set of metrics for schedules that
have an associated dead-letter queue (DLQ). If you configure a DLQ for your schedule,
EventBridge Scheduler publishes additional metrics when your schedule exhausts its retry policy.

### Metrics for all schedules

The `Schedule` class provides static methods for accessing all schedules metrics with default configuration, such as `metricAllErrors` for viewing errors when executing targets.

```python
cloudwatch.Alarm(self, "SchedulesErrorAlarm",
    metric=Schedule.metric_all_errors(),
    threshold=0,
    evaluation_periods=1
)
```

### Metrics for a Group

To view metrics for a specific group you can use methods on class `Group`:

```python
group = Group(self, "Group",
    group_name="MyGroup"
)

cloudwatch.Alarm(self, "MyGroupErrorAlarm",
    metric=group.metric_target_errors(),
    evaluation_periods=1,
    threshold=0
)

# Or use default group
default_group = Group.from_default_group(self, "DefaultGroup")
cloudwatch.Alarm(self, "DefaultGroupErrorAlarm",
    metric=default_group.metric_target_errors(),
    evaluation_periods=1,
    threshold=0
)
```

See full list of metrics and their description at
[Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/scheduler/latest/UserGuide/monitoring-cloudwatch.html)
in the *AWS EventBridge Scheduler User Guide*.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aws/aws-cdk",
    "name": "aws-cdk.aws-scheduler-alpha",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Amazon Web Services",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/23/83/0d147ba9975e35e606c71653f018c07bb5b6dba2a68972800489bb60799d/aws_cdk_aws_scheduler_alpha-2.170.0a0.tar.gz",
    "platform": null,
    "description": "# Amazon EventBridge Scheduler Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cdk-constructs: Developer Preview](https://img.shields.io/badge/cdk--constructs-developer--preview-informational.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are in **developer preview** before they\n> become stable. We will only make breaking changes to address unforeseen API issues. Therefore,\n> these APIs are not subject to [Semantic Versioning](https://semver.org/), and breaking changes\n> will be announced in release notes. This means that while you may use them, you may need to\n> update your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\n[Amazon EventBridge Scheduler](https://aws.amazon.com/blogs/compute/introducing-amazon-eventbridge-scheduler/) is a feature from Amazon EventBridge\nthat allows you to create, run, and manage scheduled tasks at scale. With EventBridge Scheduler, you can schedule millions of one-time or recurring tasks across various AWS services without provisioning or managing underlying infrastructure.\n\n1. **Schedule**: A schedule is the main resource you create, configure, and manage using Amazon EventBridge Scheduler. Every schedule has a schedule expression that determines when, and with what frequency, the schedule runs. EventBridge Scheduler supports three types of schedules: rate, cron, and one-time schedules. When you create a schedule, you configure a target for the schedule to invoke.\n2. **Target**: A target is an API operation that EventBridge Scheduler calls on your behalf every time your schedule runs. EventBridge Scheduler\n   supports two types of targets: templated targets and universal targets. Templated targets invoke common API operations across a core groups of\n   services. For example, EventBridge Scheduler supports templated targets for invoking AWS Lambda Function or starting execution of Step Functions state\n   machine. For API operations that are not supported by templated targets you can use customizable universal targets. Universal targets support calling\n   more than 6,000 API operations across over 270 AWS services.\n3. **Schedule Group**: A schedule group is an Amazon EventBridge Scheduler resource that you use to organize your schedules. Your AWS account comes\n   with a default scheduler group. A new schedule will always be added to a scheduling group. If you do not provide a scheduling group to add to, it\n   will be added to the default scheduling group. You can create up to 500 schedule groups in your AWS account. Groups can be used to organize the\n   schedules logically, access the schedule metrics and manage permissions at group granularity (see details below). Schedule groups support tagging.\n   With EventBridge Scheduler, you apply tags to schedule groups, not to individual schedules to organize your resources.\n\n## Defining a schedule\n\n```python\n# fn: lambda.Function\n\n\ntarget = targets.LambdaInvoke(fn,\n    input=ScheduleTargetInput.from_object({\n        \"payload\": \"useful\"\n    })\n)\n\nschedule = Schedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(Duration.minutes(10)),\n    target=target,\n    description=\"This is a test schedule that invokes a lambda function every 10 minutes.\"\n)\n```\n\n### Schedule Expressions\n\nYou can choose from three schedule types when configuring your schedule: rate-based, cron-based, and one-time schedules.\n\nBoth rate-based and cron-based schedules are recurring schedules. You can configure each recurring schedule type using a schedule expression.\n\nFor\ncron-based schedules you can specify a time zone in which EventBridge Scheduler evaluates the expression.\n\n```python\n# target: targets.LambdaInvoke\n\n\nrate_based_schedule = Schedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(Duration.minutes(10)),\n    target=target,\n    description=\"This is a test rate-based schedule\"\n)\n\ncron_based_schedule = Schedule(self, \"Schedule\",\n    schedule=ScheduleExpression.cron(\n        minute=\"0\",\n        hour=\"23\",\n        day=\"20\",\n        month=\"11\",\n        time_zone=TimeZone.AMERICA_NEW_YORK\n    ),\n    target=target,\n    description=\"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\"\n)\n```\n\nA one-time schedule is a schedule that invokes a target only once. You configure a one-time schedule by specifying the time of day, date,\nand time zone in which EventBridge Scheduler evaluates the schedule.\n\n```python\n# target: targets.LambdaInvoke\n\n\none_time_schedule = Schedule(self, \"Schedule\",\n    schedule=ScheduleExpression.at(\n        Date(2022, 10, 20, 19, 20, 23), TimeZone.AMERICA_NEW_YORK),\n    target=target,\n    description=\"This is a one-time schedule in New York timezone\"\n)\n```\n\n### Grouping Schedules\n\nYour AWS account comes with a default scheduler group. You can access the default group in CDK with:\n\n```python\ndefault_group = Group.from_default_group(self, \"DefaultGroup\")\n```\n\nYou can add a schedule to a custom scheduling group managed by you. If a custom group is not specified, the schedule is added to the default group.\n\n```python\n# target: targets.LambdaInvoke\n\n\ngroup = Group(self, \"Group\",\n    group_name=\"MyGroup\"\n)\n\nSchedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(Duration.minutes(10)),\n    target=target,\n    group=group\n)\n```\n\n### Disabling Schedules\n\nBy default, a schedule will be enabled. You can disable a schedule by setting the `enabled` property to false:\n\n```python\n# target: targets.LambdaInvoke\n\n\nSchedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(Duration.minutes(10)),\n    target=target,\n    enabled=False\n)\n```\n\n### Configuring a start and end time of the Schedule\n\nIf you choose a recurring schedule, you can set the start and end time of the Schedule by specifying the `start` and `end`.\n\n```python\n# target: targets.LambdaInvoke\n\n\nSchedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(cdk.Duration.hours(12)),\n    target=target,\n    start=Date(\"2023-01-01T00:00:00.000Z\"),\n    end=Date(\"2023-02-01T00:00:00.000Z\")\n)\n```\n\n## Scheduler Targets\n\nThe `@aws-cdk/aws-scheduler-targets-alpha` module includes classes that implement the `IScheduleTarget` interface for\nvarious AWS services. EventBridge Scheduler supports two types of targets:\n\n1. **Templated targets** which invoke common API\n   operations across a core groups of services, and\n2. **Universal targets** that you can customize to call more\n   than 6,000 operations across over 270 services.\n\nA list of supported targets can be found at `@aws-cdk/aws-scheduler-targets-alpha`.\n\n### Input\n\nTargets can be invoked with a custom input. The `ScheduleTargetInput` class supports free-form text input and JSON-formatted object input:\n\n```python\ninput = ScheduleTargetInput.from_object({\n    \"QueueName\": \"MyQueue\"\n})\n```\n\nYou can include context attributes in your target payload. EventBridge Scheduler will replace each keyword with\nits respective value and deliver it to the target. See\n[full list of supported context attributes](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-schedule-context-attributes.html):\n\n1. `ContextAttribute.scheduleArn()` \u2013 The ARN of the schedule.\n2. `ContextAttribute.scheduledTime()` \u2013 The time you specified for the schedule to invoke its target, e.g., 2022-03-22T18:59:43Z.\n3. `ContextAttribute.executionId()` \u2013 The unique ID that EventBridge Scheduler assigns for each attempted invocation of a target, e.g., d32c5kddcf5bb8c3.\n4. `ContextAttribute.attemptNumber()` \u2013 A counter that identifies the attempt number for the current invocation, e.g., 1.\n\n```python\ntext = f\"Attempt number: {ContextAttribute.attemptNumber}\"\ninput = ScheduleTargetInput.from_text(text)\n```\n\n### Specifying an execution role\n\nAn execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.\n\nThe classes for templated schedule targets automatically create an IAM role with all the minimum necessary\npermissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets\nwill grant minimal required permissions. For example, the `LambdaInvoke` target will grant the\nIAM execution role `lambda:InvokeFunction` permission to invoke the Lambda function.\n\n```python\n# fn: lambda.Function\n\n\nrole = iam.Role(self, \"Role\",\n    assumed_by=iam.ServicePrincipal(\"scheduler.amazonaws.com\")\n)\n\ntarget = targets.LambdaInvoke(fn,\n    input=ScheduleTargetInput.from_object({\n        \"payload\": \"useful\"\n    }),\n    role=role\n)\n```\n\n### Specifying an encryption key\n\nEventBridge Scheduler integrates with AWS Key Management Service (AWS KMS) to encrypt and decrypt your data using an AWS KMS key.\nEventBridge Scheduler supports two types of KMS keys: AWS owned keys, and customer managed keys.\n\nBy default, all events in Scheduler are encrypted with a key that AWS owns and manages.\nIf you wish you can also provide a customer managed key to encrypt and decrypt the payload that your schedule delivers to its target using the `key` property.\nTarget classes will automatically add AWS `kms:Decrypt` permission to your schedule's execution role permissions policy.\n\n```python\n# key: kms.Key\n# fn: lambda.Function\n\n\ntarget = targets.LambdaInvoke(fn,\n    input=ScheduleTargetInput.from_object({\n        \"payload\": \"useful\"\n    })\n)\n\nschedule = Schedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(Duration.minutes(10)),\n    target=target,\n    key=key\n)\n```\n\n> See [Data protection in Amazon EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/data-protection.html) for more details.\n\n## Configuring flexible time windows\n\nYou can configure flexible time windows by specifying the `timeWindow` property.\nFlexible time windows are disabled by default.\n\n```python\n# target: targets.LambdaInvoke\n\n\nschedule = Schedule(self, \"Schedule\",\n    schedule=ScheduleExpression.rate(Duration.hours(12)),\n    target=target,\n    time_window=TimeWindow.flexible(Duration.hours(10))\n)\n```\n\n> See [Configuring flexible time windows](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-schedule-flexible-time-windows.html) for more details.\n\n## Error-handling\n\nYou can configure how your schedule handles failures, when EventBridge Scheduler is unable to deliver an event\nsuccessfully to a target, by using two primary mechanisms: a retry policy, and a dead-letter queue (DLQ).\n\nA retry policy determines the number of times EventBridge Scheduler must retry a failed event, and how long\nto keep an unprocessed event.\n\nA DLQ is a standard Amazon SQS queue EventBridge Scheduler uses to deliver failed events to, after the retry\npolicy has been exhausted. You can use a DLQ to troubleshoot issues with your schedule or its downstream target.\nIf you've configured a retry policy for your schedule, EventBridge Scheduler delivers the dead-letter event after\nexhausting the maximum number of retries you set in the retry policy.\n\n```python\n# fn: lambda.Function\n\n\ndlq = sqs.Queue(self, \"DLQ\",\n    queue_name=\"MyDLQ\"\n)\n\ntarget = targets.LambdaInvoke(fn,\n    dead_letter_queue=dlq,\n    max_event_age=Duration.minutes(1),\n    retry_attempts=3\n)\n```\n\n## Monitoring\n\nYou can monitor Amazon EventBridge Scheduler using CloudWatch, which collects raw data\nand processes it into readable, near real-time metrics. EventBridge Scheduler emits\na set of metrics for all schedules, and an additional set of metrics for schedules that\nhave an associated dead-letter queue (DLQ). If you configure a DLQ for your schedule,\nEventBridge Scheduler publishes additional metrics when your schedule exhausts its retry policy.\n\n### Metrics for all schedules\n\nThe `Schedule` class provides static methods for accessing all schedules metrics with default configuration, such as `metricAllErrors` for viewing errors when executing targets.\n\n```python\ncloudwatch.Alarm(self, \"SchedulesErrorAlarm\",\n    metric=Schedule.metric_all_errors(),\n    threshold=0,\n    evaluation_periods=1\n)\n```\n\n### Metrics for a Group\n\nTo view metrics for a specific group you can use methods on class `Group`:\n\n```python\ngroup = Group(self, \"Group\",\n    group_name=\"MyGroup\"\n)\n\ncloudwatch.Alarm(self, \"MyGroupErrorAlarm\",\n    metric=group.metric_target_errors(),\n    evaluation_periods=1,\n    threshold=0\n)\n\n# Or use default group\ndefault_group = Group.from_default_group(self, \"DefaultGroup\")\ncloudwatch.Alarm(self, \"DefaultGroupErrorAlarm\",\n    metric=default_group.metric_target_errors(),\n    evaluation_periods=1,\n    threshold=0\n)\n```\n\nSee full list of metrics and their description at\n[Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/scheduler/latest/UserGuide/monitoring-cloudwatch.html)\nin the *AWS EventBridge Scheduler User Guide*.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "The CDK Construct Library for Amazon Scheduler",
    "version": "2.170.0a0",
    "project_urls": {
        "Homepage": "https://github.com/aws/aws-cdk",
        "Source": "https://github.com/aws/aws-cdk.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2fb4d87d628c34a20b3b658284c8e0e67902662febfb89264c1d4aea3acf7d45",
                "md5": "b4836234d2d4ce177b3991fa96987a07",
                "sha256": "5255a64f0633ba24a52f2f51196519d5bca7008e8b66eed10d0f84547b7cdcde"
            },
            "downloads": -1,
            "filename": "aws_cdk.aws_scheduler_alpha-2.170.0a0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b4836234d2d4ce177b3991fa96987a07",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 107044,
            "upload_time": "2024-11-22T04:41:59",
            "upload_time_iso_8601": "2024-11-22T04:41:59.841833Z",
            "url": "https://files.pythonhosted.org/packages/2f/b4/d87d628c34a20b3b658284c8e0e67902662febfb89264c1d4aea3acf7d45/aws_cdk.aws_scheduler_alpha-2.170.0a0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23830d147ba9975e35e606c71653f018c07bb5b6dba2a68972800489bb60799d",
                "md5": "131ce4c981afb9f53b59abbe3ccc7c1b",
                "sha256": "af8100d194611e36d0147c985f054e0ead190aaf24ca664dcf807db71a32b3c0"
            },
            "downloads": -1,
            "filename": "aws_cdk_aws_scheduler_alpha-2.170.0a0.tar.gz",
            "has_sig": false,
            "md5_digest": "131ce4c981afb9f53b59abbe3ccc7c1b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 108743,
            "upload_time": "2024-11-22T04:42:44",
            "upload_time_iso_8601": "2024-11-22T04:42:44.447358Z",
            "url": "https://files.pythonhosted.org/packages/23/83/0d147ba9975e35e606c71653f018c07bb5b6dba2a68972800489bb60799d/aws_cdk_aws_scheduler_alpha-2.170.0a0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-22 04:42:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aws",
    "github_project": "aws-cdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aws-cdk.aws-scheduler-alpha"
}
        
Elapsed time: 1.54411s