# CfnTransitGatewayRouteProps

Struct · External

Properties for defining a `CfnTransitGatewayRoute`.

Used as props by: [CfnTransitGatewayRoute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnTransitGatewayRoute.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnTransitGatewayRouteProps: ec2.CfnTransitGatewayRouteProps = {
  destinationCidrBlock: 'destinationCidrBlock',
  transitGatewayRouteTableId: 'transitGatewayRouteTableId',

  // the properties below are optional
  blackhole: false,
  transitGatewayAttachmentId: 'transitGatewayAttachmentId',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

cfn_transit_gateway_route_props = ec2.CfnTransitGatewayRouteProps(
    destination_cidr_block="destinationCidrBlock",
    transit_gateway_route_table_id="transitGatewayRouteTableId",

    # the properties below are optional
    blackhole=False,
    transit_gateway_attachment_id="transitGatewayAttachmentId"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

CfnTransitGatewayRouteProps cfnTransitGatewayRouteProps = CfnTransitGatewayRouteProps.builder()
        .destinationCidrBlock("destinationCidrBlock")
        .transitGatewayRouteTableId("transitGatewayRouteTableId")

        // the properties below are optional
        .blackhole(false)
        .transitGatewayAttachmentId("transitGatewayAttachmentId")
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var cfnTransitGatewayRouteProps = new CfnTransitGatewayRouteProps {
    DestinationCidrBlock = "destinationCidrBlock",
    TransitGatewayRouteTableId = "transitGatewayRouteTableId",

    // the properties below are optional
    Blackhole = false,
    TransitGatewayAttachmentId = "transitGatewayAttachmentId"
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnTransitGatewayRouteProps := &CfnTransitGatewayRouteProps{
	DestinationCidrBlock: jsii.String("destinationCidrBlock"),
	TransitGatewayRouteTableId: jsii.String("transitGatewayRouteTableId"),

	// the properties below are optional
	Blackhole: jsii.Boolean(false),
	TransitGatewayAttachmentId: jsii.String("transitGatewayAttachmentId"),
}
```

## Properties

- `blackhole`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether to drop traffic that matches this route.

- `destinationCidrBlock`: string (required) — The CIDR block used for destination matches.

- `transitGatewayAttachmentId`: string | [ITransitGatewayAttachmentRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ITransitGatewayAttachmentRef.html) | [ITransitGatewayPeeringAttachmentRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ITransitGatewayPeeringAttachmentRef.html) — The ID of the attachment.

- `transitGatewayRouteTableId`: string | [ITransitGatewayRouteTableRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_ec2.ITransitGatewayRouteTableRef.html) (required) — The ID of the transit gateway route table.
