NatInstanceProps

class aws_cdk.aws_ec2.NatInstanceProps(*, instance_type, allow_all_traffic=None, key_name=None, machine_image=None, security_group=None)

Bases: object

(experimental) Properties for a NAT instance.

Parameters
  • instance_type (InstanceType) – (experimental) Instance type of the NAT instance.

  • allow_all_traffic (Optional[bool]) – (experimental) Allow all traffic through the NAT instance. 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

  • key_name (Optional[str]) – (experimental) Name of SSH keypair to grant access to instance. Default: - No SSH access will be possible.

  • machine_image (Optional[IMachineImage]) – (experimental) The machine image (AMI) to use. 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:: ec2.NatProvider.instance({ instanceType: new ec2.InstanceType(‘t3.micro’), machineImage: new ec2.GenericLinuxImage({ ‘us-east-2’: ‘ami-0f9c61b5a562a16af’ }) }) Default: - Latest NAT instance image

  • security_group (Optional[ISecurityGroup]) – (experimental) Security Group for NAT instances. Default: - A new security group will be created

Stability

experimental

Attributes

allow_all_traffic

(experimental) Allow all traffic through the NAT instance.

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

experimental

Return type

Optional[bool]

instance_type

(experimental) Instance type of the NAT instance.

Stability

experimental

Return type

InstanceType

key_name

(experimental) Name of SSH keypair to grant access to instance.

Default
  • No SSH access will be possible.

Stability

experimental

Return type

Optional[str]

machine_image

(experimental) The machine image (AMI) to use.

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:

# Example automatically generated. See https://github.com/aws/jsii/issues/826
ec2.NatProvider.instance(
    instance_type=ec2.InstanceType("t3.micro"),
    machine_image=ec2.GenericLinuxImage(
        us-east-2="ami-0f9c61b5a562a16af"
    )
)
Default
  • Latest NAT instance image

Stability

experimental

Return type

Optional[IMachineImage]

security_group

(experimental) Security Group for NAT instances.

Default
  • A new security group will be created

Stability

experimental

Return type

Optional[ISecurityGroup]