getNatGateways

This resource can be useful for getting back a list of NAT gateway ids to be referenced elsewhere.

Example Usage

The following returns all NAT gateways in a specified VPC that are marked as available

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ngws = aws.ec2.getNatGateways({
vpcId: vpcId,
filters: [{
name: "state",
values: ["available"],
}],
});
const ngw = .map(__index => (aws.ec2.getNatGateway({
id: _arg0_.ids[__index],
})));
import pulumi
import pulumi_aws as aws
ngws = aws.ec2.get_nat_gateways(vpc_id=vpc_id,
filters=[{
"name": "state",
"values": ["available"],
}])
ngw = [aws.ec2.get_nat_gateway(id=ngws.ids[__index]) for __index in range(len(ngws.ids))]
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var ngws = Aws.Ec2.GetNatGateways.Invoke(new()
{
VpcId = vpcId,
Filters = new[]
{
new Aws.Ec2.Inputs.GetNatGatewaysFilterInputArgs
{
Name = "state",
Values = new[]
{
"available",
},
},
},
});
var ngw = ;
});

Return

A collection of values returned by getNatGateways.

Parameters

argument

A collection of arguments for invoking getNatGateways.


suspend fun getNatGateways(filters: List<GetNatGatewaysFilter>? = null, tags: Map<String, String>? = null, vpcId: String? = null): GetNatGatewaysResult

Return

A collection of values returned by getNatGateways.

Parameters

filters

Custom filter block as described below.

tags

Map of tags, each pair of which must exactly match a pair on the desired NAT Gateways. More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

vpcId

VPC ID that you want to filter from.

See also


Return

A collection of values returned by getNatGateways.

Parameters

argument

Builder for com.pulumi.aws.ec2.kotlin.inputs.GetNatGatewaysPlainArgs.

See also