Class NatTrafficDirection
Direction of traffic to allow all by default.
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class NatTrafficDirection : Enum
Syntax (vb)
Public NotInheritable Class NatTrafficDirection
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
var natGatewayProvider = NatProvider.InstanceV2(new NatInstanceProps {
InstanceType = new InstanceType("t3.small"),
DefaultAllowedTraffic = NatTrafficDirection.NONE
});
var vpc = new Vpc(this, "Vpc", new VpcProps { NatGatewayProvider = natGatewayProvider });
var securityGroup = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps {
Vpc = vpc,
AllowAllOutbound = false
});
securityGroup.AddEgressRule(Peer.AnyIpv4(), Port.Tcp(443));
for (var gatewayInstance in natGatewayProvider.GatewayInstances)
{
gatewayInstance.AddSecurityGroup(securityGroup);
}
Synopsis
Fields
INBOUND_AND_OUTBOUND | Allow all outbound and inbound traffic. |
NONE | Disallow all outbound and inbound traffic. |
OUTBOUND_ONLY | Allow all outbound traffic and disallow all inbound traffic. |
value__ |
Fields
INBOUND_AND_OUTBOUND
Allow all outbound and inbound traffic.
public const NatTrafficDirection INBOUND_AND_OUTBOUND
Field Value
Type | Description |
---|---|
Nat |
NONE
Disallow all outbound and inbound traffic.
public const NatTrafficDirection NONE
Field Value
Type | Description |
---|---|
Nat |
OUTBOUND_ONLY
Allow all outbound traffic and disallow all inbound traffic.
public const NatTrafficDirection OUTBOUND_ONLY
Field Value
Type | Description |
---|---|
Nat |
value__
public int value__
Field Value
Type | Description |
---|---|
System. |