Skip to content

Commit

Permalink
feat(client-eventbridge): Amazon EventBridge introduces KMS customer-…
Browse files Browse the repository at this point in the history
…managed key (CMK) encryption support for custom and partner events published on EventBridge Event Bus (including default bus) and UpdateEventBus API.
  • Loading branch information
awstools committed May 13, 2024
1 parent 1f62640 commit 529b5fb
Show file tree
Hide file tree
Showing 38 changed files with 1,311 additions and 488 deletions.
26 changes: 17 additions & 9 deletions clients/client-eventbridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

AWS SDK for JavaScript EventBridge Client for Node.js, Browser and React Native.

<p>Amazon EventBridge helps you to respond to state changes in your Amazon Web Services resources. When your
resources change state, they automatically send events to an event stream. You can create
rules that match selected events in the stream and route them to targets to take action. You
can also use rules to take action on a predetermined schedule. For example, you can configure
rules to:</p>
<p>Amazon EventBridge helps you to respond to state changes in your Amazon Web Services
resources. When your resources change state, they automatically send events to an event
stream. You can create rules that match selected events in the stream and route them to
targets to take action. You can also use rules to take action on a predetermined schedule. For
example, you can configure rules to:</p>
<ul>
<li>
<p>Automatically invoke an Lambda function to update DNS entries when an event
notifies you that Amazon EC2 instance enters the running state.</p>
<p>Automatically invoke an Lambda function to update DNS entries when an
event notifies you that Amazon EC2 instance enters the running state.</p>
</li>
<li>
<p>Direct specific API records from CloudTrail to an Amazon Kinesis data stream for
detailed analysis of potential security or availability risks.</p>
<p>Direct specific API records from CloudTrail to an Amazon Kinesis
data stream for detailed analysis of potential security or availability risks.</p>
</li>
<li>
<p>Periodically invoke a built-in target to create a snapshot of an Amazon EBS
Expand Down Expand Up @@ -671,3 +671,11 @@ UpdateEndpoint
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eventbridge/command/UpdateEndpointCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eventbridge/Interface/UpdateEndpointCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eventbridge/Interface/UpdateEndpointCommandOutput/)

</details>
<details>
<summary>
UpdateEventBus
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eventbridge/command/UpdateEventBusCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eventbridge/Interface/UpdateEventBusCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eventbridge/Interface/UpdateEventBusCommandOutput/)

</details>
39 changes: 30 additions & 9 deletions clients/client-eventbridge/src/EventBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ import {
UpdateEndpointCommandInput,
UpdateEndpointCommandOutput,
} from "./commands/UpdateEndpointCommand";
import {
UpdateEventBusCommand,
UpdateEventBusCommandInput,
UpdateEventBusCommandOutput,
} from "./commands/UpdateEventBusCommand";
import { EventBridgeClient, EventBridgeClientConfig } from "./EventBridgeClient";

const commands = {
Expand Down Expand Up @@ -301,6 +306,7 @@ const commands = {
UpdateArchiveCommand,
UpdateConnectionCommand,
UpdateEndpointCommand,
UpdateEventBusCommand,
};

export interface EventBridge {
Expand Down Expand Up @@ -1119,22 +1125,37 @@ export interface EventBridge {
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateEndpointCommandOutput) => void
): void;

/**
* @see {@link UpdateEventBusCommand}
*/
updateEventBus(): Promise<UpdateEventBusCommandOutput>;
updateEventBus(
args: UpdateEventBusCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateEventBusCommandOutput>;
updateEventBus(args: UpdateEventBusCommandInput, cb: (err: any, data?: UpdateEventBusCommandOutput) => void): void;
updateEventBus(
args: UpdateEventBusCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateEventBusCommandOutput) => void
): void;
}

