The CDK Construct Library for Amazon EventBridge Pipes Targets
Project description
Amazon EventBridge Pipes Targets Construct Library
---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 Targets let you create a target for a EventBridge Pipe.
For more details see the service documentation:
Targets
Pipe targets are the end point of a EventBridge Pipe.
The following targets are supported:
targets.SqsTarget
: Send event source to a Queuetargets.SfnStateMachine
: Invoke a State Machine from an event source
Amazon SQS
A SQS message queue can be used as a target for a pipe. Messages will be pushed to the queue.
# source_queue: sqs.Queue
# target_queue: sqs.Queue
pipe_target = targets.SqsTarget(target_queue)
pipe = pipes.Pipe(self, "Pipe",
source=SomeSource(source_queue),
target=pipe_target
)
The target input can be transformed:
# source_queue: sqs.Queue
# target_queue: sqs.Queue
pipe_target = targets.SqsTarget(target_queue,
input_transformation=pipes.InputTransformation.from_object({
"SomeKey": pipes.DynamicInput.from_event_path("$.body")
})
)
pipe = pipes.Pipe(self, "Pipe",
source=SomeSource(source_queue),
target=pipe_target
)
AWS Step Functions State Machine
A State Machine can be used as a target for a pipe. The State Machine will be invoked with the (enriched/filtered) source payload.
# source_queue: sqs.Queue
# target_state_machine: sfn.IStateMachine
pipe_target = targets.SfnStateMachine(target_state_machine)
pipe = pipes.Pipe(self, "Pipe",
source=SomeSource(source_queue),
target=pipe_target
)
Specifying the Invocation Type when the target State Machine is invoked:
# source_queue: sqs.Queue
# target_state_machine: sfn.IStateMachine
pipe_target = targets.SfnStateMachine(target_state_machine,
invocation_type=targets.StateMachineInvocationType.FIRE_AND_FORGET
)
pipe = pipes.Pipe(self, "Pipe",
source=SomeSource(source_queue),
target=pipe_target
)
The input to the target State Machine can be transformed:
# source_queue: sqs.Queue
# target_state_machine: sfn.IStateMachine
pipe_target = targets.SfnStateMachine(target_state_machine,
input_transformation=pipes.InputTransformation.from_object({"body": "<$.body>"}),
invocation_type=targets.StateMachineInvocationType.FIRE_AND_FORGET
)
pipe = pipes.Pipe(self, "Pipe",
source=SomeSource(source_queue),
target=pipe_target
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aws-cdk.aws-pipes-targets-alpha-2.144.0a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5567894b6b9a1997e70a1b26c1b5b5a32d95fdf908de83fcdc1dc2b14e4efc94 |
|
MD5 | 366221a75212a2aa05e8180a5d350dfa |
|
BLAKE2b-256 | 8a8100ed9cda81feabd95394ad7b6399ea493ebbcee5697e7991bd02706ff2f1 |
Hashes for aws_cdk.aws_pipes_targets_alpha-2.144.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0331c6d1298d8c19b300f14fbb2284ea19aedd84124ef3d0dfbb4f8ea811313 |
|
MD5 | 73620c6fd353cace2c406f31bfba61ac |
|
BLAKE2b-256 | 2ad03eb9a0c30e6f374a853961ffdadae8e70aac55a9b82c7ff2746db81fb7e8 |