Skip to content

Commit

Permalink
Merge branch 'main' into target-group-crosszone
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo10Gama authored Nov 14, 2024
2 parents fd4cc78 + 92bfb59 commit 55511f4
Show file tree
Hide file tree
Showing 19 changed files with 119 additions and 633 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
uses: actions/setup-node@v4

- name: Install dependencies
run: cd packages/aws-cdk && yarn install
run: yarn install

- name: Build CLI
run: cd packages/aws-cdk && npx lerna run build --scope=aws-cdk
run: npx lerna run build --scope=aws-cdk

- name: Run tests
run: cd packages/aws-cdk && yarn test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/request-cli-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
persist-credentials: false
- name: Find changed cli files
id: changed-cli-files
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files_yaml: |
Expand Down
24 changes: 0 additions & 24 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ queue_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
Expand All @@ -37,10 +33,6 @@ queue_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
Expand Down Expand Up @@ -72,10 +64,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
- name: automatic merge (2+ approvers)
actions:
comment:
Expand All @@ -96,10 +84,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
- name: automatic merge (no-squash)
actions:
comment:
Expand All @@ -120,10 +104,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
- name: remove stale reviews
actions:
dismiss_reviews:
Expand Down Expand Up @@ -163,7 +143,3 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,11 @@ console.log('This cannot be covered')
* Once approved and tested, one of our bots will squash-merge to main and will use your PR title/description as the
commit message.

> [!NOTE]
> If your PR is failing one of the required checks (e.g Codecov), it will not be auto-merged. If you believe the PR should be merged
> inspite of this, let a maintainer know. The maintainer may agree and merge the PR manually, or ask you to address the failing checks.

## Breaking Changes

**_NOTE_**: _Starting with version 2.0.0 of the AWS CDK, **all modules and members vended as part of the main CDK library**_
Expand Down
34 changes: 14 additions & 20 deletions packages/@aws-cdk/aws-scheduler-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
<!--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 one-time or recurrently tens
of millions of tasks across many AWS services without provisioning or managing underlying infrastructure.
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
Expand All @@ -28,12 +27,8 @@ 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). Scheduling groups support tagging:
with EventBridge Scheduler, you apply tags to schedule groups, not to individual schedules to organize your resources.

This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. It allows you to define Event Bridge Schedules.

> This module is in active development. Some features may not be implemented yet.
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

