aws-cdk.aws-pipes-targets-alpha


Nameaws-cdk.aws-pipes-targets-alpha JSON
Version 2.170.0a0 PyPI version JSON
download
home_pagehttps://github.com/aws/aws-cdk
SummaryThe CDK Construct Library for Amazon EventBridge Pipes Targets
upload_time2024-11-22 04:42:38
maintainerNone
docs_urlNone
authorAmazon Web Services
requires_python~=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Amazon EventBridge Pipes Targets Construct Library

<!--BEGIN STABILITY BANNER-->---


![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> 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](https://semver.org/) 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.

---
<!--END STABILITY BANNER-->

EventBridge Pipes Targets let you create a target for an EventBridge Pipe.

For more details see the [service documentation](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html).

## Targets

Pipe targets are the end point of an EventBridge Pipe. The following targets are supported:

* `targets.ApiDestinationTarget`: [Send event source to an EventBridge API destination](#amazon-eventbridge-api-destination)
* `targets.CloudWatchLogsTarget`: [Send event source to a CloudWatch Logs log group](#amazon-cloudwatch-logs-log-group)
* `targets.EventBridgeTarget`: [Send event source to an EventBridge event bus](#amazon-eventbridge-event-bus)
* `targets.KinesisTarget`: [Send event source to a Kinesis data stream](#amazon-kinesis-data-stream)
* `targets.LambdaFunction`: [Send event source to a Lambda function](#aws-lambda-function)
* `targets.SageMakerTarget`: [Send event source to a SageMaker pipeline](#amazon-sagemaker-pipeline)
* `targets.SfnStateMachine`: [Invoke a Step Functions state machine from an event source](#aws-step-functions-state-machine)
* `targets.SqsTarget`: [Send event source to an SQS queue](#amazon-sqs)

### Amazon EventBridge API Destination

An EventBridge API destination can be used as a target for a pipe.
The API destination will receive the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# dest: events.ApiDestination


api_target = targets.ApiDestinationTarget(dest)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=api_target
)
```

The input to the target API destination can be transformed:

```python
# source_queue: sqs.Queue
# dest: events.ApiDestination


api_target = targets.ApiDestinationTarget(dest,
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=api_target
)
```

### Amazon CloudWatch Logs Log Group

A CloudWatch Logs log group can be used as a target for a pipe.
The log group will receive the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_log_group: logs.LogGroup


log_group_target = targets.CloudWatchLogsTarget(target_log_group)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=log_group_target
)
```

The input to the target log group can be transformed:

```python
# source_queue: sqs.Queue
# target_log_group: logs.LogGroup


log_group_target = targets.CloudWatchLogsTarget(target_log_group,
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=log_group_target
)
```

### Amazon EventBridge Event Bus

An EventBridge event bus can be used as a target for a pipe.
The event bus will receive the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_event_bus: events.EventBus


event_bus_target = targets.EventBridgeTarget(target_event_bus)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=event_bus_target
)
```

The input to the target event bus can be transformed:

```python
# source_queue: sqs.Queue
# target_event_bus: events.EventBus


event_bus_target = targets.EventBridgeTarget(target_event_bus,
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=event_bus_target
)
```

### Amazon Kinesis Data Stream

A Kinesis data stream can be used as a target for a pipe.
The data stream will receive the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_stream: kinesis.Stream


stream_target = targets.KinesisTarget(target_stream,
    partition_key="pk"
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=stream_target
)
```

The input to the target data stream can be transformed:

```python
# source_queue: sqs.Queue
# target_stream: kinesis.Stream


stream_target = targets.KinesisTarget(target_stream,
    partition_key="pk",
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=stream_target
)
```

### AWS Lambda Function

A Lambda function can be used as a target for a pipe.
The Lambda function will be invoked with the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_function: lambda.IFunction


pipe_target = targets.LambdaFunction(target_function)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipe_target
)
```

The target Lambda function is invoked synchronously by default. You can also choose to invoke the Lambda Function asynchronously by setting `invocationType` property to `FIRE_AND_FORGET`.

```python
# source_queue: sqs.Queue
# target_function: lambda.IFunction


pipe_target = targets.LambdaFunction(target_function,
    invocation_type=targets.LambdaFunctionInvocationType.FIRE_AND_FORGET
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipe_target
)
```

The input to the target Lambda Function can be transformed:

```python
# source_queue: sqs.Queue
# target_function: lambda.IFunction


pipe_target = targets.LambdaFunction(target_function,
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipe_target
)
```

### Amazon SageMaker Pipeline

A SageMaker pipeline can be used as a target for a pipe.
The pipeline will receive the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_pipeline: sagemaker.IPipeline


pipeline_target = targets.SageMakerTarget(target_pipeline)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipeline_target
)
```

The input to the target pipeline can be transformed:

```python
# source_queue: sqs.Queue
# target_pipeline: sagemaker.IPipeline


pipeline_target = targets.SageMakerTarget(target_pipeline,
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipeline_target
)
```

### AWS Step Functions State Machine

A Step Functions state machine can be used as a target for a pipe.
The state machine will be invoked with the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_state_machine: sfn.IStateMachine


pipe_target = targets.SfnStateMachine(target_state_machine)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipe_target
)
```

You can specify the invocation type when the target state machine is invoked:

```python
# 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=SqsSource(source_queue),
    target=pipe_target
)
```

The input to the target state machine can be transformed:

```python
# 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=SqsSource(source_queue),
    target=pipe_target
)
```

### Amazon SQS Queue

An SQS queue can be used as a target for a pipe.
The queue will receive the (enriched/filtered) source payload.

```python
# source_queue: sqs.Queue
# target_queue: sqs.Queue


pipe_target = targets.SqsTarget(target_queue)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=pipe_target
)
```

The target input can be transformed:

```python
# 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=SqsSource(source_queue),
    target=pipe_target
)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aws/aws-cdk",
    "name": "aws-cdk.aws-pipes-targets-alpha",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Amazon Web Services",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/3c/9f/5241765d1958adac258cd63862783ea32196bbc2d84c8d33678466bf2c42/aws_cdk_aws_pipes_targets_alpha-2.170.0a0.tar.gz",
    "platform": null,
    "description": "# Amazon EventBridge Pipes Targets Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\nEventBridge Pipes Targets let you create a target for an EventBridge Pipe.\n\nFor more details see the [service documentation](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html).\n\n## Targets\n\nPipe targets are the end point of an EventBridge Pipe. The following targets are supported:\n\n* `targets.ApiDestinationTarget`: [Send event source to an EventBridge API destination](#amazon-eventbridge-api-destination)\n* `targets.CloudWatchLogsTarget`: [Send event source to a CloudWatch Logs log group](#amazon-cloudwatch-logs-log-group)\n* `targets.EventBridgeTarget`: [Send event source to an EventBridge event bus](#amazon-eventbridge-event-bus)\n* `targets.KinesisTarget`: [Send event source to a Kinesis data stream](#amazon-kinesis-data-stream)\n* `targets.LambdaFunction`: [Send event source to a Lambda function](#aws-lambda-function)\n* `targets.SageMakerTarget`: [Send event source to a SageMaker pipeline](#amazon-sagemaker-pipeline)\n* `targets.SfnStateMachine`: [Invoke a Step Functions state machine from an event source](#aws-step-functions-state-machine)\n* `targets.SqsTarget`: [Send event source to an SQS queue](#amazon-sqs)\n\n### Amazon EventBridge API Destination\n\nAn EventBridge API destination can be used as a target for a pipe.\nThe API destination will receive the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# dest: events.ApiDestination\n\n\napi_target = targets.ApiDestinationTarget(dest)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=api_target\n)\n```\n\nThe input to the target API destination can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# dest: events.ApiDestination\n\n\napi_target = targets.ApiDestinationTarget(dest,\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"\ud83d\udc40\"})\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=api_target\n)\n```\n\n### Amazon CloudWatch Logs Log Group\n\nA CloudWatch Logs log group can be used as a target for a pipe.\nThe log group will receive the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_log_group: logs.LogGroup\n\n\nlog_group_target = targets.CloudWatchLogsTarget(target_log_group)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=log_group_target\n)\n```\n\nThe input to the target log group can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_log_group: logs.LogGroup\n\n\nlog_group_target = targets.CloudWatchLogsTarget(target_log_group,\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"\ud83d\udc40\"})\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=log_group_target\n)\n```\n\n### Amazon EventBridge Event Bus\n\nAn EventBridge event bus can be used as a target for a pipe.\nThe event bus will receive the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_event_bus: events.EventBus\n\n\nevent_bus_target = targets.EventBridgeTarget(target_event_bus)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=event_bus_target\n)\n```\n\nThe input to the target event bus can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_event_bus: events.EventBus\n\n\nevent_bus_target = targets.EventBridgeTarget(target_event_bus,\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"\ud83d\udc40\"})\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=event_bus_target\n)\n```\n\n### Amazon Kinesis Data Stream\n\nA Kinesis data stream can be used as a target for a pipe.\nThe data stream will receive the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_stream: kinesis.Stream\n\n\nstream_target = targets.KinesisTarget(target_stream,\n    partition_key=\"pk\"\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=stream_target\n)\n```\n\nThe input to the target data stream can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_stream: kinesis.Stream\n\n\nstream_target = targets.KinesisTarget(target_stream,\n    partition_key=\"pk\",\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"\ud83d\udc40\"})\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=stream_target\n)\n```\n\n### AWS Lambda Function\n\nA Lambda function can be used as a target for a pipe.\nThe Lambda function will be invoked with the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_function: lambda.IFunction\n\n\npipe_target = targets.LambdaFunction(target_function)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\nThe target Lambda function is invoked synchronously by default. You can also choose to invoke the Lambda Function asynchronously by setting `invocationType` property to `FIRE_AND_FORGET`.\n\n```python\n# source_queue: sqs.Queue\n# target_function: lambda.IFunction\n\n\npipe_target = targets.LambdaFunction(target_function,\n    invocation_type=targets.LambdaFunctionInvocationType.FIRE_AND_FORGET\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\nThe input to the target Lambda Function can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_function: lambda.IFunction\n\n\npipe_target = targets.LambdaFunction(target_function,\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"\ud83d\udc40\"})\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\n### Amazon SageMaker Pipeline\n\nA SageMaker pipeline can be used as a target for a pipe.\nThe pipeline will receive the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_pipeline: sagemaker.IPipeline\n\n\npipeline_target = targets.SageMakerTarget(target_pipeline)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipeline_target\n)\n```\n\nThe input to the target pipeline can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_pipeline: sagemaker.IPipeline\n\n\npipeline_target = targets.SageMakerTarget(target_pipeline,\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"\ud83d\udc40\"})\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipeline_target\n)\n```\n\n### AWS Step Functions State Machine\n\nA Step Functions state machine can be used as a target for a pipe.\nThe state machine will be invoked with the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_state_machine: sfn.IStateMachine\n\n\npipe_target = targets.SfnStateMachine(target_state_machine)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\nYou can specify the invocation type when the target state machine is invoked:\n\n```python\n# source_queue: sqs.Queue\n# target_state_machine: sfn.IStateMachine\n\n\npipe_target = targets.SfnStateMachine(target_state_machine,\n    invocation_type=targets.StateMachineInvocationType.FIRE_AND_FORGET\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\nThe input to the target state machine can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_state_machine: sfn.IStateMachine\n\n\npipe_target = targets.SfnStateMachine(target_state_machine,\n    input_transformation=pipes.InputTransformation.from_object({\"body\": \"<$.body>\"}),\n    invocation_type=targets.StateMachineInvocationType.FIRE_AND_FORGET\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\n### Amazon SQS Queue\n\nAn SQS queue can be used as a target for a pipe.\nThe queue will receive the (enriched/filtered) source payload.\n\n```python\n# source_queue: sqs.Queue\n# target_queue: sqs.Queue\n\n\npipe_target = targets.SqsTarget(target_queue)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n\nThe target input can be transformed:\n\n```python\n# source_queue: sqs.Queue\n# target_queue: sqs.Queue\n\n\npipe_target = targets.SqsTarget(target_queue,\n    input_transformation=pipes.InputTransformation.from_object({\n        \"SomeKey\": pipes.DynamicInput.from_event_path(\"$.body\")\n    })\n)\n\npipe = pipes.Pipe(self, \"Pipe\",\n    source=SqsSource(source_queue),\n    target=pipe_target\n)\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "The CDK Construct Library for Amazon EventBridge Pipes Targets",
    "version": "2.170.0a0",
    "project_urls": {
        "Homepage": "https://github.com/aws/aws-cdk",
        "Source": "https://github.com/aws/aws-cdk.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d184aaf0ed572b4778a7cff75ae1f4fdf67575567744b1ce1ec409acb28bcb28",
                "md5": "66f304cc9a604434f62ca8fa5d14b336",
                "sha256": "625b09d1ba6e473cc4e7b8240c4751885b482504e37d34fa0219a428aff9f0b3"
            },
            "downloads": -1,
            "filename": "aws_cdk.aws_pipes_targets_alpha-2.170.0a0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66f304cc9a604434f62ca8fa5d14b336",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 71343,
            "upload_time": "2024-11-22T04:41:54",
            "upload_time_iso_8601": "2024-11-22T04:41:54.593767Z",
            "url": "https://files.pythonhosted.org/packages/d1/84/aaf0ed572b4778a7cff75ae1f4fdf67575567744b1ce1ec409acb28bcb28/aws_cdk.aws_pipes_targets_alpha-2.170.0a0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c9f5241765d1958adac258cd63862783ea32196bbc2d84c8d33678466bf2c42",
                "md5": "ed563cdb047b10a46e441da314b10b4f",
                "sha256": "38276398063ea4bc8800114113b8ccebafb8fa6a67a1211791f8313bbaaff7da"
            },
            "downloads": -1,
            "filename": "aws_cdk_aws_pipes_targets_alpha-2.170.0a0.tar.gz",
            "has_sig": false,
            "md5_digest": "ed563cdb047b10a46e441da314b10b4f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 73098,
            "upload_time": "2024-11-22T04:42:38",
            "upload_time_iso_8601": "2024-11-22T04:42:38.432651Z",
            "url": "https://files.pythonhosted.org/packages/3c/9f/5241765d1958adac258cd63862783ea32196bbc2d84c8d33678466bf2c42/aws_cdk_aws_pipes_targets_alpha-2.170.0a0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-22 04:42:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aws",
    "github_project": "aws-cdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aws-cdk.aws-pipes-targets-alpha"
}
        
Elapsed time: 0.47830s