Class CfnNatGatewayPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.ec2.CfnNatGatewayPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:19:58.547Z") @Stability(Stable) public class CfnNatGatewayPropsMixin extends Mixin implements software.constructs.IMixin
Specifies a network address translation (NAT) gateway in the specified subnet.

You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address.

With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway. For more information, see NAT gateways in the Amazon VPC User Guide .

If you add a default route ( AWS::EC2::Route resource) that points to a NAT gateway, specify the NAT gateway ID for the route's NatGatewayId property.

When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see Allocate an Elastic IP address in the Amazon VPC User Guide .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.ec2.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnNatGatewayPropsMixin cfnNatGatewayPropsMixin = CfnNatGatewayPropsMixin.Builder.create(CfnNatGatewayMixinProps.builder()
         .allocationId("allocationId")
         .availabilityMode("availabilityMode")
         .availabilityZoneAddresses(List.of(AvailabilityZoneAddressProperty.builder()
                 .allocationIds(List.of("allocationIds"))
                 .availabilityZone("availabilityZone")
                 .availabilityZoneId("availabilityZoneId")
                 .build()))
         .connectivityType("connectivityType")
         .maxDrainDurationSeconds(123)
         .privateIpAddress("privateIpAddress")
         .secondaryAllocationIds(List.of("secondaryAllocationIds"))
         .secondaryPrivateIpAddressCount(123)
         .secondaryPrivateIpAddresses(List.of("secondaryPrivateIpAddresses"))
         .subnetId("subnetId")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .vpcId("vpcId")
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnNatGatewayPropsMixin

      protected CfnNatGatewayPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnNatGatewayPropsMixin

      protected CfnNatGatewayPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnNatGatewayPropsMixin

      @Stability(Stable) public CfnNatGatewayPropsMixin(@NotNull CfnNatGatewayMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::EC2::NatGateway.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnNatGatewayPropsMixin

      @Stability(Stable) public CfnNatGatewayPropsMixin(@NotNull CfnNatGatewayMixinProps props)
      Create a mixin to apply properties to AWS::EC2::NatGateway.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnNatGatewayMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()