Experimental
@aws-cdk/aws-pipes-targets-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
SnsTargetParameters Struct
SNS target properties.
| Stability | Experimental |
|---|---|
| Source | lib/sns.ts |
Example
ts
declare const sourceQueue: sqs.Queue;
declare const targetTopic: sns.Topic;
const pipeTarget = new targets.SnsTarget(targetTopic,
{
inputTransformation: pipes.InputTransformation.fromObject(
{
"SomeKey": pipes.DynamicInput.fromEventPath('$.body')
})
}
);
const pipe = new pipes.Pipe(this, 'Pipe', {
source: new SqsSource(sourceQueue),
target: pipeTarget
});
python
# source_queue: sqs.Queue
# target_topic: sns.Topic
pipe_target = targets.SnsTarget(target_topic,
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
)
java
Queue sourceQueue;
Topic targetTopic;
SnsTarget pipeTarget = SnsTarget.Builder.create(targetTopic)
.inputTransformation(InputTransformation.fromObject(Map.of(
"SomeKey", DynamicInput.fromEventPath("$.body"))))
.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;
Topic targetTopic;
var pipeTarget = new SnsTarget(targetTopic, new SnsTargetParameters {
InputTransformation = InputTransformation.FromObject(new Dictionary<string, object> {
{ "SomeKey", DynamicInput.FromEventPath("$.body") }
})
});
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 targetTopic Topic
pipeTarget := targets.NewSnsTarget(targetTopic, &SnsTargetParameters{
InputTransformation: pipes.InputTransformation_FromObject(map[string]interface{}{
"SomeKey": pipes.DynamicInput_fromEventPath(jsii.String("$.body")),
}),
})
pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
Source: awscdkpipessourcesalpha.NewSqsSource(sourceQueue),
Target: pipeTarget,
})
Properties
inputTransformationoptionalIInputTransformationinput_transformationoptionalIInputTransformationinputTransformationoptionalIInputTransformationInputTransformationoptionalIInputTransformationInputTransformationoptionalIInputTransformation = none #The input transformation to apply to the message before sending it to the target.