Skip to content

Resource: awsCloudwatchEventBus

Provides an EventBridge event bus resource.

\~> Note: EventBridge was formerly known as CloudWatch Events. The functionality is identical.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.cloudwatchEventBus.CloudwatchEventBus(this, "messenger", {
  name: "chat-messages",
});
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsCloudwatchEventSourceExamplepartner =
  new aws.dataAwsCloudwatchEventSource.DataAwsCloudwatchEventSource(
    this,
    "examplepartner",
    {
      namePrefix: "aws.partner/examplepartner.com",
    }
  );
const awsCloudwatchEventBusExamplepartner =
  new aws.cloudwatchEventBus.CloudwatchEventBus(this, "examplepartner_1", {
    eventSourceName: dataAwsCloudwatchEventSourceExamplepartner.name,
    name: dataAwsCloudwatchEventSourceExamplepartner.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCloudwatchEventBusExamplepartner.overrideLogicalId("examplepartner");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the new event bus. The names of custom event buses can't contain the / character. To create a partner event bus, ensure the name matches the eventSourceName.
  • eventSourceName (Optional) The partner event source that the new event bus will be matched with. Must match name.
  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The Amazon Resource Name (ARN) of the event bus.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

EventBridge event buses can be imported using the name (which can also be a partner event source name), e.g.,

$ terraform import aws_cloudwatch_event_bus.messenger chat-messages