NatIpCidrArgs

data class NatIpCidrArgs(val dryRun: Output<Boolean>? = null, val natGatewayId: Output<String>? = null, val natIpCidr: Output<String>? = null, val natIpCidrDescription: Output<String>? = null, val natIpCidrName: Output<String>? = null) : ConvertibleToJava<NatIpCidrArgs>

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

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 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()
.natGatewayId(exampleNatGateway.id())
.natIpCidrName("terraform-example")
.natIpCidr("192.168.0.0/16")
.build());
}
}

Import

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

$ pulumi import alicloud:vpc/natIpCidr:NatIpCidr example <nat_gateway_id>:<nat_ip_cidr>

Constructors

Link copied to clipboard
fun NatIpCidrArgs(dryRun: Output<Boolean>? = null, natGatewayId: Output<String>? = null, natIpCidr: Output<String>? = null, natIpCidrDescription: Output<String>? = null, natIpCidrName: Output<String>? = null)

Functions

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

Properties

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

Specifies whether to precheck this request only. Valid values: true and false.

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

The ID of the Virtual Private Cloud (VPC) NAT gateway where you want to create the NAT CIDR block.

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

The NAT CIDR block to be created. The CIDR block must meet the following conditions: It must be 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, or one of their subnets. The subnet mask must be 16 to 32 bits in lengths. To use a public CIDR block as the NAT CIDR block, the VPC to which the VPC NAT gateway belongs must be authorized to use public CIDR blocks. For more information, see Create a VPC NAT gateway.

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

The description of the NAT CIDR block. The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

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

The name of the NAT CIDR block. The name must be 2 to 128 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It must start with a letter but cannot start with http:// or https://.