awscdkpipessourcesalpha

package module
v2.146.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Amazon EventBridge Pipes Sources 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 Sources let you create a source for a EventBridge Pipe.

For more details see the service documentation:

Documentation

Pipe sources

Pipe sources are the starting point of a EventBridge Pipe. They are the source of the events that are sent to the pipe.

Amazon SQS

A SQS message queue can be used as a source for a pipe. The queue will be polled for new messages and the messages will be sent to the pipe.

var sourceQueue queue
var targetQueue queue


pipeSource := sources.NewSqsSource(sourceQueue)

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

The polling configuration can be customized:

var sourceQueue queue
var targetQueue queue


pipeSource := sources.NewSqsSource(sourceQueue, &SqsSourceParameters{
	BatchSize: jsii.Number(10),
	MaximumBatchingWindow: cdk.Duration_Seconds(jsii.Number(10)),
})

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

Documentation

Overview

The CDK Construct Library for Amazon EventBridge Pipes Sources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqsSource_Override

func NewSqsSource_Override(s SqsSource, queue awssqs.IQueue, parameters *SqsSourceParameters)

Experimental.

Types

type SqsSource

type SqsSource interface {
	awscdkpipesalpha.ISource
	// The ARN of the source resource.
	// Experimental.
	SourceArn() *string
	// Bind the source to a pipe.
	// Experimental.
	Bind(_pipe awscdkpipesalpha.IPipe) *awscdkpipesalpha.SourceConfig
	// Grant the pipe role read access to the source.
	// Experimental.
	GrantRead(grantee awsiam.IRole)
}

A source that reads from an SQS queue.

Example:

var sourceQueue queue
var targetQueue queue

pipeSource := sources.NewSqsSource(sourceQueue)

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

Experimental.

func NewSqsSource

func NewSqsSource(queue awssqs.IQueue, parameters *SqsSourceParameters) SqsSource

Experimental.

type SqsSourceParameters

type SqsSourceParameters struct {
	// The maximum number of records to include in each batch.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcesqsqueueparameters.html#cfn-pipes-pipe-pipesourcesqsqueueparameters-batchsize
	//
	// Default: 10.
	//
	// Experimental.
	BatchSize *float64 `field:"optional" json:"batchSize" yaml:"batchSize"`
	// The maximum length of a time to wait for events.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipesourcesqsqueueparameters.html#cfn-pipes-pipe-pipesourcesqsqueueparameters-maximumbatchingwindowinseconds
	//
	// Default: 1.
	//
	// Experimental.
	MaximumBatchingWindow awscdk.Duration `field:"optional" json:"maximumBatchingWindow" yaml:"maximumBatchingWindow"`
}

Parameters for the SQS source.

Example:

var sourceQueue queue
var targetQueue queue

pipeSource := sources.NewSqsSource(sourceQueue, &SqsSourceParameters{
	BatchSize: jsii.Number(10),
	MaximumBatchingWindow: cdk.Duration_Seconds(jsii.Number(10)),
})

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

Experimental.

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL