Skip to content
v2.277.0

NatRuleProperty Struct ​

A static 1:1 NAT rule.

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

Example ​

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
# 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
// 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();
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
};
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 ​

matchSourceCidrstringmatch_source_cidrstrmatchSourceCidrStringMatchSourceCidrstringMatchSourceCidr*string required #
The source CIDR that the rule matches on.
natCidrstringnat_cidrstrnatCidrStringNatCidrstringNatCidr*string required #
The CIDR that the matched source addresses are translated to.
ruleNumbernumberrule_numberint | floatruleNumberNumberRuleNumberdoubleRuleNumber*float64 required #
The rule number.