/**
* <p>Amazon EventBridge helps you to respond to state changes in your Amazon Web Services resources. When your
* resources change state, they automatically send events to an event stream. You can create
* rules that match selected events in the stream and route them to targets to take action. You
* can also use rules to take action on a predetermined schedule. For example, you can configure
* rules to:</p>
* <p>Amazon EventBridge helps you to respond to state changes in your Amazon Web Services
* resources. When your resources change state, they automatically send events to an event
* stream. You can create rules that match selected events in the stream and route them to
* targets to take action. You can also use rules to take action on a predetermined schedule. For
* example, you can configure rules to:</p>
* <ul>
* <li>
* <p>Automatically invoke an Lambda function to update DNS entries when an event
* notifies you that Amazon EC2 instance enters the running state.</p>
* <p>Automatically invoke an Lambda function to update DNS entries when an
* event notifies you that Amazon EC2 instance enters the running state.</p>
* </li>
* <li>
* <p>Direct specific API records from CloudTrail to an Amazon Kinesis data stream for
* detailed analysis of potential security or availability risks.</p>
* <p>Direct specific API records from CloudTrail to an Amazon Kinesis
* data stream for detailed analysis of potential security or availability risks.</p>
* </li>
* <li>
* <p>Periodically invoke a built-in target to create a snapshot of an Amazon EBS
Expand Down
25 changes: 14 additions & 11 deletions clients/client-eventbridge/src/EventBridgeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ import {
import { UpdateArchiveCommandInput, UpdateArchiveCommandOutput } from "./commands/UpdateArchiveCommand";
import { UpdateConnectionCommandInput, UpdateConnectionCommandOutput } from "./commands/UpdateConnectionCommand";
import { UpdateEndpointCommandInput, UpdateEndpointCommandOutput } from "./commands/UpdateEndpointCommand";
import { UpdateEventBusCommandInput, UpdateEventBusCommandOutput } from "./commands/UpdateEventBusCommand";
import {
ClientInputEndpointParameters,
ClientResolvedEndpointParameters,
Expand Down Expand Up @@ -222,7 +223,8 @@ export type ServiceInputTypes =
| UpdateApiDestinationCommandInput
| UpdateArchiveCommandInput
| UpdateConnectionCommandInput
| UpdateEndpointCommandInput;
| UpdateEndpointCommandInput
| UpdateEventBusCommandInput;

/**
* @public
Expand Down Expand Up @@ -283,7 +285,8 @@ export type ServiceOutputTypes =
| UpdateApiDestinationCommandOutput
| UpdateArchiveCommandOutput
| UpdateConnectionCommandOutput
| UpdateEndpointCommandOutput;
| UpdateEndpointCommandOutput
| UpdateEventBusCommandOutput;

/**
* @public
Expand Down Expand Up @@ -456,19 +459,19 @@ export type EventBridgeClientResolvedConfigType = __SmithyResolvedConfiguration<
export interface EventBridgeClientResolvedConfig extends EventBridgeClientResolvedConfigType {}

/**
* <p>Amazon EventBridge helps you to respond to state changes in your Amazon Web Services resources. When your
* resources change state, they automatically send events to an event stream. You can create
* rules that match selected events in the stream and route them to targets to take action. You
* can also use rules to take action on a predetermined schedule. For example, you can configure
* rules to:</p>
* <p>Amazon EventBridge helps you to respond to state changes in your Amazon Web Services
* resources. When your resources change state, they automatically send events to an event
* stream. You can create rules that match selected events in the stream and route them to
* targets to take action. You can also use rules to take action on a predetermined schedule. For
* example, you can configure rules to:</p>
* <ul>
* <li>
* <p>Automatically invoke an Lambda function to update DNS entries when an event
* notifies you that Amazon EC2 instance enters the running state.</p>
* <p>Automatically invoke an Lambda function to update DNS entries when an
* event notifies you that Amazon EC2 instance enters the running state.</p>
* </li>
* <li>
* <p>Direct specific API records from CloudTrail to an Amazon Kinesis data stream for
* detailed analysis of potential security or availability risks.</p>
* <p>Direct specific API records from CloudTrail to an Amazon Kinesis
* data stream for detailed analysis of potential security or availability risks.</p>
* </li>
* <li>
* <p>Periodically invoke a built-in target to create a snapshot of an Amazon EBS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export interface CreateApiDestinationCommandOutput extends CreateApiDestinationR
/**
* <p>Creates an API destination, which is an HTTP invocation endpoint configured as a target
* for events.</p>
* <p>API destinations do not support private destinations, such as interface VPC endpoints.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html">API destinations</a> in the <i>EventBridge User Guide</i>.</p>
* <p>API destinations do not support private destinations, such as interface VPC
* endpoints.</p>
* <p>For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html">API destinations</a> in the
* <i>EventBridge User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
23 changes: 23 additions & 0 deletions clients/client-eventbridge/src/commands/CreateArchiveCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,29 @@ export interface CreateArchiveCommandOutput extends CreateArchiveResponse, __Met
* time for changes to take effect. If you do not specify a pattern to filter events sent to the
* archive, all events are sent to the archive except replayed events. Replayed events are not
* sent to an archive.</p>
* <note>
* <p>Archives and schema discovery are not supported for event buses encrypted using a
* customer managed key. EventBridge returns an error if:</p>
* <ul>
* <li>
* <p>You call <code>
* <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_CreateArchive.html">CreateArchive</a>
* </code> on an event bus set to use a customer managed key for encryption.</p>
* </li>
* <li>
* <p>You call <code>
* <a href="https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discoverers.html#CreateDiscoverer">CreateDiscoverer</a>
* </code> on an event bus set to use a customer managed key for encryption.</p>
* </li>
* <li>
* <p>You call <code>
* <a href="https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_UpdatedEventBus.html">UpdatedEventBus</a>
* </code> to set a customer managed key on an event bus with an archives or schema discovery enabled.</p>
* </li>
* </ul>
* <p>To enable archives or schema discovery on an event bus, choose to
* use an Amazon Web Services owned key. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption.html">Data encryption in EventBridge</a> in the <i>Amazon EventBridge User Guide</i>.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ export interface CreateEndpointCommandInput extends CreateEndpointRequest {}
export interface CreateEndpointCommandOutput extends CreateEndpointResponse, __MetadataBearer {}

/**
* <p>Creates a global endpoint. Global endpoints improve your application's availability by making it regional-fault tolerant. To do this, you define a primary and secondary Region
* with event buses in each Region. You also create a Amazon Route 53 health check that will tell EventBridge to route events to the secondary Region when an "unhealthy" state
* is encountered and events will be routed back to the primary Region when the health check reports a "healthy" state.</p>
* <p>Creates a global endpoint. Global endpoints improve your application's availability by
* making it regional-fault tolerant. To do this, you define a primary and secondary Region with
* event buses in each Region. You also create a Amazon Route 53 health check that will
* tell EventBridge to route events to the secondary Region when an "unhealthy" state is
* encountered and events will be routed back to the primary Region when the health check reports
* a "healthy" state.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
10 changes: 10 additions & 0 deletions clients/client-eventbridge/src/commands/CreateEventBusCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export interface CreateEventBusCommandOutput extends CreateEventBusResponse, __M
* const input = { // CreateEventBusRequest
* Name: "STRING_VALUE", // required
* EventSourceName: "STRING_VALUE",
* Description: "STRING_VALUE",
* KmsKeyIdentifier: "STRING_VALUE",
* DeadLetterConfig: { // DeadLetterConfig
* Arn: "STRING_VALUE",
* },
* Tags: [ // TagList
* { // Tag
* Key: "STRING_VALUE", // required
Expand All @@ -50,6 +55,11 @@ export interface CreateEventBusCommandOutput extends CreateEventBusResponse, __M
* const response = await client.send(command);
* // { // CreateEventBusResponse
* // EventBusArn: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // KmsKeyIdentifier: "STRING_VALUE",
* // DeadLetterConfig: { // DeadLetterConfig
* // Arn: "STRING_VALUE",
* // },
* // };
*
* ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ export interface CreatePartnerEventSourceCommandOutput extends CreatePartnerEven

/**
* <p>Called by an SaaS partner to create a partner event source. This operation is not used by
* Amazon Web Services customers.</p>
* <p>Each partner event source can be used by one Amazon Web Services account to create a matching partner
* event bus in that Amazon Web Services account. A SaaS partner must create one partner event source for each
* Amazon Web Services account that wants to receive those event types. </p>
* Amazon Web Services customers.</p>
* <p>Each partner event source can be used by one Amazon Web Services account to create a
* matching partner event bus in that Amazon Web Services account. A SaaS partner must create one
* partner event source for each Amazon Web Services account that wants to receive those event
* types. </p>
* <p>A partner event source creates events based on resources within the SaaS partner's service
* or application.</p>
* <p>An Amazon Web Services account that creates a partner event bus that matches the partner event source can
* use that event bus to receive events from the partner, and then process them using Amazon Web Services Events
* rules and targets.</p>
* <p>An Amazon Web Services account that creates a partner event bus that matches the partner
* event source can use that event bus to receive events from the partner, and then process them
* using Amazon Web Services Events rules and targets.</p>
* <p>Partner event source names follow this format:</p>
* <p>
* <code>
Expand All @@ -56,15 +57,16 @@ export interface CreatePartnerEventSourceCommandOutput extends CreatePartnerEven
* </li>
* <li>
* <p>
* <i>event_name</i> is determined by the partner, and should uniquely identify
* an event-generating resource within the partner system. </p>
* <p>The <i>event_name</i> must be unique across all Amazon Web Services customers. This is because the event source is a shared resource
* between the partner and customer accounts, and each partner event source unique in the partner account.</p>
* <i>event_name</i> is determined by the partner, and should uniquely
* identify an event-generating resource within the partner system. </p>
* <p>The <i>event_name</i> must be unique across all Amazon Web Services
* customers. This is because the event source is a shared resource between the partner and
* customer accounts, and each partner event source unique in the partner account.</p>
* </li>
* </ul>
* <p>The combination of
* <i>event_namespace</i> and <i>event_name</i> should help Amazon Web Services
* customers decide whether to create an event bus to receive these events.</p>
* <p>The combination of <i>event_namespace</i> and
* <i>event_name</i> should help Amazon Web Services customers decide whether to
* create an event bus to receive these events.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export interface DeleteEndpointCommandInput extends DeleteEndpointRequest {}
export interface DeleteEndpointCommandOutput extends DeleteEndpointResponse, __MetadataBearer {}

/**
* <p>Delete an existing global endpoint. For more information about global endpoints, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html">Making applications Regional-fault tolerant with global endpoints and event replication</a> in the <i>Amazon EventBridge User Guide</i>.</p>
* <p>Delete an existing global endpoint. For more information about global endpoints, see
* <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-global-endpoints.html">Making applications Regional-fault tolerant with global endpoints and event
* replication</a> in the <i>
* <i>Amazon EventBridge User Guide</i>
* </i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface DeletePartnerEventSourceCommandOutput extends __MetadataBearer
* <p>This operation is used by SaaS partners to delete a partner event source. This operation
* is not used by Amazon Web Services customers.</p>
* <p>When you delete an event source, the status of the corresponding partner event bus in the
* Amazon Web Services customer account becomes DELETED.</p>
* Amazon Web Services customer account becomes DELETED.</p>
* <p></p>
* @example
* Use a bare-bones client and the command you need to make an API call.
Expand Down

0 comments on commit 529b5fb

Please sign in to comment.