# TransitGatewayPolicyRuleProperty

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 2026

## 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 transitGatewayPolicyRuleProperty: ec2.CfnTransitGatewayPolicyTableEntry.TransitGatewayPolicyRuleProperty = {
  destinationCidrBlock: 'destinationCidrBlock',
  destinationPortRange: 'destinationPortRange',
  protocol: 'protocol',
  sourceCidrBlock: 'sourceCidrBlock',
  sourcePortRange: 'sourcePortRange',
};
```

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

transit_gateway_policy_rule_property = ec2.CfnTransitGatewayPolicyTableEntry.TransitGatewayPolicyRuleProperty(
    destination_cidr_block="destinationCidrBlock",
    destination_port_range="destinationPortRange",
    protocol="protocol",
    source_cidr_block="sourceCidrBlock",
    source_port_range="sourcePortRange"
)
```

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.*;

TransitGatewayPolicyRuleProperty transitGatewayPolicyRuleProperty = TransitGatewayPolicyRuleProperty.builder()
        .destinationCidrBlock("destinationCidrBlock")
        .destinationPortRange("destinationPortRange")
        .protocol("protocol")
        .sourceCidrBlock("sourceCidrBlock")
        .sourcePortRange("sourcePortRange")
        .build();
```

C# / .NET:

```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 transitGatewayPolicyRuleProperty = new TransitGatewayPolicyRuleProperty {
    DestinationCidrBlock = "destinationCidrBlock",
    DestinationPortRange = "destinationPortRange",
    Protocol = "protocol",
    SourceCidrBlock = "sourceCidrBlock",
    SourcePortRange = "sourcePortRange"
};
```

Golang:

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

transitGatewayPolicyRuleProperty := &TransitGatewayPolicyRuleProperty{
	DestinationCidrBlock: jsii.String("destinationCidrBlock"),
	DestinationPortRange: jsii.String("destinationPortRange"),
	Protocol: jsii.String("protocol"),
	SourceCidrBlock: jsii.String("sourceCidrBlock"),
	SourcePortRange: jsii.String("sourcePortRange"),
}
```

## Properties

- `destinationCidrBlock`: string — The destination CIDR block for the transit gateway policy rule.

- `destinationPortRange`: string — The destination port range for the transit gateway policy rule.

- `protocol`: string — The protocol for the transit gateway policy rule.

- `sourceCidrBlock`: string — The source CIDR block for the transit gateway policy rule.

- `sourcePortRange`: string — The source port range for the transit gateway policy rule.
