# NatRuleProperty

A static 1:1 NAT rule.

Traffic whose source address falls within MatchSourceCidr is translated to the corresponding address in NatCidr.

- Source: Generated at build time
- Type last changed: v2.276.0 · 10 Nov 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 natRuleProperty: ec2.CfnTransitGatewayAttachmentNatConfiguration.NatRuleProperty = {
  matchSourceCidr: 'matchSourceCidr',
  natCidr: 'natCidr',
  ruleNumber: 123,
};
```

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

nat_rule_property = ec2.CfnTransitGatewayAttachmentNatConfiguration.NatRuleProperty(
    match_source_cidr="matchSourceCidr",
    nat_cidr="natCidr",
    rule_number=123
)
```

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

NatRuleProperty natRuleProperty = NatRuleProperty.builder()
        .matchSourceCidr("matchSourceCidr")
        .natCidr("natCidr")
        .ruleNumber(123)
        .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 natRuleProperty = new NatRuleProperty {
    MatchSourceCidr = "matchSourceCidr",
    NatCidr = "natCidr",
    RuleNumber = 123
};
```

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"

natRuleProperty := &NatRuleProperty{
	MatchSourceCidr: jsii.String("matchSourceCidr"),
	NatCidr: jsii.String("natCidr"),
	RuleNumber: jsii.Number(123),
}
```

## Properties

- `matchSourceCidr`: string (required) — The source CIDR that the rule matches on.

- `natCidr`: string (required) — The CIDR that the matched source addresses are translated to.

- `ruleNumber`: number (required) — The rule number.
