Class GetNatGateways
Inheritance
System.Object
GetNatGateways
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Vpc
Assembly: Pulumi.AliCloud.dll
Syntax
public static class GetNatGateways
Methods
View SourceInvokeAsync(GetNatGatewaysArgs, InvokeOptions)
This data source provides a list of Nat Gateways owned by an Alibaba Cloud account.
NOTE: Available in 1.37.0+.
{{% examples %}}
Example Usage
{{% example %}}
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "natGatewaysDatasource";
var @default = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableResourceCreation = "VSwitch",
}));
var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "172.16.0.0/12",
});
var fooNatGateway = new AliCloud.Vpc.NatGateway("fooNatGateway", new AliCloud.Vpc.NatGatewayArgs
{
Specification = "Small",
VpcId = fooNetwork.Id,
});
var fooNatGateways = Output.Tuple(fooNatGateway.Id, fooNatGateway.Name, fooNetwork.Id).Apply(values =>
{
var fooNatGatewayId = values.Item1;
var name = values.Item2;
var fooNetworkId = values.Item3;
return AliCloud.Vpc.GetNatGateways.InvokeAsync(new AliCloud.Vpc.GetNatGatewaysArgs
{
Ids =
{
fooNatGatewayId,
},
NameRegex = name,
VpcId = fooNetworkId,
});
});
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetNatGatewaysResult> InvokeAsync(GetNatGatewaysArgs args = null, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetNatGatewaysArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetNatGatewaysResult> |