Amazon EventBridge
API Reference (API Version 2015-10-07)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

CreateEventBus

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

Note

This operation is used by AWS customers, not by SaaS partners.

Request Syntax

{ "EventSourceName": "string", "Name": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

EventSourceName

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: aws\.partner(/[\.\-_A-Za-z0-9]+){2,}

Required: No

Name

The name of the new event bus.

The names of custom event buses can't contain the / character. You can't use the name default for a custom event bus because this name is already used for your account's default event bus.

If this is a partner event bus, the name must exactly match the name of the partner event source that this event bus is matched to. This name will include the / character.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [/\.\-_A-Za-z0-9]+

Required: Yes

Response Syntax

{ "EventBusArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

EventBusArn

The ARN of the new event bus.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

ConcurrentModificationException

There is concurrent modification on a resource.

HTTP Status Code: 400

InternalException

This exception occurs due to unexpected causes.

HTTP Status Code: 500

InvalidStateException

The specified state isn't a valid state for an event source.

HTTP Status Code: 400

LimitExceededException

You tried to create more resources than is allowed.

HTTP Status Code: 400

ResourceAlreadyExistsException

The resource that you're trying to create already exists.

HTTP Status Code: 400

ResourceNotFoundException

An entity that you specified doesn't exist.

HTTP Status Code: 400

Example

Creates a partner event bus

The following example creates a partner event bus. The name of the new bus must be aws.partner/PartnerName/acct1/repo1 because it must match exactly the partner source name.

Sample Request

POST / HTTP/1.1 Host: events.<region>.<domain> x-amz-Date: <Date> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Connection: Keep-Alive X-Amz-Target: AWSEvents.CreateEventBus { "EventSourceName": "aws.partner/PartnerName/acct1/repo1", "Name": "aws.partner/PartnerName/acct1/repo1" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "EventBusArn": "arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: