Alibaba Cloud
getNatIps
This data source provides the Vpc Nat Ips of the current Alibaba Cloud user.
NOTE: Available in v1.136.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var ids = Output.Create(AliCloud.Vpc.GetNatIps.InvokeAsync(new AliCloud.Vpc.GetNatIpsArgs
{
NatGatewayId = "example_value",
Ids =
{
"example_value-1",
"example_value-2",
},
}));
this.VpcNatIpId1 = ids.Apply(ids => ids.Ips?[0]?.Id);
var nameRegex = Output.Create(AliCloud.Vpc.GetNatIps.InvokeAsync(new AliCloud.Vpc.GetNatIpsArgs
{
NatGatewayId = "example_value",
NameRegex = "^my-NatIp",
}));
this.VpcNatIpId2 = nameRegex.Apply(nameRegex => nameRegex.Ips?[0]?.Id);
var natIpCidr = Output.Create(AliCloud.Vpc.GetNatIps.InvokeAsync(new AliCloud.Vpc.GetNatIpsArgs
{
NatGatewayId = "example_value",
NatIpCidr = "example_value",
NameRegex = "^my-NatIp",
}));
this.VpcNatIpId3 = natIpCidr.Apply(natIpCidr => natIpCidr.Ips?[0]?.Id);
var natIpName = Output.Create(AliCloud.Vpc.GetNatIps.InvokeAsync(new AliCloud.Vpc.GetNatIpsArgs
{
NatGatewayId = "example_value",
Ids =
{
"example_value",
},
NatIpNames =
{
"example_value",
},
}));
this.VpcNatIpId4 = natIpName.Apply(natIpName => natIpName.Ips?[0]?.Id);
var natIpIds = Output.Create(AliCloud.Vpc.GetNatIps.InvokeAsync(new AliCloud.Vpc.GetNatIpsArgs
{
NatGatewayId = "example_value",
Ids =
{
"example_value",
},
NatIpIds =
{
"example_value",
},
}));
this.VpcNatIpId5 = natIpIds.Apply(natIpIds => natIpIds.Ips?[0]?.Id);
var status = Output.Create(AliCloud.Vpc.GetNatIps.InvokeAsync(new AliCloud.Vpc.GetNatIpsArgs
{
NatGatewayId = "example_value",
Ids =
{
"example_value",
},
Status = "example_value",
}));
this.VpcNatIpId6 = status.Apply(status => status.Ips?[0]?.Id);
}
[Output("vpcNatIpId1")]
public Output<string> VpcNatIpId1 { get; set; }
[Output("vpcNatIpId2")]
public Output<string> VpcNatIpId2 { get; set; }
[Output("vpcNatIpId3")]
public Output<string> VpcNatIpId3 { get; set; }
[Output("vpcNatIpId4")]
public Output<string> VpcNatIpId4 { get; set; }
[Output("vpcNatIpId5")]
public Output<string> VpcNatIpId5 { get; set; }
[Output("vpcNatIpId6")]
public Output<string> VpcNatIpId6 { get; set; }
}
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
})
}
Coming soon!
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);
Coming soon!
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 - 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 - 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 - 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 - 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 - 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 - 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
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.