> **Experimental**
>
> `@aws-cdk/aws-pipes-targets-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# SnsTarget

A EventBridge Pipes target that sends messages to an SNS topic.

Implements: [ITarget](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.ITarget.html)

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/sns.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sns.ts#L21)

## Example

TypeScript:

```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:

```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
)
```

Java:

```java
Queue sourceQueue;
Topic targetTopic;

SnsTarget pipeTarget = new SnsTarget(targetTopic);

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SqsSource(sourceQueue))
        .target(pipeTarget)
        .build();
```

C# / .NET:

```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
});
```

Golang:

```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

TypeScript:

```ts
new SnsTarget(topic: ITopic, parameters?: SnsTargetParameters)
```

Python:

```python
SnsTarget(topic: ITopic, parameters: typing.Optional[SnsTargetParameters] = None)
```

Java:

```java
new SnsTarget(ITopic topic, SnsTargetParameters parameters)
```

C# / .NET:

```csharp
new SnsTarget(ITopic topic, SnsTargetParameters? parameters = null)
```

Golang:

```go
NewSnsTarget(Topic ITopic, Parameters SnsTargetParameters)
```

## Properties

- `targetArn`: string — The ARN of the target resource.

## Methods

- `bind(pipe: IPipe): TargetConfig` — Bind this target to a pipe.

- `grantPush(grantee: IRole): void` — Grant the pipe role to push to the target.
