This is the new Amazon CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the Amazon CloudFormation User Guide.
AWS::EventsV2::EventBus
Resource type definition for AWS::EventsV2::EventBus, an Amazon EventBridge custom event bus that receives events and delivers them to matching subscribers.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::EventsV2::EventBus", "Properties" : { "Description" :String, "EncryptionConfiguration" :EncryptionConfiguration, "Name" :String, "StorageConfiguration" :StorageConfiguration, "Tags" :[ Tag, ... ]} }
YAML
Type: AWS::EventsV2::EventBus Properties: Description:StringEncryptionConfiguration:EncryptionConfigurationName:StringStorageConfiguration:StorageConfigurationTags:- Tag
Properties
Description-
A description of the event bus. Control characters and Unicode line separators are not allowed.
Required: No
Type: String
Pattern:
^[^\u0000-\u001F\u007F-\u009F\u2028\u2029]*(?![\s\S])Maximum:
512Update requires: No interruption
EncryptionConfiguration-
Encryption configuration for the event bus. The service stores and returns the customer managed key as its key ARN. The key ARN is recommended so that drift detection stays accurate. A key ID is also accepted and is matched to the returned key ARN when CloudFormation checks for drift; a key alias is accepted but can be reported as a value difference, because an alias cannot be matched to the key ARN it points to.
Required: No
Type: EncryptionConfiguration
Update requires: No interruption
Name-
The name of the event bus. The first character must be alphanumeric; the remaining characters may also include '.', '-', and '_'.
Required: Yes
Type: String
Pattern:
^[A-Za-z0-9][\.\-_A-Za-z0-9]*$Minimum:
1Maximum:
256Update requires: Replacement
StorageConfiguration-
The event storage configuration for the event bus, which controls the number of days events are retained on the bus.
Required: No
Type: StorageConfiguration
Update requires: No interruption
-
An array of key-value pairs to apply to the event bus. You can apply a maximum of 50 tags.
For more information about tagging, see Resource tag.
Required: No
Type: Array of Tag
Maximum:
50Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the event bus Amazon Resource Name (ARN), such as arn:aws:events:us-east-1:123456789012:event-busv2/orders-event-bus/a1b2c3d4e5f6g7h8i9j0k1l2m.
For more information about using the Ref function, see Ref.
Fn::GetAtt
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using Fn::GetAtt, see Fn::GetAtt.
CreationTime-
The time the event bus was created, as an ISO 8601 timestamp.
EventBusArn-
The Amazon Resource Name (ARN) of the event bus.
LastModifiedTime-
The time the event bus was last modified, as an ISO 8601 timestamp.
State-
The current lifecycle state of the event bus. The state is
ACTIVEwhen the event bus is ready to use.
Examples
The following examples create Amazon EventBridge event buses.
Create a minimal event bus
The following example creates an event bus with only the required Name property.
JSON
{ "Resources": { "OrdersEventBus": { "Type": "Amazon::EventsV2::EventBus", "Properties": { "Name": "orders-event-bus" } } } }
YAML
Resources: OrdersEventBus: Type: Amazon::EventsV2::EventBus Properties: Name: orders-event-bus
Create a fully configured event bus
The following example creates an event bus that retains events for 90 days, encrypts events with a customer managed key, and applies two tags.
JSON
{ "Resources": { "OrdersEventBus": { "Type": "Amazon::EventsV2::EventBus", "Properties": { "Name": "orders-event-bus", "Description": "Receives and routes order events", "StorageConfiguration": { "RetentionPeriodInDays": 90 }, "EncryptionConfiguration": { "KmsKeyIdentifier": "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" }, "Tags": [ { "Key": "Team", "Value": "Orders" }, { "Key": "Environment", "Value": "Production" } ] } } } }
YAML
Resources: OrdersEventBus: Type: Amazon::EventsV2::EventBus Properties: Name: orders-event-bus Description: Receives and routes order events StorageConfiguration: RetentionPeriodInDays: 90 EncryptionConfiguration: KmsKeyIdentifier: arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab Tags: - Key: Team Value: Orders - Key: Environment Value: Production