Interface NatInstanceProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
NatInstanceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-03-14T22:21:53.956Z") @Stability(Stable) public interface NatInstanceProps extends software.amazon.jsii.JsiiSerializable
Properties for a NAT instance.

Example:

 NatInstanceProvider natInstanceProvider = NatProvider.instance(NatInstanceProps.builder()
         .instanceType(InstanceType.of(InstanceClass.T4G, InstanceSize.LARGE))
         .machineImage(new AmazonLinuxImage())
         .creditSpecification(CpuCredits.UNLIMITED)
         .build());
 Vpc.Builder.create(this, "VPC")
         .natGatewayProvider(natInstanceProvider)
         .build();
 
  • Method Details

    • getInstanceType

      @Stability(Stable) @NotNull InstanceType getInstanceType()
      Instance type of the NAT instance.
    • getCreditSpecification

      @Stability(Stable) @Nullable default CpuCredits getCreditSpecification()
      Specifying the CPU credit type for burstable EC2 instance types (T2, T3, T3a, etc).

      The unlimited CPU credit option is not supported for T3 instances with dedicated host (host) tenancy.

      Default: - T2 instances are standard, while T3, T4g, and T3a instances are unlimited.

    • getDefaultAllowedTraffic

      @Stability(Stable) @Nullable default NatTrafficDirection getDefaultAllowedTraffic()
      Direction to allow all traffic through the NAT instance by default.

      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

    • getKeyName

      @Stability(Deprecated) @Deprecated @Nullable default String getKeyName()
      Deprecated.
      • Use keyPair instead - https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2-readme.html#using-an-existing-ec2-key-pair
      (deprecated) Name of SSH keypair to grant access to instance.

      Default: - No SSH access will be possible.

    • getKeyPair

      @Stability(Stable) @Nullable default IKeyPair getKeyPair()
      The SSH keypair to grant access to the instance.

      Default: - No SSH access will be possible.

    • getMachineImage

      @Stability(Stable) @Nullable default IMachineImage getMachineImage()
      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:

       NatProvider.instance(NatInstanceProps.builder()
               .instanceType(new InstanceType("t3.micro"))
               .machineImage(new GenericLinuxImage(Map.of(
                       "us-east-2", "ami-0f9c61b5a562a16af")))
               .build());
       

      Default: - Latest NAT instance image

    • getSecurityGroup

      @Stability(Stable) @Nullable default ISecurityGroup getSecurityGroup()
      Security Group for NAT instances.

      Default: - A new security group will be created

    • builder

      @Stability(Stable) static NatInstanceProps.Builder builder()
      Returns:
      a NatInstanceProps.Builder of NatInstanceProps