CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-pulumi--aws

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources with infrastructure-as-code.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

eventbridge.mddocs/services/

EventBridge

Amazon EventBridge (CloudWatch Events) delivers real-time event stream processing.

Overview

EventBridge enables event-driven architectures by routing events from AWS services, custom applications, and SaaS applications to targets like Lambda functions, Step Functions, SNS topics, and more.

EventBridge resources are available through the cloudwatch module:

import { cloudwatch } from "@pulumi/aws";

// EventBridge resources
new cloudwatch.EventRule(...);
new cloudwatch.EventTarget(...);
new cloudwatch.EventBus(...);
new cloudwatch.EventConnection(...);
new cloudwatch.EventApiDestination(...);

Common Tasks

import * as aws from "@pulumi/aws";

// Schedule a Lambda function to run daily
const dailyRule = new aws.cloudwatch.EventRule("daily", {
    scheduleExpression: "rate(1 day)",
});

new aws.cloudwatch.EventTarget("lambda-target", {
    rule: dailyRule.name,
    arn: myFunction.arn,
});

// React to S3 object creation
const s3Rule = new aws.cloudwatch.EventRule("s3-uploads", {
    eventPattern: JSON.stringify({
        source: ["aws.s3"],
        "detail-type": ["Object Created"],
        detail: {
            bucket: { name: [myBucket.id] }
        }
    }),
});

// Create custom event bus for application events
const customBus = new aws.cloudwatch.EventBus("app-events", {
    name: "application-events",
});

Key Resources

EventRule

Matches incoming events and routes them to targets.

class EventRule extends pulumi.CustomResource {
    constructor(name: string, args?: EventRuleArgs, opts?: pulumi.CustomResourceOptions);

    readonly arn: pulumi.Output<string>;
}

interface EventRuleArgs {
    name?: pulumi.Input<string>;
    description?: pulumi.Input<string>;
    eventPattern?: pulumi.Input<string>;
    scheduleExpression?: pulumi.Input<string>;
    eventBusName?: pulumi.Input<string>;
    roleArn?: pulumi.Input<string>;
    isEnabled?: pulumi.Input<boolean>;
    tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}

EventTarget

Defines where events are sent when a rule matches.

class EventTarget extends pulumi.CustomResource {
    constructor(name: string, args: EventTargetArgs, opts?: pulumi.CustomResourceOptions);
}

interface EventTargetArgs {
    rule: pulumi.Input<string>;
    arn: pulumi.Input<string>;
    eventBusName?: pulumi.Input<string>;
    roleArn?: pulumi.Input<string>;
    input?: pulumi.Input<string>;
    inputPath?: pulumi.Input<string>;
    inputTransformer?: pulumi.Input<EventTargetInputTransformer>;
    retryPolicy?: pulumi.Input<EventTargetRetryPolicy>;
    deadLetterConfig?: pulumi.Input<EventTargetDeadLetterConfig>;
}

EventBus

Custom event bus for application or third-party events.

class EventBus extends pulumi.CustomResource {
    constructor(name: string, args: EventBusArgs, opts?: pulumi.CustomResourceOptions);

    readonly arn: pulumi.Output<string>;
}

interface EventBusArgs {
    name: pulumi.Input<string>;
    eventSourceName?: pulumi.Input<string>;
    tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}

EventConnection

Connection to third-party SaaS providers.

class EventConnection extends pulumi.CustomResource {
    constructor(name: string, args: EventConnectionArgs, opts?: pulumi.CustomResourceOptions);
}

interface EventConnectionArgs {
    authorizationType: pulumi.Input<"API_KEY" | "BASIC" | "OAUTH_CLIENT_CREDENTIALS">;
    authParameters: pulumi.Input<EventConnectionAuthParameters>;
    name?: pulumi.Input<string>;
    description?: pulumi.Input<string>;
}

EventApiDestination

HTTP endpoint as event target.

class EventApiDestination extends pulumi.CustomResource {
    constructor(name: string, args: EventApiDestinationArgs, opts?: pulumi.CustomResourceOptions);
}

interface EventApiDestinationArgs {
    connectionArn: pulumi.Input<string>;
    invocationEndpoint: pulumi.Input<string>;
    httpMethod: pulumi.Input<"GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD">;
    name?: pulumi.Input<string>;
    invocationRateLimitPerSecond?: pulumi.Input<number>;
}

Examples

See the CloudWatch documentation for detailed EventBridge examples including:

  • Scheduled Lambda invocations
  • Reacting to AWS service events
  • Cross-account event routing
  • Event pattern matching
  • Event transformation

Additional EventBridge Resources

  • EventArchive - Archive events for replay
  • EventBusPolicy - Cross-account event bus access
  • EventEndpoint - Global endpoints for disaster recovery
  • EventPermission - Grant permissions to event bus
  • getEventBus - Look up event bus
  • getEventConnection - Look up connection
  • getEventSource - Look up event source

For complete EventBridge API documentation, see CloudWatch - Monitoring and Logging.

Related Services

  • CloudWatch - EventBridge is part of CloudWatch
  • Lambda - Common event target
  • Step Functions - Orchestrate event-driven workflows
  • SNS - Fan-out events to multiple subscribers
  • SQS - Queue events for reliable processing

Install with Tessl CLI

npx tessl i tessl/npm-pulumi--aws@7.16.0

docs

index.md

quickstart.md

README.md

tile.json