Interface INatInstanceProps
Properties for a NAT instance.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public interface INatInstanceProps
Syntax (vb)
Public Interface INatInstanceProps
Remarks
ExampleMetadata: lit=test/integ.nat-instances.lit.ts infused
Examples
// Configure the `natGatewayProvider` when defining a Vpc
var natGatewayProvider = NatProvider.Instance(new NatInstanceProps {
InstanceType = new InstanceType("t3.small")
});
var vpc = new Vpc(this, "MyVpc", new VpcProps {
NatGatewayProvider = natGatewayProvider,
// The 'natGateways' parameter now controls the number of NAT instances
NatGateways = 2
});
Synopsis
Properties
AllowAllTraffic | (deprecated) Allow all inbound traffic through the NAT instance. |
DefaultAllowedTraffic | Direction to allow all traffic through the NAT instance by default. |
InstanceType | Instance type of the NAT instance. |
KeyName | Name of SSH keypair to grant access to instance. |
MachineImage | The machine image (AMI) to use. |
SecurityGroup | Security Group for NAT instances. |
Properties
AllowAllTraffic
(deprecated) Allow all inbound traffic through the NAT instance.
virtual Nullable<bool> AllowAllTraffic { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
If you set this to false, you must configure the NAT instance's security
groups in another way, either by passing in a fully configured Security
Group using the securityGroup
property, or by configuring it using the
.securityGroup
or .connections
members after passing the NAT Instance
Provider to a Vpc.
Default: true
Stability: Deprecated
DefaultAllowedTraffic
Direction to allow all traffic through the NAT instance by default.
virtual Nullable<NatTrafficDirection> DefaultAllowedTraffic { get; }
Property Value
System.Nullable<NatTrafficDirection>
Remarks
By default, inbound and outbound traffic is allowed.
If you set this to another value than INBOUND_AND_OUTBOUND, you must
configure the NAT instance's security groups in another way, either by
passing in a fully configured Security Group using the securityGroup
property, or by configuring it using the .securityGroup
or
.connections
members after passing the NAT Instance Provider to a Vpc.
Default: NatTrafficDirection.INBOUND_AND_OUTBOUND
InstanceType
KeyName
Name of SSH keypair to grant access to instance.
virtual string KeyName { get; }
Property Value
System.String
Remarks
Default: - No SSH access will be possible.
MachineImage
The machine image (AMI) to use.
virtual IMachineImage MachineImage { get; }
Property Value
Remarks
By default, will do an AMI lookup for the latest NAT instance image.
If you have a specific AMI ID you want to use, pass a GenericLinuxImage
. For example:
NatProvider.Instance(new NatInstanceProps {
InstanceType = new InstanceType("t3.micro"),
MachineImage = new GenericLinuxImage(new Dictionary<string, string> {
{ "us-east-2", "ami-0f9c61b5a562a16af" }
})
});
Default: - Latest NAT instance image
SecurityGroup
Security Group for NAT instances.
virtual ISecurityGroup SecurityGroup { get; }
Property Value
Remarks
Default: - A new security group will be created