Skip to content

NatGateway

This class encapsulates and extends the ROS resource type ALIYUN::VPC::NatGateway, which is used to create 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)
//  .autoPay(java.lang.Boolean)
//  .autoPay(IResolvable)
//  .deletionForce(java.lang.Boolean)
//  .deletionForce(IResolvable)
//  .deletionProtection(java.lang.Boolean)
//  .deletionProtection(IResolvable)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .duration(java.lang.Number)
//  .duration(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)
//  .natGatewayName(java.lang.String)
//  .natGatewayName(IResolvable)
//  .natType(java.lang.String)
//  .natType(IResolvable)
//  .networkType(java.lang.String)
//  .networkType(IResolvable)
//  .pricingCycle(java.lang.String)
//  .pricingCycle(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.
autoPay java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property autoPay: Specifies whether to enable automatic payment.
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.
duration java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property duration: The subscription duration.
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.
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 '.', '-'.
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.
pricingCycle java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property pricingCycle: Price cycle of the resource.
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.


autoPayOptional

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

Property autoPay: Specifies whether to enable automatic payment.

Default is true.


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.


durationOptional

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

Property duration: The subscription duration.

While choose by pay by month, it could be from 1 to 9 or 12, 24, 36. While choose pay by year, it could be from 1 to 3.


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.


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 '.', '-'.


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.


pricingCycleOptional

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

Property pricingCycle: Price cycle of the resource.

This property has no default value.


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.
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

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.
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 com.aliyun.ros.cdk.core.IResolvable Attribute ForwardTableId: The forward table id.
attrNatGatewayId com.aliyun.ros.cdk.core.IResolvable Attribute NatGatewayId: The Id of created NAT gateway.
attrSNatTableId com.aliyun.ros.cdk.core.IResolvable Attribute SNatTableId: The SNAT table id.

nodeRequired

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

The construct tree node associated with this construct.


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 IResolvable getAttrForwardTableId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ForwardTableId: The forward table id.


attrNatGatewayIdRequired

public IResolvable getAttrNatGatewayId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute NatGatewayId: The Id of created NAT gateway.


attrSNatTableIdRequired

public IResolvable getAttrSNatTableId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute SNatTableId: The SNAT table id.