> **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.
# ApiDestinationTarget

An EventBridge Pipes target that sends messages to an EventBridge API destination.

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/api-destination.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-pipes-targets-alpha/lib/api-destination.ts#L49)

## Example

TypeScript:

```ts
declare const sourceQueue: sqs.Queue;
declare const dest: events.ApiDestination;

const apiTarget = new targets.ApiDestinationTarget(dest);

const pipe = new pipes.Pipe(this, 'Pipe', {
    source: new SqsSource(sourceQueue),
    target: apiTarget,
});
```

Python:

```python
# source_queue: sqs.Queue
# dest: events.ApiDestination

api_target = targets.ApiDestinationTarget(dest)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=api_target
)
```

Java:

```java
Queue sourceQueue;
ApiDestination dest;

ApiDestinationTarget apiTarget = new ApiDestinationTarget(dest);

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

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Pipes.Targets.Alpha
Queue sourceQueue;
ApiDestination dest;

var apiTarget = new ApiDestinationTarget(dest);

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SqsSource(sourceQueue),
    Target = apiTarget
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkpipestargetsalpha/v2
var sourceQueue Queue
var dest ApiDestination

apiTarget := targets.NewApiDestinationTarget(dest)

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

## Initializer

TypeScript:

```ts
new ApiDestinationTarget(destination: IApiDestination, parameters?: ApiDestinationTargetParameters)
```

Python:

```python
ApiDestinationTarget(destination: IApiDestination, parameters: typing.Optional[ApiDestinationTargetParameters] = None)
```

Java:

```java
new ApiDestinationTarget(IApiDestination destination, ApiDestinationTargetParameters parameters)
```

C# / .NET:

```csharp
new ApiDestinationTarget(IApiDestination destination, ApiDestinationTargetParameters? parameters = null)
```

Golang:

```go
NewApiDestinationTarget(Destination IApiDestination, Parameters ApiDestinationTargetParameters)
```

## 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.
