AwsEventbridgeEventBus

Creates an AWS EventBridge event bus, optionally with a resource-based policy and schema discovery.

Remarks

Wraps aws.cloudwatch.EventBus and optionally aws.cloudwatch.EventBusPolicy and aws.schemas.Discoverer. Naming is deterministic:

  • Pulumi logical name: ${environmentCode}-${projectHash}-eventbridge-event-bus-${sanitisedName} from args.name.
  • AWS provider event-bus name: derived explicitly from args.name via the naming-style prefix pattern.

Naming:

  • Root type ${namespace}:aws:AwsEventbridgeEventBus has capability eventbridge-event-bus and SHARED identity args.name; target ${env}-${projectHash}-eventbridge-event-bus-${sanitiseNamePart(args.name)}.
  • aws:cloudwatch/eventBus:EventBus, optional aws:cloudwatch/eventBusPolicy:EventBusPolicy, and optional aws:schemas/discoverer:Discoverer each have tuple [args.name], yielding ${env}-${projectHash}-${sanitiseNamePart(args.name)}.
  • The EventBus provider name uses args.name with stackAndPurpose. The provider owns its 256-character EventBus name constraint, so this component has no local length cap; policy and discoverer identifiers are provider-owned.

Example

CODE
const bus = new AwsEventbridgeEventBus({
  name: 'myApp',
  description: 'Cross-account application event bus',
  policy: JSON.stringify({
    Version: '2012-10-17',
    Statement: [{
      Sid: 'AllowAccountAccess',
      Effect: 'Allow',
      Principal: { AWS: '000000000000' },
      Action: ['events:PutEvents'],
      Resource: '*',
    }],
  }),
});

export const busArn = bus.arn;
CODE
const bus = new AwsEventbridgeEventBus({
  name: 'myApp',
  description: 'Application event bus with schema discovery',
  schemaDiscovery: {
    description: 'Auto-discover event schemas for my-app',
  },
});

export const discovererArn = bus.discovererArn;

Constructors

new AwsEventbridgeEventBus( args: AwsEventbridgeEventBusArgs, options?: ComponentResourceOptions, ): AwsEventbridgeEventBus

Parameters

  • args (AwsEventbridgeEventBusArgs) — Component inputs; args.name is the shared provider-purpose and logical-root identity.
  • options (ComponentResourceOptions, optional) — Optional settings controlling resource behaviour.

Returns

AwsEventbridgeEventBus

Hierarchy

  • ComponentResource
  • AwsEventbridgeEventBus

Properties

arn: Output<string>

readonly

The ARN of the event bus.

discovererArn: Output<string>

readonly

The ARN of the schema discoverer, if schema discovery is enabled.

eventBus: EventBus

readonly

The underlying AWS EventBridge event bus resource.

eventBusPolicy: EventBusPolicy

readonly

The optional resource-based policy attached to the event bus.

schemaDiscoverer: Discoverer

readonly

The optional schema discoverer attached to the event bus.

urn: Output<string>

readonly

Inherited from urn

The stable logical URN used to distinctly address a resource, both before and after deployments.

Methods

getData(): Promise<any>

protectedasync

Inherited from getData

Retrieves the data produces by initialize. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

Returns

  • Promise<any>

getProvider(moduleMember: string): ProviderResource | undefined

Inherited from getProvider

Returns the provider for the given module member, if one exists.

Parameters

  • moduleMember (string)

Returns

  • ProviderResource | undefined

initialize( args: Inputs, opts?: ComponentResourceOptions, name?: string, type?: string, ): Promise<any>

protectedasync

Inherited from initialize

Can be overridden by a subclass to asynchronously initialize data for this component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use getData.

Parameters

  • args (Inputs)
  • opts (ComponentResourceOptions, optional)
  • name (string, optional)
  • type (string, optional)

Returns

  • Promise<any>

registerOutputs( outputs?: Inputs | Promise<Inputs> | Output<Inputs>, ): void

protected

Inherited from registerOutputs

Registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

Component resources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

Parameters

  • outputs (Inputs | Promise<Inputs> | Output<Inputs>, optional)

Returns

  • void

Static Methods

isInstance(obj: any): obj is ComponentResource<any>

static

Inherited from isInstance

Returns true if the given object is a CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

Parameters

  • obj (any)

Returns

  • obj is ComponentResource<any>