Skip to content
v2.274.0

Amazon EventBridge Pipes Enrichments Construct Library ​

Version 2.274.0-alpha.0

Separate package

@aws-cdk/aws-pipes-enrichments-alpha is not part of aws-cdk-lib — install it separately:

sh
npm install @aws-cdk/aws-pipes-enrichments-alpha
pip install aws-cdk.aws-pipes-enrichments-alpha

This module is experimental (alpha): its API may change in any release, without a major version bump.


cdk-constructs: Experimental

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


EventBridge Pipes Enrichments let you create enrichments for an EventBridge Pipe.

For more details see the service documentation:

Documentation

Pipe sources ​

Pipe enrichments are invoked prior to sending the events to a target of a EventBridge Pipe.

Lambda function ​

A Lambda function can be used to enrich events of a pipe.

ts
declare const sourceQueue: sqs.Queue;
declare const targetQueue: sqs.Queue;

declare const enrichmentFunction: lambda.Function;

const enrichment = new enrichments.LambdaEnrichment(enrichmentFunction);

const pipe = new pipes.Pipe(this, 'Pipe', {
  source: new SomeSource(sourceQueue),
  enrichment,
  target: new SomeTarget(targetQueue),
});
python
# source_queue: sqs.Queue
# target_queue: sqs.Queue

# enrichment_function: lambda.Function


enrichment = enrichments.LambdaEnrichment(enrichment_function)

pipe = pipes.Pipe(self, "Pipe",
    source=SomeSource(source_queue),
    enrichment=enrichment,
    target=SomeTarget(target_queue)
)
java
Queue sourceQueue;
Queue targetQueue;

Function enrichmentFunction;


LambdaEnrichment enrichment = new LambdaEnrichment(enrichmentFunction);

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SomeSource(sourceQueue))
        .enrichment(enrichment)
        .target(new SomeTarget(targetQueue))
        .build();
csharp
Queue sourceQueue;
Queue targetQueue;

Function enrichmentFunction;


var enrichment = new LambdaEnrichment(enrichmentFunction);

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SomeSource(sourceQueue),
    Enrichment = enrichment,
    Target = new SomeTarget(targetQueue)
});
go
var sourceQueue Queue
var targetQueue Queue

var enrichmentFunction Function


enrichment := enrichments.NewLambdaEnrichment(enrichmentFunction)

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: NewSomeSource(sourceQueue),
	Enrichment: Enrichment,
	Target: NewSomeTarget(targetQueue),
})

Step Functions state machine ​

Step Functions state machine can be used to enrich events of a pipe.

Note: EventBridge Pipes only supports Express workflows invoked synchronously.

Visit Amazon EventBridge Pipes event enrichment for more details.

ts
declare const sourceQueue: sqs.Queue;
declare const targetQueue: sqs.Queue;

declare const enrichmentStateMachine: stepfunctions.StateMachine;

const enrichment = new enrichments.StepFunctionsEnrichment(enrichmentStateMachine);

const pipe = new pipes.Pipe(this, 'Pipe', {
  source: new SomeSource(sourceQueue),
  enrichment,
  target: new SomeTarget(targetQueue),
});
python
# source_queue: sqs.Queue
# target_queue: sqs.Queue

# enrichment_state_machine: stepfunctions.StateMachine


enrichment = enrichments.StepFunctionsEnrichment(enrichment_state_machine)

pipe = pipes.Pipe(self, "Pipe",
    source=SomeSource(source_queue),
    enrichment=enrichment,
    target=SomeTarget(target_queue)
)
java
Queue sourceQueue;
Queue targetQueue;

StateMachine enrichmentStateMachine;


StepFunctionsEnrichment enrichment = new StepFunctionsEnrichment(enrichmentStateMachine);

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SomeSource(sourceQueue))
        .enrichment(enrichment)
        .target(new SomeTarget(targetQueue))
        .build();
csharp
Queue sourceQueue;
Queue targetQueue;

StateMachine enrichmentStateMachine;


var enrichment = new StepFunctionsEnrichment(enrichmentStateMachine);

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SomeSource(sourceQueue),
    Enrichment = enrichment,
    Target = new SomeTarget(targetQueue)
});
go
var sourceQueue Queue
var targetQueue Queue

var enrichmentStateMachine StateMachine


enrichment := enrichments.NewStepFunctionsEnrichment(enrichmentStateMachine)

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: NewSomeSource(sourceQueue),
	Enrichment: Enrichment,
	Target: NewSomeTarget(targetQueue),
})

API destination ​

API destination can be used to enrich events of a pipe.

ts
declare const sourceQueue: sqs.Queue;
declare const targetQueue: sqs.Queue;

declare const apiDestination: events.ApiDestination;

const enrichment = new enrichments.ApiDestinationEnrichment(apiDestination);

const pipe = new pipes.Pipe(this, 'Pipe', {
  source: new SomeSource(sourceQueue),
  enrichment,
  target: new SomeTarget(targetQueue),
});
python
# source_queue: sqs.Queue
# target_queue: sqs.Queue

# api_destination: events.ApiDestination


enrichment = enrichments.ApiDestinationEnrichment(api_destination)

pipe = pipes.Pipe(self, "Pipe",
    source=SomeSource(source_queue),
    enrichment=enrichment,
    target=SomeTarget(target_queue)
)
java
Queue sourceQueue;
Queue targetQueue;

ApiDestination apiDestination;


ApiDestinationEnrichment enrichment = new ApiDestinationEnrichment(apiDestination);

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SomeSource(sourceQueue))
        .enrichment(enrichment)
        .target(new SomeTarget(targetQueue))
        .build();
csharp
Queue sourceQueue;
Queue targetQueue;

ApiDestination apiDestination;


var enrichment = new ApiDestinationEnrichment(apiDestination);

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SomeSource(sourceQueue),
    Enrichment = enrichment,
    Target = new SomeTarget(targetQueue)
});
go
var sourceQueue Queue
var targetQueue Queue

var apiDestination ApiDestination


enrichment := enrichments.NewApiDestinationEnrichment(apiDestination)

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: NewSomeSource(sourceQueue),
	Enrichment: Enrichment,
	Target: NewSomeTarget(targetQueue),
})

API Gateway (REST API) ​

API Gateway can be used to enrich events of a pipe. Pipes only supports API Gateway REST APIs. HTTP APIs are not supported.

ts
declare const sourceQueue: sqs.Queue;
declare const targetQueue: sqs.Queue;

declare const restApi: apigateway.RestApi;

const enrichment = new enrichments.ApiGatewayEnrichment(restApi);

const pipe = new pipes.Pipe(this, 'Pipe', {
  source: new SomeSource(sourceQueue),
  enrichment,
  target: new SomeTarget(targetQueue),
});
python
# source_queue: sqs.Queue
# target_queue: sqs.Queue

# rest_api: apigateway.RestApi


enrichment = enrichments.ApiGatewayEnrichment(rest_api)

pipe = pipes.Pipe(self, "Pipe",
    source=SomeSource(source_queue),
    enrichment=enrichment,
    target=SomeTarget(target_queue)
)
java
Queue sourceQueue;
Queue targetQueue;

RestApi restApi;


ApiGatewayEnrichment enrichment = new ApiGatewayEnrichment(restApi);

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SomeSource(sourceQueue))
        .enrichment(enrichment)
        .target(new SomeTarget(targetQueue))
        .build();
csharp
Queue sourceQueue;
Queue targetQueue;

RestApi restApi;


var enrichment = new ApiGatewayEnrichment(restApi);

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SomeSource(sourceQueue),
    Enrichment = enrichment,
    Target = new SomeTarget(targetQueue)
});
go
var sourceQueue Queue
var targetQueue Queue

var restApi RestApi


enrichment := enrichments.NewApiGatewayEnrichment(restApi)

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: NewSomeSource(sourceQueue),
	Enrichment: Enrichment,
	Target: NewSomeTarget(targetQueue),
})

Types ​

NameKindSummary
ApiDestinationEnrichmentClassAn API Destination enrichment for a pipe.
ApiDestinationEnrichmentPropsStructProperties for a ApiDestinationEnrichment.
ApiGatewayEnrichmentClassAn API Gateway enrichment for a pipe.
ApiGatewayEnrichmentPropsStructProperties for a ApiGatewayEnrichment.
LambdaEnrichmentClassA Lambda enrichment for a pipe.
LambdaEnrichmentPropsStructProperties for a LambdaEnrichment.
StepFunctionsEnrichmentClassA StepFunctions enrichment for a pipe.
StepFunctionsEnrichmentPropsStructProperties for a StepFunctionsEnrichment.