Expand All @@ -49,7 +44,7 @@ const target = new targets.LambdaInvoke(fn, {
const schedule = new Schedule(this, 'Schedule', {
schedule: ScheduleExpression.rate(Duration.minutes(10)),
target,
description: 'This is a test schedule that invokes lambda function every 10 minutes.',
description: 'This is a test schedule that invokes a lambda function every 10 minutes.',
});
```

Expand Down Expand Up @@ -167,7 +162,7 @@ A list of supported targets can be found at `@aws-cdk/aws-scheduler-targets-alph

### Input

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

```ts
const input = ScheduleTargetInput.fromObject({
Expand All @@ -180,9 +175,9 @@ 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, for example, 2022-03-22T18:59:43Z.
3. `ContextAttribute.executionId()` – The unique ID that EventBridge Scheduler assigns for each attempted invocation of a target, for example, d32c5kddcf5bb8c3.
4. `ContextAttribute.attemptNumber()` – A counter that identifies the attempt number for the current invocation, for example, 1.
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.

```ts
const text = `Attempt number: ${ContextAttribute.attemptNumber}`;
Expand All @@ -195,7 +190,7 @@ An execution role is an IAM role that EventBridge Scheduler assumes in order to

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 target `LambdaInvoke` will grant the
will grant minimal required permissions. For example, the `LambdaInvoke` target will grant the
IAM execution role `lambda:InvokeFunction` permission to invoke the Lambda function.

```ts
Expand Down Expand Up @@ -239,12 +234,12 @@ const schedule = new Schedule(this, 'Schedule', {
});
```

> Visit [Data protection in Amazon EventBridge Scheduler](https://docs.aws.amazon.com/scheduler/latest/UserGuide/data-protection.html) for more details.
> 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 is disabled by default.
Flexible time windows are disabled by default.

```ts
declare const target: targets.LambdaInvoke;
Expand All @@ -256,7 +251,7 @@ const schedule = new Schedule(this, 'Schedule', {
});
```

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

Expand Down Expand Up @@ -295,8 +290,7 @@ EventBridge Scheduler publishes additional metrics when your schedule exhausts i

### Metrics for all schedules

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

```ts
new cloudwatch.Alarm(this, 'SchedulesErrorAlarm', {
Expand Down Expand Up @@ -332,4 +326,4 @@ new cloudwatch.Alarm(this, 'DefaultGroupErrorAlarm', {

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 Event Bridge Scheduler User Guide*.
in the *AWS EventBridge Scheduler User Guide*.
51 changes: 25 additions & 26 deletions packages/@aws-cdk/aws-scheduler-targets-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@
<!--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 one-time or recurrently tens
of millions of tasks across many AWS services without provisioning or managing underlying infrastructure.
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.

This library contains integration classes for Amazon EventBridge Scheduler to call any
number of supported AWS Services.
number of supported AWS Services.

The following targets are supported:

1. `targets.LambdaInvoke`: [Invoke an AWS Lambda function](#invoke-a-lambda-function))
1. `targets.LambdaInvoke`: [Invoke an AWS Lambda function](#invoke-a-lambda-function)
2. `targets.StepFunctionsStartExecution`: [Start an AWS Step Function](#start-an-aws-step-function)
3. `targets.CodeBuildStartBuild`: [Start a CodeBuild job](#start-a-codebuild-job)
4. `targets.SqsSendMessage`: [Send a Message to an Amazon SQS Queue](#send-a-message-to-sqs-queue)
4. `targets.SqsSendMessage`: [Send a Message to an Amazon SQS Queue](#send-a-message-to-an-sqs-queue)
5. `targets.SnsPublish`: [Publish messages to an Amazon SNS topic](#publish-messages-to-an-amazon-sns-topic)
6. `targets.EventBridgePutEvents`: [Put Events on EventBridge](#send-events-to-an-eventbridge-event-bus)
7. `targets.InspectorStartAssessmentRun`: [Start an Amazon Inspector assessment run](#start-an-amazon-inspector-assessment-run)
8. `targets.KinesisStreamPutRecord`: [Put a record to an Amazon Kinesis Data Streams](#put-a-record-to-an-amazon-kinesis-data-streams)
8. `targets.KinesisStreamPutRecord`: [Put a record to an Amazon Kinesis Data Stream](#put-a-record-to-an-amazon-kinesis-data-stream)
9. `targets.KinesisDataFirehosePutRecord`: [Put a record to a Kinesis Data Firehose](#put-a-record-to-a-kinesis-data-firehose)
10. `targets.CodePipelineStartPipelineExecution`: [Start a CodePipeline execution](#start-a-codepipeline-execution)
11. `targets.SageMakerStartPipelineExecution`: [Start a SageMaker pipeline execution](#start-a-sagemaker-pipeline-execution)
Expand All @@ -41,7 +40,7 @@ The following targets are supported:
Use the `LambdaInvoke` target to invoke a lambda function.

The code snippet below creates an event rule with a Lambda function as a target
called every hour by Event Bridge Scheduler with custom payload. You can optionally attach a
called every hour by EventBridge Scheduler with a custom payload. You can optionally attach a
[dead letter queue](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html).

```ts
Expand Down Expand Up @@ -77,7 +76,7 @@ const schedule = new Schedule(this, 'Schedule', {
Use the `StepFunctionsStartExecution` target to start a new execution on a StepFunction.

The code snippet below creates an event rule with a Step Function as a target
called every hour by Event Bridge Scheduler with a custom payload.
called every hour by EventBridge Scheduler with a custom payload.

```ts
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
Expand Down Expand Up @@ -117,7 +116,7 @@ new Schedule(this, 'Schedule', {
Use the `CodeBuildStartBuild` target to start a new build run on a CodeBuild project.

The code snippet below creates an event rule with a CodeBuild project as target which is
called every hour by Event Bridge Scheduler.
called every hour by EventBridge Scheduler.

```ts
import * as codebuild from 'aws-cdk-lib/aws-codebuild';
Expand All @@ -130,12 +129,12 @@ new Schedule(this, 'Schedule', {
});
```

## Send A Message To SQS Queue
## Send a Message To an SQS Queue

Use the `SqsSendMessage` target to send a message to SQS Queue.
Use the `SqsSendMessage` target to send a message to an SQS Queue.

The code snippet below creates an event rule with a SQS Queue as a target
called every hour by Event Bridge Scheduler with a custom payload.
The code snippet below creates an event rule with an SQS Queue as a target
called every hour by EventBridge Scheduler with a custom payload.

Contains the `messageGroupId` to use when the target is a FIFO queue. If you specify
a FIFO queue as a target, the queue must have content-based deduplication enabled.
Expand Down Expand Up @@ -164,7 +163,7 @@ new Schedule(this, 'Schedule', {
Use the `SnsPublish` target to publish messages to an Amazon SNS topic.

The code snippets below create an event rule with a Amazon SNS topic as a target.
It's called every hour by Amazon Event Bridge Scheduler with custom payload.
It's called every hour by Amazon EventBridge Scheduler with a custom payload.

```ts
import * as sns from 'aws-cdk-lib/aws-sns';
Expand All @@ -190,7 +189,7 @@ new Schedule(this, 'Schedule', {
Use the `EventBridgePutEvents` target to send events to an EventBridge event bus.

The code snippet below creates an event rule with an EventBridge event bus as a target
called every hour by Event Bridge Scheduler with a custom event payload.
called every hour by EventBridge Scheduler with a custom event payload.

```ts
import * as events from 'aws-cdk-lib/aws-events';
Expand All @@ -216,8 +215,8 @@ new Schedule(this, 'Schedule', {

Use the `InspectorStartAssessmentRun` target to start an Inspector assessment run.

The code snippet below creates an event rule with an assessment template as target which is
called every hour by Event Bridge Scheduler.
The code snippet below creates an event rule with an assessment template as the target which is
called every hour by EventBridge Scheduler.

```ts
import * as inspector from 'aws-cdk-lib/aws-inspector';
Expand All @@ -230,12 +229,12 @@ new Schedule(this, 'Schedule', {
});
```

## Put a record to an Amazon Kinesis Data Streams
## Put a record to an Amazon Kinesis Data Stream

Use the `KinesisStreamPutRecord` target to put a record to an Amazon Kinesis Data Streams.
Use the `KinesisStreamPutRecord` target to put a record to an Amazon Kinesis Data Stream.

The code snippet below creates an event rule with a stream as target which is
called every hour by Event Bridge Scheduler.
The code snippet below creates an event rule with a stream as the target which is
called every hour by EventBridge Scheduler.

```ts
import * as kinesis from 'aws-cdk-lib/aws-kinesis';
Expand All @@ -255,7 +254,7 @@ new Schedule(this, 'Schedule', {
Use the `KinesisDataFirehosePutRecord` target to put a record to a Kinesis Data Firehose delivery stream.

The code snippet below creates an event rule with a delivery stream as a target
called every hour by Event Bridge Scheduler with a custom payload.
called every hour by EventBridge Scheduler with a custom payload.

```ts
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
Expand All @@ -277,8 +276,8 @@ new Schedule(this, 'Schedule', {

Use the `CodePipelineStartPipelineExecution` target to start a new execution for a CodePipeline pipeline.

The code snippet below creates an event rule with a CodePipeline pipeline as target which is
called every hour by Event Bridge Scheduler.
The code snippet below creates an event rule with a CodePipeline pipeline as the target which is
called every hour by EventBridge Scheduler.

```ts
import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
Expand All @@ -295,8 +294,8 @@ new Schedule(this, 'Schedule', {

Use the `SageMakerStartPipelineExecution` target to start a new execution for a SageMaker pipeline.

The code snippet below creates an event rule with a SageMaker pipeline as target which is
called every hour by Event Bridge Scheduler.
The code snippet below creates an event rule with a SageMaker pipeline as the target which is
called every hour by EventBridge Scheduler.

```ts
import * as sagemaker from 'aws-cdk-lib/aws-sagemaker';
Expand Down
Loading

0 comments on commit 55511f4

Please sign in to comment.