alicloud.vpc.getNatIps
Explore with Pulumi AI
This data source provides the Vpc Nat Ips of the current Alibaba Cloud user.
NOTE: Available in v1.136.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Vpc.GetNatIps.Invoke(new()
{
NatGatewayId = "example_value",
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var nameRegex = AliCloud.Vpc.GetNatIps.Invoke(new()
{
NatGatewayId = "example_value",
NameRegex = "^my-NatIp",
});
var natIpCidr = AliCloud.Vpc.GetNatIps.Invoke(new()
{
NatGatewayId = "example_value",
NatIpCidr = "example_value",
NameRegex = "^my-NatIp",
});
var natIpName = AliCloud.Vpc.GetNatIps.Invoke(new()
{
NatGatewayId = "example_value",
Ids = new[]
{
"example_value",
},
NatIpNames = new[]
{
"example_value",
},
});
var natIpIds = AliCloud.Vpc.GetNatIps.Invoke(new()
{
NatGatewayId = "example_value",
Ids = new[]
{
"example_value",
},
NatIpIds = new[]
{
"example_value",
},
});
var status = AliCloud.Vpc.GetNatIps.Invoke(new()
{
NatGatewayId = "example_value",
Ids = new[]
{
"example_value",
},
Status = "example_value",
});
return new Dictionary<string, object?>
{
["vpcNatIpId1"] = ids.Apply(getNatIpsResult => getNatIpsResult.Ips[0]?.Id),
["vpcNatIpId2"] = nameRegex.Apply(getNatIpsResult => getNatIpsResult.Ips[0]?.Id),
["vpcNatIpId3"] = natIpCidr.Apply(getNatIpsResult => getNatIpsResult.Ips[0]?.Id),
["vpcNatIpId4"] = natIpName.Apply(getNatIpsResult => getNatIpsResult.Ips[0]?.Id),
["vpcNatIpId5"] = natIpIds.Apply(getNatIpsResult => getNatIpsResult.Ips[0]?.Id),
["vpcNatIpId6"] = status.Apply(getNatIpsResult => getNatIpsResult.Ips[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := vpc.GetNatIps(ctx, &vpc.GetNatIpsArgs{
NatGatewayId: "example_value",
Ids: []string{
"example_value-1",
"example_value-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcNatIpId1", ids.Ips[0].Id)
nameRegex, err := vpc.GetNatIps(ctx, &vpc.GetNatIpsArgs{
NatGatewayId: "example_value",
NameRegex: pulumi.StringRef("^my-NatIp"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcNatIpId2", nameRegex.Ips[0].Id)
natIpCidr, err := vpc.GetNatIps(ctx, &vpc.GetNatIpsArgs{
NatGatewayId: "example_value",
NatIpCidr: pulumi.StringRef("example_value"),
NameRegex: pulumi.StringRef("^my-NatIp"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcNatIpId3", natIpCidr.Ips[0].Id)
natIpName, err := vpc.GetNatIps(ctx, &vpc.GetNatIpsArgs{
NatGatewayId: "example_value",
Ids: []string{
"example_value",
},
NatIpNames: []string{
"example_value",
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcNatIpId4", natIpName.Ips[0].Id)
natIpIds, err := vpc.GetNatIps(ctx, &vpc.GetNatIpsArgs{
NatGatewayId: "example_value",
Ids: []string{
"example_value",
},
NatIpIds: []string{
"example_value",
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcNatIpId5", natIpIds.Ips[0].Id)
status, err := vpc.GetNatIps(ctx, &vpc.GetNatIpsArgs{
NatGatewayId: "example_value",
Ids: []string{
"example_value",
},
Status: pulumi.StringRef("example_value"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcNatIpId6", status.Ips[0].Id)
return nil
})
}
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()));
}
}
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_nat_ips(nat_gateway_id="example_value",
ids=[
"example_value-1",
"example_value-2",
])
pulumi.export("vpcNatIpId1", ids.ips[0].id)
name_regex = alicloud.vpc.get_nat_ips(nat_gateway_id="example_value",
name_regex="^my-NatIp")
pulumi.export("vpcNatIpId2", name_regex.ips[0].id)
nat_ip_cidr = alicloud.vpc.get_nat_ips(nat_gateway_id="example_value",
nat_ip_cidr="example_value",
name_regex="^my-NatIp")
pulumi.export("vpcNatIpId3", nat_ip_cidr.ips[0].id)
nat_ip_name = alicloud.vpc.get_nat_ips(nat_gateway_id="example_value",
ids=["example_value"],
nat_ip_names=["example_value"])
pulumi.export("vpcNatIpId4", nat_ip_name.ips[0].id)
nat_ip_ids = alicloud.vpc.get_nat_ips(nat_gateway_id="example_value",
ids=["example_value"],
nat_ip_ids=["example_value"])
pulumi.export("vpcNatIpId5", nat_ip_ids.ips[0].id)
status = alicloud.vpc.get_nat_ips(nat_gateway_id="example_value",
ids=["example_value"],
status="example_value")
pulumi.export("vpcNatIpId6", status.ips[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getNatIps({
natGatewayId: "example_value",
ids: [
"example_value-1",
"example_value-2",
],
});
export const vpcNatIpId1 = ids.then(ids => ids.ips?.[0]?.id);
const nameRegex = alicloud.vpc.getNatIps({
natGatewayId: "example_value",
nameRegex: "^my-NatIp",
});
export const vpcNatIpId2 = nameRegex.then(nameRegex => nameRegex.ips?.[0]?.id);
const natIpCidr = alicloud.vpc.getNatIps({
natGatewayId: "example_value",
natIpCidr: "example_value",
nameRegex: "^my-NatIp",
});
export const vpcNatIpId3 = natIpCidr.then(natIpCidr => natIpCidr.ips?.[0]?.id);
const natIpName = alicloud.vpc.getNatIps({
natGatewayId: "example_value",
ids: ["example_value"],
natIpNames: ["example_value"],
});
export const vpcNatIpId4 = natIpName.then(natIpName => natIpName.ips?.[0]?.id);
const natIpIds = alicloud.vpc.getNatIps({
natGatewayId: "example_value",
ids: ["example_value"],
natIpIds: ["example_value"],
});
export const vpcNatIpId5 = natIpIds.then(natIpIds => natIpIds.ips?.[0]?.id);
const status = alicloud.vpc.getNatIps({
natGatewayId: "example_value",
ids: ["example_value"],
status: "example_value",
});
export const vpcNatIpId6 = status.then(status => status.ips?.[0]?.id);
variables:
ids:
fn::invoke:
Function: alicloud:vpc:getNatIps
Arguments:
natGatewayId: example_value
ids:
- example_value-1
- example_value-2
nameRegex:
fn::invoke:
Function: alicloud:vpc:getNatIps
Arguments:
natGatewayId: example_value
nameRegex: ^my-NatIp
natIpCidr:
fn::invoke:
Function: alicloud:vpc:getNatIps
Arguments:
natGatewayId: example_value
natIpCidr: example_value
nameRegex: ^my-NatIp
natIpName:
fn::invoke:
Function: alicloud:vpc:getNatIps
Arguments:
natGatewayId: example_value
ids:
- example_value
natIpNames:
- example_value
natIpIds:
fn::invoke:
Function: alicloud:vpc:getNatIps
Arguments:
natGatewayId: example_value
ids:
- example_value
natIpIds:
- example_value
status:
fn::invoke:
Function: alicloud:vpc:getNatIps
Arguments:
natGatewayId: example_value
ids:
- example_value
status: example_value
outputs:
vpcNatIpId1: ${ids.ips[0].id}
vpcNatIpId2: ${nameRegex.ips[0].id}
vpcNatIpId3: ${natIpCidr.ips[0].id}
vpcNatIpId4: ${natIpName.ips[0].id}
vpcNatIpId5: ${natIpIds.ips[0].id}
vpcNatIpId6: ${status.ips[0].id}
Using getNatIps
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNatIps(args: GetNatIpsArgs, opts?: InvokeOptions): Promise<GetNatIpsResult>
function getNatIpsOutput(args: GetNatIpsOutputArgs, opts?: InvokeOptions): Output<GetNatIpsResult>
def get_nat_ips(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
nat_gateway_id: Optional[str] = None,
nat_ip_cidr: Optional[str] = None,
nat_ip_ids: Optional[Sequence[str]] = None,
nat_ip_names: Optional[Sequence[str]] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNatIpsResult
def get_nat_ips_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
nat_gateway_id: Optional[pulumi.Input[str]] = None,
nat_ip_cidr: Optional[pulumi.Input[str]] = None,
nat_ip_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
nat_ip_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNatIpsResult]
func GetNatIps(ctx *Context, args *GetNatIpsArgs, opts ...InvokeOption) (*GetNatIpsResult, error)
func GetNatIpsOutput(ctx *Context, args *GetNatIpsOutputArgs, opts ...InvokeOption) GetNatIpsResultOutput
> Note: This function is named GetNatIps
in the Go SDK.
public static class GetNatIps
{
public static Task<GetNatIpsResult> InvokeAsync(GetNatIpsArgs args, InvokeOptions? opts = null)
public static Output<GetNatIpsResult> Invoke(GetNatIpsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNatIpsResult> getNatIps(GetNatIpsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:vpc/getNatIps:getNatIps
arguments:
# arguments dictionary
The following arguments are supported:
- Nat
Gateway stringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- Ids List<string>
A list of Nat Ip IDs.
- Name
Regex string A regex string to filter results by Nat Ip name.
- Nat
Ip stringCidr The CIDR block to which the NAT IP address belongs.
- Nat
Ip List<string>Ids - Nat
Ip List<string>Names The name of the NAT IP address.
- Output
File string File name where to save data source results (after running
pulumi preview
).- Status string
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- Nat
Gateway stringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- Ids []string
A list of Nat Ip IDs.
- Name
Regex string A regex string to filter results by Nat Ip name.
- Nat
Ip stringCidr The CIDR block to which the NAT IP address belongs.
- Nat
Ip []stringIds - Nat
Ip []stringNames The name of the NAT IP address.
- Output
File string File name where to save data source results (after running
pulumi preview
).- Status string
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- nat
Gateway StringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- ids List<String>
A list of Nat Ip IDs.
- name
Regex String A regex string to filter results by Nat Ip name.
- nat
Ip StringCidr The CIDR block to which the NAT IP address belongs.
- nat
Ip List<String>Ids - nat
Ip List<String>Names The name of the NAT IP address.
- output
File String File name where to save data source results (after running
pulumi preview
).- status String
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- nat
Gateway stringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- ids string[]
A list of Nat Ip IDs.
- name
Regex string A regex string to filter results by Nat Ip name.
- nat
Ip stringCidr The CIDR block to which the NAT IP address belongs.
- nat
Ip string[]Ids - nat
Ip string[]Names The name of the NAT IP address.
- output
File string File name where to save data source results (after running
pulumi preview
).- status string
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- nat_
gateway_ strid The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- ids Sequence[str]
A list of Nat Ip IDs.
- name_
regex str A regex string to filter results by Nat Ip name.
- nat_
ip_ strcidr The CIDR block to which the NAT IP address belongs.
- nat_
ip_ Sequence[str]ids - nat_
ip_ Sequence[str]names The name of the NAT IP address.
- output_
file str File name where to save data source results (after running
pulumi preview
).- status str
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- nat
Gateway StringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- ids List<String>
A list of Nat Ip IDs.
- name
Regex String A regex string to filter results by Nat Ip name.
- nat
Ip StringCidr The CIDR block to which the NAT IP address belongs.
- nat
Ip List<String>Ids - nat
Ip List<String>Names The name of the NAT IP address.
- output
File String File name where to save data source results (after running
pulumi preview
).- status String
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
getNatIps Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Ips
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Nat Ips Ip> - Names List<string>
- Nat
Gateway stringId - Name
Regex string - Nat
Ip stringCidr - Nat
Ip List<string>Ids - Nat
Ip List<string>Names - Output
File string - Status string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Ips
[]Get
Nat Ips Ip - Names []string
- Nat
Gateway stringId - Name
Regex string - Nat
Ip stringCidr - Nat
Ip []stringIds - Nat
Ip []stringNames - Output
File string - Status string
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
- ips
List<Get
Nat Ips Ip> - names List<String>
- nat
Gateway StringId - name
Regex String - nat
Ip StringCidr - nat
Ip List<String>Ids - nat
Ip List<String>Names - output
File String - status String
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- ips
Get
Nat Ips Ip[] - names string[]
- nat
Gateway stringId - name
Regex string - nat
Ip stringCidr - nat
Ip string[]Ids - nat
Ip string[]Names - output
File string - status string
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- ips
Sequence[Get
Nat Ips Ip] - names Sequence[str]
- nat_
gateway_ strid - name_
regex str - nat_
ip_ strcidr - nat_
ip_ Sequence[str]ids - nat_
ip_ Sequence[str]names - output_
file str - status str
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
- ips List<Property Map>
- names List<String>
- nat
Gateway StringId - name
Regex String - nat
Ip StringCidr - nat
Ip List<String>Ids - nat
Ip List<String>Names - output
File String - status String
Supporting Types
GetNatIpsIp
- Id string
The ID of the Nat Ip.
- Is
Default bool Indicates whether the BGP Group is the default NAT IP ADDRESS. Valid values:
true
: is the default NAT IP ADDRESS.false
: it is not the default NAT IP ADDRESS.- Nat
Gateway stringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- Nat
Ip string The NAT IP address that is queried.
- Nat
Ip stringCidr The CIDR block to which the NAT IP address belongs.
- Nat
Ip stringDescription The description of the NAT IP address.
- Nat
Ip stringId The ID of the NAT IP address.
- Nat
Ip stringName The name of the NAT IP address.
- Status string
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- Id string
The ID of the Nat Ip.
- Is
Default bool Indicates whether the BGP Group is the default NAT IP ADDRESS. Valid values:
true
: is the default NAT IP ADDRESS.false
: it is not the default NAT IP ADDRESS.- Nat
Gateway stringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- Nat
Ip string The NAT IP address that is queried.
- Nat
Ip stringCidr The CIDR block to which the NAT IP address belongs.
- Nat
Ip stringDescription The description of the NAT IP address.
- Nat
Ip stringId The ID of the NAT IP address.
- Nat
Ip stringName The name of the NAT IP address.
- Status string
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- id String
The ID of the Nat Ip.
- is
Default Boolean Indicates whether the BGP Group is the default NAT IP ADDRESS. Valid values:
true
: is the default NAT IP ADDRESS.false
: it is not the default NAT IP ADDRESS.- nat
Gateway StringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- nat
Ip String The NAT IP address that is queried.
- nat
Ip StringCidr The CIDR block to which the NAT IP address belongs.
- nat
Ip StringDescription The description of the NAT IP address.
- nat
Ip StringId The ID of the NAT IP address.
- nat
Ip StringName The name of the NAT IP address.
- status String
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- id string
The ID of the Nat Ip.
- is
Default boolean Indicates whether the BGP Group is the default NAT IP ADDRESS. Valid values:
true
: is the default NAT IP ADDRESS.false
: it is not the default NAT IP ADDRESS.- nat
Gateway stringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- nat
Ip string The NAT IP address that is queried.
- nat
Ip stringCidr The CIDR block to which the NAT IP address belongs.
- nat
Ip stringDescription The description of the NAT IP address.
- nat
Ip stringId The ID of the NAT IP address.
- nat
Ip stringName The name of the NAT IP address.
- status string
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- id str
The ID of the Nat Ip.
- is_
default bool Indicates whether the BGP Group is the default NAT IP ADDRESS. Valid values:
true
: is the default NAT IP ADDRESS.false
: it is not the default NAT IP ADDRESS.- nat_
gateway_ strid The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- nat_
ip str The NAT IP address that is queried.
- nat_
ip_ strcidr The CIDR block to which the NAT IP address belongs.
- nat_
ip_ strdescription The description of the NAT IP address.
- nat_
ip_ strid The ID of the NAT IP address.
- nat_
ip_ strname The name of the NAT IP address.
- status str
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
- id String
The ID of the Nat Ip.
- is
Default Boolean Indicates whether the BGP Group is the default NAT IP ADDRESS. Valid values:
true
: is the default NAT IP ADDRESS.false
: it is not the default NAT IP ADDRESS.- nat
Gateway StringId The ID of the Virtual Private Cloud (VPC) NAT gateway to which the NAT IP address belongs.
- nat
Ip String The NAT IP address that is queried.
- nat
Ip StringCidr The CIDR block to which the NAT IP address belongs.
- nat
Ip StringDescription The description of the NAT IP address.
- nat
Ip StringId The ID of the NAT IP address.
- nat
Ip StringName The name of the NAT IP address.
- status String
The status of the NAT IP address. Valid values:
Available
,Deleting
andCreating
.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.