SnsTarget Class
A EventBridge Pipes target that sends messages to an SNS topic.
Example
ts
declare const sourceQueue: sqs.Queue;
declare const targetTopic: sns.Topic;
const pipeTarget = new targets.SnsTarget(targetTopic);
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)
pipe = pipes.Pipe(self, "Pipe",
source=SqsSource(source_queue),
target=pipe_target
)
csharp
// Install: dotnet add package Amazon.CDK.AWS.Pipes.Targets.Alpha
Queue sourceQueue;
Topic targetTopic;
var pipeTarget = new SnsTarget(targetTopic);
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)
pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
Source: awscdkpipessourcesalpha.NewSqsSource(sourceQueue),
Target: pipeTarget,
})
Initializer
ts
new SnsTarget(topic: ITopic, parameters?: SnsTargetParameters)
python
SnsTarget(topic: ITopic, parameters: typing.Optional[SnsTargetParameters] = None)
java
new SnsTarget(ITopic topic, SnsTargetParameters parameters)
csharp
new SnsTarget(ITopic topic, SnsTargetParameters? parameters = null)
go
NewSnsTarget(Topic ITopic, Parameters SnsTargetParameters)
Properties
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.