Skip to content
v2.275.0

Experimental

@aws-cdk/aws-pipes-targets-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

LambdaFunction Class ​

An EventBridge Pipes target that sends messages to an AWS Lambda Function.

Example ​

ts
declare const sourceQueue: sqs.Queue;
declare const targetFunction: lambda.IFunction;

const pipeTarget = new targets.LambdaFunction(targetFunction, {
  invocationType: targets.LambdaFunctionInvocationType.FIRE_AND_FORGET,
});

const pipe = new pipes.Pipe(this, 'Pipe', {
    source: new SqsSource(sourceQueue),
    target: pipeTarget
});
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
)
java
Queue sourceQueue;
IFunction targetFunction;


LambdaFunction pipeTarget = LambdaFunction.Builder.create(targetFunction)
        .invocationType(LambdaFunctionInvocationType.FIRE_AND_FORGET)
        .build();

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SqsSource(sourceQueue))
        .target(pipeTarget)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Pipes.Targets.Alpha
Queue sourceQueue;
IFunction targetFunction;


var pipeTarget = new LambdaFunction(targetFunction, new LambdaFunctionParameters {
    InvocationType = LambdaFunctionInvocationType.FIRE_AND_FORGET
});

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SqsSource(sourceQueue),
    Target = pipeTarget
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkpipestargetsalpha/v2
var sourceQueue Queue
var targetFunction IFunction


pipeTarget := targets.NewLambdaFunction(targetFunction, &LambdaFunctionParameters{
	InvocationType: targets.LambdaFunctionInvocationType_FIRE_AND_FORGET,
})

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: awscdkpipessourcesalpha.NewSqsSource(sourceQueue),
	Target: pipeTarget,
})

Initializer ​

ts
new LambdaFunction(lambdaFunction: IFunction, parameters: LambdaFunctionParameters)
python
LambdaFunction(lambda_function: IFunction, parameters: LambdaFunctionParameters)
java
new LambdaFunction(IFunction lambdaFunction, LambdaFunctionParameters parameters)
csharp
new LambdaFunction(IFunction lambdaFunction, LambdaFunctionParameters parameters)
go
NewLambdaFunction(LambdaFunction IFunction, Parameters LambdaFunctionParameters)

Properties ​

targetArnstringtarget_arnstrtargetArnStringTargetArnstringTargetArn*string#
The ARN of the target resource.

Methods ​

bind(pipe: IPipe): TargetConfigdef bind(self, pipe: IPipe) -> TargetConfigpublic TargetConfig bind(IPipe pipe)public TargetConfig Bind(IPipe pipe)func Bind(Pipe IPipe) TargetConfig#
Bind this target to a pipe.
grantPush(grantee: IRole): voiddef grant_push(self, grantee: IRole) -> Nonepublic void grantPush(IRole grantee)public void GrantPush(IRole grantee)func GrantPush(Grantee IRole)#
Grant the pipe role to push to the target.