CreateEventBusCommand

Creates a new event bus within your account. This can be a custom event bus which you can use to receive events from your custom applications and services, or it can be a partner event bus which can be matched to a partner event source.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { EventBridgeClient, CreateEventBusCommand } from "@aws-sdk/client-eventbridge"; // ES Modules import
// const { EventBridgeClient, CreateEventBusCommand } = require("@aws-sdk/client-eventbridge"); // CommonJS import
const client = new EventBridgeClient(config);
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
      Value: "STRING_VALUE", // required
    },
  ],
};
const command = new CreateEventBusCommand(input);
const response = await client.send(command);
// { // CreateEventBusResponse
//   EventBusArn: "STRING_VALUE",
//   Description: "STRING_VALUE",
//   KmsKeyIdentifier: "STRING_VALUE",
//   DeadLetterConfig: { // DeadLetterConfig
//     Arn: "STRING_VALUE",
//   },
// };

CreateEventBusCommand Input

See CreateEventBusCommandInput for more details

Parameter
Type
Description
Name
Required
string | undefined

The name of the new event bus.

Custom event bus names can't contain the / character, but you can use the / character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.

You can't use the name default for a custom event bus, as this name is already used for your account's default event bus.

DeadLetterConfig
DeadLetterConfig | undefined

Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).

For more information, see Using dead-letter queues to process undelivered events  in the EventBridge User Guide.

Description
string | undefined

The event bus description.

EventSourceName
string | undefined

If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.

KmsKeyIdentifier
string | undefined

The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.

If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt events on the event bus.

For more information, see Managing keys  in the Key Management Service Developer Guide.

Archives and schema discovery are not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:

  • You call CreateArchive  on an event bus set to use a customer managed key for encryption.

  • You call CreateDiscoverer  on an event bus set to use a customer managed key for encryption.

  • You call UpdatedEventBus  to set a customer managed key on an event bus with an archives or schema discovery enabled.

To enable archives or schema discovery on an event bus, choose to use an Amazon Web Services owned key. For more information, see Data encryption in EventBridge  in the Amazon EventBridge User Guide.

Tags
Tag[] | undefined

Tags to associate with the event bus.

CreateEventBusCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DeadLetterConfig
DeadLetterConfig | undefined

Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).

For more information, see Using dead-letter queues to process undelivered events  in the EventBridge User Guide.

Description
string | undefined

The event bus description.

EventBusArn
string | undefined

The ARN of the new event bus.

KmsKeyIdentifier
string | undefined

The identifier of the KMS customer managed key for EventBridge to use to encrypt events on this event bus, if one has been specified.

For more information, see Data encryption in EventBridge  in the Amazon EventBridge User Guide.

Throws

Name
Fault
Details
ConcurrentModificationException
client

There is concurrent modification on a rule, target, archive, or replay.

InternalException
server

This exception occurs due to unexpected causes.

InvalidStateException
client

The specified state is not a valid state for an event source.

LimitExceededException
client

The request failed because it attempted to create resource beyond the allowed service quota.

OperationDisabledException
client

The operation you are attempting is not available in this region.

ResourceAlreadyExistsException
client

The resource you are trying to create already exists.

ResourceNotFoundException
client

An entity that you specified does not exist.

EventBridgeServiceException
Base exception class for all service exceptions from EventBridge service.