GetNatGateways
This data source provides a list of Nat Gateways owned by an Alibaba Cloud account.
NOTE: Available in 1.37.0+.
Example Usage
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,
});
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "natGatewaysDatasource"
default = alicloud.get_zones(available_resource_creation="VSwitch")
foo_network = alicloud.vpc.Network("fooNetwork", cidr_block="172.16.0.0/12")
foo_nat_gateway = alicloud.vpc.NatGateway("fooNatGateway",
specification="Small",
vpc_id=foo_network.id)
foo_nat_gateways = pulumi.Output.all(foo_nat_gateway.id, foo_nat_gateway.name, foo_network.id).apply(lambda fooNatGatewayId, name, fooNetworkId: alicloud.vpc.get_nat_gateways(ids=[foo_nat_gateway_id],
name_regex=name,
vpc_id=foo_network_id))import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "natGatewaysDatasource";
const defaultZones = pulumi.output(alicloud.getZones({
availableResourceCreation: "VSwitch",
}, { async: true }));
const fooNetwork = new alicloud.vpc.Network("foo", {
cidrBlock: "172.16.0.0/12",
});
const fooNatGateway = new alicloud.vpc.NatGateway("foo", {
specification: "Small",
vpcId: fooNetwork.id,
});
const fooNatGateways = pulumi.all([fooNatGateway.id, fooNatGateway.name, fooNetwork.id]).apply(([fooNatGatewayId, name, fooNetworkId]) => alicloud.vpc.getNatGateways({
ids: [fooNatGatewayId],
nameRegex: name,
vpcId: fooNetworkId,
}, { async: true }));Using GetNatGateways
function getNatGateways(args: GetNatGatewaysArgs, opts?: InvokeOptions): Promise<GetNatGatewaysResult>function get_nat_gateways(ids=None, name_regex=None, output_file=None, vpc_id=None, opts=None)func GetNatGateways(ctx *Context, args *GetNatGatewaysArgs, opts ...InvokeOption) (*GetNatGatewaysResult, error)public static class GetNatGateways {
public static Task<GetNatGatewaysResult> InvokeAsync(GetNatGatewaysArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Ids List<string>
A list of NAT gateways IDs.
- Name
Regex string A regex string to filter nat gateways by name.
- Output
File string - Vpc
Id string The ID of the VPC.
- ids List[str]
A list of NAT gateways IDs.
- name_
regex str A regex string to filter nat gateways by name.
- output_
file str - vpc_
id str The ID of the VPC.
GetNatGateways Result
The following output properties are available:
- Gateways
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Nat Gateways Gateway> A list of Nat gateways. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
(Optional) A list of Nat gateways IDs.
- Names List<string>
A list of Nat gateways names.
- Name
Regex string - Output
File string - Vpc
Id string The ID of the VPC.
- Gateways
[]Get
Nat Gateways Gateway A list of Nat gateways. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
(Optional) A list of Nat gateways IDs.
- Names []string
A list of Nat gateways names.
- Name
Regex string - Output
File string - Vpc
Id string The ID of the VPC.
- gateways
Get
Nat Gateways Gateway[] A list of Nat gateways. Each element contains the following attributes:
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
(Optional) A list of Nat gateways IDs.
- names string[]
A list of Nat gateways names.
- name
Regex string - output
File string - vpc
Id string The ID of the VPC.
- gateways
List[Get
Nat Gateways Gateway] A list of Nat gateways. Each element contains the following attributes:
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
(Optional) A list of Nat gateways IDs.
- names List[str]
A list of Nat gateways names.
- name_
regex str - output_
file str - vpc_
id str The ID of the VPC.
Supporting Types
GetNatGatewaysGateway
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Creation
Time string Time of creation.
- Description string
The description of the NAT gateway.
- Forward
Table stringId The forward table id.
- Id string
The ID of the NAT gateway.
- Name string
Name of the NAT gateway.
- Snat
Table stringId The snat table id.
- Spec string
The specification of the NAT gateway.
- Status string
The status of the NAT gateway.
- Vpc
Id string The ID of the VPC.
- Creation
Time string Time of creation.
- Description string
The description of the NAT gateway.
- Forward
Table stringId The forward table id.
- Id string
The ID of the NAT gateway.
- Name string
Name of the NAT gateway.
- Snat
Table stringId The snat table id.
- Spec string
The specification of the NAT gateway.
- Status string
The status of the NAT gateway.
- Vpc
Id string The ID of the VPC.
- creation
Time string Time of creation.
- description string
The description of the NAT gateway.
- forward
Table stringId The forward table id.
- id string
The ID of the NAT gateway.
- name string
Name of the NAT gateway.
- snat
Table stringId The snat table id.
- spec string
The specification of the NAT gateway.
- status string
The status of the NAT gateway.
- vpc
Id string The ID of the VPC.
- creation_
time str Time of creation.
- description str
The description of the NAT gateway.
- forward_
table_ strid The forward table id.
- id str
The ID of the NAT gateway.
- name str
Name of the NAT gateway.
- snat_
table_ strid The snat table id.
- spec str
The specification of the NAT gateway.
- status str
The status of the NAT gateway.
- vpc_
id str The ID of the VPC.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.