get Nat Ips
This data source provides the Vpc Nat Ips 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.GetNatIpsArgs;
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.getNatIps(GetNatIpsArgs.builder()
.natGatewayId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("vpcNatIpId1", ids.applyValue(getNatIpsResult -> getNatIpsResult.ips()[0].id()));
final var nameRegex = VpcFunctions.getNatIps(GetNatIpsArgs.builder()
.natGatewayId("example_value")
.nameRegex("^my-NatIp")
.build());
ctx.export("vpcNatIpId2", nameRegex.applyValue(getNatIpsResult -> getNatIpsResult.ips()[0].id()));
final var natIpCidr = VpcFunctions.getNatIps(GetNatIpsArgs.builder()
.natGatewayId("example_value")
.natIpCidr("example_value")
.nameRegex("^my-NatIp")
.build());
ctx.export("vpcNatIpId3", natIpCidr.applyValue(getNatIpsResult -> getNatIpsResult.ips()[0].id()));
final var natIpName = VpcFunctions.getNatIps(GetNatIpsArgs.builder()
.natGatewayId("example_value")
.ids("example_value")
.natIpNames("example_value")
.build());
ctx.export("vpcNatIpId4", natIpName.applyValue(getNatIpsResult -> getNatIpsResult.ips()[0].id()));
final var natIpIds = VpcFunctions.getNatIps(GetNatIpsArgs.builder()
.natGatewayId("example_value")
.ids("example_value")
.natIpIds("example_value")
.build());
ctx.export("vpcNatIpId5", natIpIds.applyValue(getNatIpsResult -> getNatIpsResult.ips()[0].id()));
final var status = VpcFunctions.getNatIps(GetNatIpsArgs.builder()
.natGatewayId("example_value")
.ids("example_value")
.status("example_value")
.build());
ctx.export("vpcNatIpId6", status.applyValue(getNatIpsResult -> getNatIpsResult.ips()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getNatIps.
Parameters
argument
A collection of arguments for invoking getNatIps.
suspend fun getNatIps(ids: List<String>? = null, nameRegex: String? = null, natGatewayId: String, natIpCidr: String? = null, natIpIds: List<String>? = null, natIpNames: List<String>? = null, outputFile: String? = null, status: String? = null): GetNatIpsResult
Return
A collection of values returned by getNatIps.
See also
Parameters
ids
A list of Nat Ip IDs.
name Regex
A regex string to filter results by Nat Ip name.
nat Gateway Id
The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
nat Ip Cidr
The CIDR block to which the NAT IP address belongs.
nat Ip Ids
nat Ip Names
The name of the NAT IP address.
output File
status
The status of the NAT IP address. Valid values: Available
, Deleting
and Creating
.
Return
A collection of values returned by getNatIps.
See also
Parameters
argument
Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetNatIpsPlainArgs.