亚马逊事件 Bridge 管道浓缩库
本单元中更高层次的构件的API是实验性的并正在积极开发中. 在今后任何版本中,它们都须作非背向相容的修改或去除。 这些是 不适用 语义版本 模型和断开的更改 在发行笔记中宣布. 这意味着虽然你可能使用它们,但可能需要更新 当更新到此软件包的更新版本时,您的源代码.
Event Bridge管道的浓缩可以让你为EventBridge管道制造浓缩.
详情见服务文件:
管道来源
在将事件传送给事件Bridge管道的目标之前,会援引管道浓缩法.
Lambda 函数
一个Lambda函数可用于丰富管子的事件.
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),
});
Step 函数状态机器
Step函数态机可用于丰富管子的事件.
说明: EventBridge Pipes只支持同步引用的Express工作流程.
访问 亚马逊事件 Bridge 管道事件浓缩 更多细节.
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),
});
API 目的地
API目的地可用于丰富管子的事件.
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),
});
API 网关(REST API)
API Gateway可用于丰富管子的事件. Pipes只支持API Gateway REST APIs. HTTP API 不支持.
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),
});