NatIpArgs

data class NatIpArgs(val dryRun: Output<Boolean>? = null, val natGatewayId: Output<String>? = null, val natIp: Output<String>? = null, val natIpCidr: Output<String>? = null, val natIpCidrId: Output<String>? = null, val natIpDescription: Output<String>? = null, val natIpName: Output<String>? = null) : ConvertibleToJava<NatIpArgs>

Provides a VPC Nat Ip resource. For information about VPC Nat Ip and how to use it, see What is Nat Ip.

NOTE: Available in v1.136.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.vpc.NatGateway;
import com.pulumi.alicloud.vpc.NatGatewayArgs;
import com.pulumi.alicloud.vpc.NatIpCidr;
import com.pulumi.alicloud.vpc.NatIpCidrArgs;
import com.pulumi.alicloud.vpc.NatIp;
import com.pulumi.alicloud.vpc.NatIpArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var exampleZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.16.0.0/12")
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.vpcId(exampleNetwork.id())
.cidrBlock("172.16.0.0/21")
.zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName("terraform-example")
.build());
var exampleNatGateway = new NatGateway("exampleNatGateway", NatGatewayArgs.builder()
.vpcId(exampleNetwork.id())
.internetChargeType("PayByLcu")
.natGatewayName("terraform-example")
.description("terraform-example")
.natType("Enhanced")
.vswitchId(exampleSwitch.id())
.networkType("intranet")
.build());
var exampleNatIpCidr = new NatIpCidr("exampleNatIpCidr", NatIpCidrArgs.builder()
.natIpCidr("192.168.0.0/16")
.natGatewayId(exampleNatGateway.id())
.natIpCidrDescription("terraform-example")
.natIpCidrName("terraform-example")
.build());
var exampleNatIp = new NatIp("exampleNatIp", NatIpArgs.builder()
.natIp("192.168.0.37")
.natGatewayId(exampleNatGateway.id())
.natIpDescription("example_value")
.natIpName("example_value")
.natIpCidr(exampleNatIpCidr.natIpCidr())
.build());
}
}

Import

VPC Nat Ip can be imported using the id, e.g.

$ pulumi import alicloud:vpc/natIp:NatIp example <nat_gateway_id>:<nat_ip_id>

Constructors

Link copied to clipboard
fun NatIpArgs(dryRun: Output<Boolean>? = null, natGatewayId: Output<String>? = null, natIp: Output<String>? = null, natIpCidr: Output<String>? = null, natIpCidrId: Output<String>? = null, natIpDescription: Output<String>? = null, natIpName: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): NatIpArgs

Properties

Link copied to clipboard
val dryRun: Output<Boolean>? = null

Specifies whether to check the validity of the request without actually making the request.

Link copied to clipboard
val natGatewayId: Output<String>? = null

The ID of the Virtual Private Cloud (VPC) NAT gateway for which you want to create the NAT IP address.

Link copied to clipboard
val natIp: Output<String>? = null

The NAT IP address that you want to create. If you do not specify an IP address, the system selects a random IP address from the specified CIDR block.

Link copied to clipboard
val natIpCidr: Output<String>? = null

NAT IP ADDRESS of the address segment.

Link copied to clipboard
val natIpCidrId: Output<String>? = null

The ID of the CIDR block to which the NAT IP address belongs.

Link copied to clipboard
val natIpDescription: Output<String>? = null

NAT IP ADDRESS description of information. Length is from 2 to 256 characters, must start with a letter or the Chinese at the beginning, but not at thehttp:// Or https:// at the beginning.

Link copied to clipboard
val natIpName: Output<String>? = null

NAT IP ADDRESS the name of the root directory. Length is from 2 to 128 characters, must start with a letter or the Chinese at the beginning can contain numbers, half a period (.), underscore (_) and dash (-). But do not start with http:// or https:// at the beginning.