A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources with infrastructure-as-code.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Amazon EventBridge (CloudWatch Events) delivers real-time event stream processing.
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(...);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",
});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>}>;
}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>;
}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>}>;
}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>;
}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>;
}See the CloudWatch documentation for detailed EventBridge examples including:
For complete EventBridge API documentation, see CloudWatch - Monitoring and Logging.
Install with Tessl CLI
npx tessl i tessl/npm-pulumi--aws