> **Experimental**
>
> `@aws-cdk/aws-ec2-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# RouteTargetProps

The type of endpoint or gateway being targeted by the route.

Extends: RouteTargetProps
Used as props by: RouteTargetType

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/route.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-ec2-alpha/lib/route.ts#L612)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2_alpha from '@aws-cdk/aws-ec2-alpha';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const routeTarget: ec2_alpha.IRouteTarget;
declare const vpcEndpoint: ec2.VpcEndpoint;
const routeTargetProps: ec2_alpha.RouteTargetProps = {
  endpoint: vpcEndpoint,
  gateway: routeTarget,
};
```

## Properties

- `endpoint`: [IVpcEndpoint](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpcEndpoint.html) — The endpoint route target.

  **Default:** target is not set to an endpoint, in this case a gateway is needed.

  This is used for targets such as
  VPC endpoints.

- `gateway`: [IRouteTarget](/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.IRouteTarget.html) — The gateway route target.

  **Default:** target is not set to a gateway, in this case an endpoint is needed.

  This is used for targets such as
  egress-only internet gateway or VPC peering connection.
