Enum NatTrafficDirection
Direction of traffic to allow all by default.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum NatTrafficDirection
Syntax (vb)
Public Enum NatTrafficDirection
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. |
Fields
Name | Description |
---|---|
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. |