Skip to content

NatGateway

This class encapsulates and extends the ROS resource type ALIYUN::VPC::NatGatewayThe , which resource type creates a NAT Gateway.

Initializers

import com.aliyun.ros.cdk.vpc.NatGateway;
NatGateway.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .vpcId(java.lang.String)
    .vpcId(IResolvable)
    .vSwitchId(java.lang.String)
    .vSwitchId(IResolvable)
//  .accessMode(IResolvable)
//  .accessMode(AccessModeProperty)
//  .availabilityMode(java.lang.String)
//  .availabilityMode(IResolvable)
//  .deletionForce(java.lang.Boolean)
//  .deletionForce(IResolvable)
//  .deletionProtection(java.lang.Boolean)
//  .deletionProtection(IResolvable)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .eipBindMode(java.lang.String)
//  .eipBindMode(IResolvable)
//  .icmpReplyEnabled(java.lang.Boolean)
//  .icmpReplyEnabled(IResolvable)
//  .instanceChargeType(java.lang.String)
//  .instanceChargeType(IResolvable)
//  .internetChargeType(java.lang.String)
//  .internetChargeType(IResolvable)
//  .ipv4Prefix(java.lang.String)
//  .ipv4Prefix(IResolvable)
//  .natGatewayName(java.lang.String)
//  .natGatewayName(IResolvable)
//  .natIp(java.lang.String)
//  .natIp(IResolvable)
//  .natType(java.lang.String)
//  .natType(IResolvable)
//  .networkType(java.lang.String)
//  .networkType(IResolvable)
//  .privateLinkEnabled(java.lang.Boolean)
//  .privateLinkEnabled(IResolvable)
//  .securityProtectionEnabled(java.lang.Boolean)
//  .securityProtectionEnabled(IResolvable)
//  .tags(java.util.List<TagsProperty>)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
vpcId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property vpcId: The VPC id to create NAT gateway.
vSwitchId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property vSwitchId: The VSwitch id to create NAT gateway.
accessMode com.aliyun.ros.cdk.core.IResolvable OR AccessModeProperty Property accessMode: Reverse access mode to the VPC NAT gateway.
availabilityMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property availabilityMode: The availability mode of the NAT gateway.
deletionForce java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property deletionForce: Whether force delete the relative snat and dnat entries in the net gateway and unbind eips.
deletionProtection java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property deletionProtection: Whether to enable deletion protection.
description java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property description: Description of the NAT gateway, [2, 256] characters.
eipBindMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property eipBindMode: The mode in which the EIP is associated with the NAT gateway.
icmpReplyEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property icmpReplyEnabled: Specifies whether to enable the ICMP non-retrieval feature.
instanceChargeType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceChargeType: The billing method.
internetChargeType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property internetChargeType: The billing method for the NAT gateway.
ipv4Prefix java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property ipv4Prefix: The IPv4 prefix.
natGatewayName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property natGatewayName: Display name of the NAT gateway, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
natIp java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property natIp: The NAT IP address.
natType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property natType: The type of the NAT gateway.
networkType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property networkType: The type of the created NAT gateway.
privateLinkEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property privateLinkEnabled: Whether to support private network connection.
securityProtectionEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property securityProtectionEnabled: Specifies whether to enable the firewall feature.
tags java.util.List<TagsProperty> Property tags: Tags to attach to natgateway.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

vpcIdRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property vpcId: The VPC id to create NAT gateway.


vSwitchIdRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property vSwitchId: The VSwitch id to create NAT gateway.


accessModeOptional

Property accessMode: Reverse access mode to the VPC NAT gateway.


availabilityModeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property availabilityMode: The availability mode of the NAT gateway.

Valid values: CrossAZ, SingleAZ


deletionForceOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property deletionForce: Whether force delete the relative snat and dnat entries in the net gateway and unbind eips.

Default value is false.


deletionProtectionOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property deletionProtection: Whether to enable deletion protection.

Default to False.


descriptionOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property description: Description of the NAT gateway, [2, 256] characters.

Do not fill or empty, the default is empty.


eipBindModeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property eipBindMode: The mode in which the EIP is associated with the NAT gateway.

Valid values:MULTI_BINDED (default): the multi-EIP-to-ENI mode. NAT: NAT mode. IPv4 gateways are supported. Note If the EIP is associated with the NAT gateway in NAT mode, the EIP occupies a private IP address of the vSwitch to which the NAT gateway belongs. Make sure that the vSwitch has sufficient private IP addresses. Otherwise, the EIP cannot be associated with the NAT gateway. In NAT mode, a maximum number of 50 EIPs can be associated with each NAT gateway.


icmpReplyEnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property icmpReplyEnabled: Specifies whether to enable the ICMP non-retrieval feature.

Default: True


instanceChargeTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property instanceChargeType: The billing method.

The default value is PostPaid (which means pay-as-you-go).


internetChargeTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property internetChargeType: The billing method for the NAT gateway.

Valid values: PayBySpec: billed on a pay-by-specification basis.


ipv4PrefixOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property ipv4Prefix: The IPv4 prefix.


natGatewayNameOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property natGatewayName: Display name of the NAT gateway, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'.


natIpOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property natIp: The NAT IP address.


natTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property natType: The type of the NAT gateway.

Valid values:

  • Enhanced: enhanced NAT gateway.

networkTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property networkType: The type of the created NAT gateway.

Internet: public network NAT gateway. Intranet: VPC NAT gateway.


privateLinkEnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property privateLinkEnabled: Whether to support private network connection.


securityProtectionEnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property securityProtectionEnabled: Specifies whether to enable the firewall feature.

Default: False


tagsOptional

Property tags: Tags to attach to natgateway.

Max support 20 tags to add during create natgateway. Each tag with two properties Key and Value, and Key is required.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.vpc.NatGateway;
NatGateway.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrForwardTableId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute ForwardTableId: The forward table id.
attrNatGatewayId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute NatGatewayId: The Id of created NAT gateway.
attrSNatTableId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SNatTableId: The SNAT table id.
props NatGatewayProps No description.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.ros.cdk.core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrForwardTableIdRequired

public java.lang.Object getAttrForwardTableId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute ForwardTableId: The forward table id.


attrNatGatewayIdRequired

public java.lang.Object getAttrNatGatewayId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute NatGatewayId: The Id of created NAT gateway.


attrSNatTableIdRequired

public java.lang.Object getAttrSNatTableId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SNatTableId: The SNAT table id.


propsRequired

public NatGatewayProps getProps();