get Nat Ip Cidrs
This data source provides the Vpc Nat Ip Cidrs of the current Alibaba Cloud user.
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.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNatIpCidrsArgs;
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 ids = VpcFunctions.getNatIpCidrs(GetNatIpCidrsArgs.builder()
.natGatewayId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("vpcNatIpCidrId1", ids.applyValue(getNatIpCidrsResult -> getNatIpCidrsResult.cidrs()[0].id()));
final var nameRegex = VpcFunctions.getNatIpCidrs(GetNatIpCidrsArgs.builder()
.natGatewayId("example_value")
.nameRegex("^my-NatIpCidr")
.build());
ctx.export("vpcNatIpCidrId2", nameRegex.applyValue(getNatIpCidrsResult -> getNatIpCidrsResult.cidrs()[0].id()));
final var status = VpcFunctions.getNatIpCidrs(GetNatIpCidrsArgs.builder()
.natGatewayId("example_value")
.ids("example_value-1")
.status("Available")
.build());
ctx.export("vpcNatIpCidrId3", status.applyValue(getNatIpCidrsResult -> getNatIpCidrsResult.cidrs()[0].id()));
final var natIpCidr = VpcFunctions.getNatIpCidrs(GetNatIpCidrsArgs.builder()
.natGatewayId("example_value")
.natIpCidrs("example_value-1")
.build());
ctx.export("vpcNatIpCidrId4", natIpCidr.applyValue(getNatIpCidrsResult -> getNatIpCidrsResult.cidrs()[0].id()));
final var atIpCidrName = VpcFunctions.getNatIpCidrs(GetNatIpCidrsArgs.builder()
.natGatewayId("example_value")
.natIpCidrNames("example_value-1")
.build());
ctx.export("vpcNatIpCidrId5", atIpCidrName.applyValue(getNatIpCidrsResult -> getNatIpCidrsResult.cidrs()[0].id()));
}
}
Return
A collection of values returned by getNatIpCidrs.
Parameters
A collection of arguments for invoking getNatIpCidrs.
Return
A collection of values returned by getNatIpCidrs.
See also
Parameters
A list of Nat Ip Cidr IDs.
A regex string to filter results by Nat Ip Cidr name.
The ID of the VPC NAT gateway.
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.
The NAT CIDR block to be created. Support up to 20
. 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.
File name where to save data source results (after running pulumi preview
).
The status of the CIDR block of the NAT gateway. If the value is Available
, the CIDR block is available.
Return
A collection of values returned by getNatIpCidrs.
See also
Parameters
Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetNatIpCidrsPlainArgs.