Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
Use this data source to query detailed information of nat gateways
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooZones = volcengine.ecs.getZones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
vpcName: "acc-test-vpc",
cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
subnetName: "acc-test-subnet",
cidrBlock: "172.16.0.0/24",
zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
vpcId: fooVpc.id,
});
const fooGateway: volcengine.nat.Gateway[] = [];
for (const range = {value: 0}; range.value < 3; range.value++) {
fooGateway.push(new volcengine.nat.Gateway(`fooGateway-${range.value}`, {
vpcId: fooVpc.id,
subnetId: fooSubnet.id,
spec: "Small",
natGatewayName: `acc-test-ng-${range.value}`,
description: "acc-test",
billingType: "PostPaid",
projectName: "default",
tags: [{
key: "k1",
value: "v1",
}],
}));
}
const fooGateways = volcengine.nat.getGatewaysOutput({
ids: fooGateway.map(__item => __item.id),
});
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.get_zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
vpc_name="acc-test-vpc",
cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
subnet_name="acc-test-subnet",
cidr_block="172.16.0.0/24",
zone_id=foo_zones.zones[0].id,
vpc_id=foo_vpc.id)
foo_gateway = []
for range in [{"value": i} for i in range(0, 3)]:
foo_gateway.append(volcengine.nat.Gateway(f"fooGateway-{range['value']}",
vpc_id=foo_vpc.id,
subnet_id=foo_subnet.id,
spec="Small",
nat_gateway_name=f"acc-test-ng-{range['value']}",
description="acc-test",
billing_type="PostPaid",
project_name="default",
tags=[volcengine.nat.GatewayTagArgs(
key="k1",
value="v1",
)]))
foo_gateways = volcengine.nat.get_gateways_output(ids=[__item.id for __item in foo_gateway])
package main
import (
"fmt"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/nat"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooZones, err := ecs.GetZones(ctx, nil, nil);
if err != nil {
return err
}
fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
VpcName: pulumi.String("acc-test-vpc"),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
SubnetName: pulumi.String("acc-test-subnet"),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(fooZones.Zones[0].Id),
VpcId: fooVpc.ID(),
})
if err != nil {
return err
}
var fooGateway []*nat.Gateway
for index := 0; index < 3; index++ {
key0 := index
val0 := index
__res, err := nat.NewGateway(ctx, fmt.Sprintf("fooGateway-%v", key0), &nat.GatewayArgs{
VpcId: fooVpc.ID(),
SubnetId: fooSubnet.ID(),
Spec: pulumi.String("Small"),
NatGatewayName: pulumi.String(fmt.Sprintf("acc-test-ng-%v", val0)),
Description: pulumi.String("acc-test"),
BillingType: pulumi.String("PostPaid"),
ProjectName: pulumi.String("default"),
Tags: nat.GatewayTagArray{
&nat.GatewayTagArgs{
Key: pulumi.String("k1"),
Value: pulumi.String("v1"),
},
},
})
if err != nil {
return err
}
fooGateway = append(fooGateway, __res)
}
_ = nat.GetGatewaysOutput(ctx, nat.GetGatewaysOutputArgs{
Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:nat-getGateways:getGateways.pp:30,9-25),
}, nil);
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooZones = Volcengine.Ecs.GetZones.Invoke();
var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
{
VpcName = "acc-test-vpc",
CidrBlock = "172.16.0.0/16",
});
var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
{
SubnetName = "acc-test-subnet",
CidrBlock = "172.16.0.0/24",
ZoneId = fooZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
VpcId = fooVpc.Id,
});
var fooGateway = new List<Volcengine.Nat.Gateway>();
for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
{
var range = new { Value = rangeIndex };
fooGateway.Add(new Volcengine.Nat.Gateway($"fooGateway-{range.Value}", new()
{
VpcId = fooVpc.Id,
SubnetId = fooSubnet.Id,
Spec = "Small",
NatGatewayName = $"acc-test-ng-{range.Value}",
Description = "acc-test",
BillingType = "PostPaid",
ProjectName = "default",
Tags = new[]
{
new Volcengine.Nat.Inputs.GatewayTagArgs
{
Key = "k1",
Value = "v1",
},
},
}));
}
var fooGateways = Volcengine.Nat.GetGateways.Invoke(new()
{
Ids = fooGateway.Select(__item => __item.Id).ToList(),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.GetZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.nat.Gateway;
import com.pulumi.volcengine.nat.GatewayArgs;
import com.pulumi.volcengine.nat.inputs.GatewayTagArgs;
import com.pulumi.volcengine.nat.NatFunctions;
import com.pulumi.volcengine.nat.inputs.GetGatewaysArgs;
import com.pulumi.codegen.internal.KeyedValue;
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 fooZones = EcsFunctions.getZones();
var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
.vpcName("acc-test-vpc")
.cidrBlock("172.16.0.0/16")
.build());
var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
.subnetName("acc-test-subnet")
.cidrBlock("172.16.0.0/24")
.zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vpcId(fooVpc.id())
.build());
for (var i = 0; i < 3; i++) {
new Gateway("fooGateway-" + i, GatewayArgs.builder()
.vpcId(fooVpc.id())
.subnetId(fooSubnet.id())
.spec("Small")
.natGatewayName(String.format("acc-test-ng-%s", range.value()))
.description("acc-test")
.billingType("PostPaid")
.projectName("default")
.tags(GatewayTagArgs.builder()
.key("k1")
.value("v1")
.build())
.build());
}
final var fooGateways = NatFunctions.getGateways(GetGatewaysArgs.builder()
.ids(fooGateway.stream().map(element -> element.id()).collect(toList()))
.build());
}
}
Example coming soon!
Using getGateways
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 getGateways(args: GetGatewaysArgs, opts?: InvokeOptions): Promise<GetGatewaysResult>
function getGatewaysOutput(args: GetGatewaysOutputArgs, opts?: InvokeOptions): Output<GetGatewaysResult>def get_gateways(description: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
nat_gateway_name: Optional[str] = None,
output_file: Optional[str] = None,
spec: Optional[str] = None,
subnet_id: Optional[str] = None,
tags: Optional[Sequence[GetGatewaysTag]] = None,
vpc_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetGatewaysResult
def get_gateways_output(description: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
nat_gateway_name: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
spec: Optional[pulumi.Input[str]] = None,
subnet_id: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Sequence[pulumi.Input[GetGatewaysTagArgs]]]] = None,
vpc_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetGatewaysResult]func GetGateways(ctx *Context, args *GetGatewaysArgs, opts ...InvokeOption) (*GetGatewaysResult, error)
func GetGatewaysOutput(ctx *Context, args *GetGatewaysOutputArgs, opts ...InvokeOption) GetGatewaysResultOutput> Note: This function is named GetGateways in the Go SDK.
public static class GetGateways
{
public static Task<GetGatewaysResult> InvokeAsync(GetGatewaysArgs args, InvokeOptions? opts = null)
public static Output<GetGatewaysResult> Invoke(GetGatewaysInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
public static Output<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
fn::invoke:
function: volcengine:nat/getGateways:getGateways
arguments:
# arguments dictionaryThe following arguments are supported:
- Description string
- The description of the NatGateway.
- Ids List<string>
- The list of NatGateway IDs.
- Name
Regex string - The Name Regex of NatGateway.
- Nat
Gateway stringName - The name of the NatGateway.
- Output
File string - File name where to save data source results.
- Spec string
- The specification of the NatGateway.
- Subnet
Id string - The id of the Subnet.
-
List<Get
Gateways Tag> - Tags.
- Vpc
Id string - The id of the VPC.
- Description string
- The description of the NatGateway.
- Ids []string
- The list of NatGateway IDs.
- Name
Regex string - The Name Regex of NatGateway.
- Nat
Gateway stringName - The name of the NatGateway.
- Output
File string - File name where to save data source results.
- Spec string
- The specification of the NatGateway.
- Subnet
Id string - The id of the Subnet.
-
[]Get
Gateways Tag - Tags.
- Vpc
Id string - The id of the VPC.
- description String
- The description of the NatGateway.
- ids List<String>
- The list of NatGateway IDs.
- name
Regex String - The Name Regex of NatGateway.
- nat
Gateway StringName - The name of the NatGateway.
- output
File String - File name where to save data source results.
- spec String
- The specification of the NatGateway.
- subnet
Id String - The id of the Subnet.
-
List<Get
Gateways Tag> - Tags.
- vpc
Id String - The id of the VPC.
- description string
- The description of the NatGateway.
- ids string[]
- The list of NatGateway IDs.
- name
Regex string - The Name Regex of NatGateway.
- nat
Gateway stringName - The name of the NatGateway.
- output
File string - File name where to save data source results.
- spec string
- The specification of the NatGateway.
- subnet
Id string - The id of the Subnet.
-
Get
Gateways Tag[] - Tags.
- vpc
Id string - The id of the VPC.
- description str
- The description of the NatGateway.
- ids Sequence[str]
- The list of NatGateway IDs.
- name_
regex str - The Name Regex of NatGateway.
- nat_
gateway_ strname - The name of the NatGateway.
- output_
file str - File name where to save data source results.
- spec str
- The specification of the NatGateway.
- subnet_
id str - The id of the Subnet.
-
Sequence[Get
Gateways Tag] - Tags.
- vpc_
id str - The id of the VPC.
- description String
- The description of the NatGateway.
- ids List<String>
- The list of NatGateway IDs.
- name
Regex String - The Name Regex of NatGateway.
- nat
Gateway StringName - The name of the NatGateway.
- output
File String - File name where to save data source results.
- spec String
- The specification of the NatGateway.
- subnet
Id String - The id of the Subnet.
- List<Property Map>
- Tags.
- vpc
Id String - The id of the VPC.
getGateways Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Nat
Gateways List<GetGateways Nat Gateway> - The collection of NatGateway query.
- Total
Count int - The total count of NatGateway query.
- Description string
- The description of the NatGateway.
- Ids List<string>
- Name
Regex string - Nat
Gateway stringName - The name of the NatGateway.
- Output
File string - Spec string
- The specification of the NatGateway.
- Subnet
Id string - The ID of the Subnet.
-
List<Get
Gateways Tag> - Tags.
- Vpc
Id string - The ID of the VPC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Nat
Gateways []GetGateways Nat Gateway - The collection of NatGateway query.
- Total
Count int - The total count of NatGateway query.
- Description string
- The description of the NatGateway.
- Ids []string
- Name
Regex string - Nat
Gateway stringName - The name of the NatGateway.
- Output
File string - Spec string
- The specification of the NatGateway.
- Subnet
Id string - The ID of the Subnet.
-
[]Get
Gateways Tag - Tags.
- Vpc
Id string - The ID of the VPC.
- id String
- The provider-assigned unique ID for this managed resource.
- nat
Gateways List<GetGateways Nat Gateway> - The collection of NatGateway query.
- total
Count Integer - The total count of NatGateway query.
- description String
- The description of the NatGateway.
- ids List<String>
- name
Regex String - nat
Gateway StringName - The name of the NatGateway.
- output
File String - spec String
- The specification of the NatGateway.
- subnet
Id String - The ID of the Subnet.
-
List<Get
Gateways Tag> - Tags.
- vpc
Id String - The ID of the VPC.
- id string
- The provider-assigned unique ID for this managed resource.
- nat
Gateways GetGateways Nat Gateway[] - The collection of NatGateway query.
- total
Count number - The total count of NatGateway query.
- description string
- The description of the NatGateway.
- ids string[]
- name
Regex string - nat
Gateway stringName - The name of the NatGateway.
- output
File string - spec string
- The specification of the NatGateway.
- subnet
Id string - The ID of the Subnet.
-
Get
Gateways Tag[] - Tags.
- vpc
Id string - The ID of the VPC.
- id str
- The provider-assigned unique ID for this managed resource.
- nat_
gateways Sequence[GetGateways Nat Gateway] - The collection of NatGateway query.
- total_
count int - The total count of NatGateway query.
- description str
- The description of the NatGateway.
- ids Sequence[str]
- name_
regex str - nat_
gateway_ strname - The name of the NatGateway.
- output_
file str - spec str
- The specification of the NatGateway.
- subnet_
id str - The ID of the Subnet.
-
Sequence[Get
Gateways Tag] - Tags.
- vpc_
id str - The ID of the VPC.
- id String
- The provider-assigned unique ID for this managed resource.
- nat
Gateways List<Property Map> - The collection of NatGateway query.
- total
Count Number - The total count of NatGateway query.
- description String
- The description of the NatGateway.
- ids List<String>
- name
Regex String - nat
Gateway StringName - The name of the NatGateway.
- output
File String - spec String
- The specification of the NatGateway.
- subnet
Id String - The ID of the Subnet.
- List<Property Map>
- Tags.
- vpc
Id String - The ID of the VPC.
Supporting Types
GetGatewaysNatGateway
- Billing
Type string - The billing type of the NatGateway.
- Business
Status string - Whether the NatGateway is locked.
- Creation
Time string - The creation time of the NatGateway.
- Deleted
Time string - The deleted time of the NatGateway.
- Description string
- The description of the NatGateway.
- Eip
Addresses List<GetGateways Nat Gateway Eip Address> - The eip addresses of the NatGateway.
- Id string
- The ID of the NatGateway.
- Lock
Reason string - The reason why locking NatGateway.
- Nat
Gateway stringId - The ID of the NatGateway.
- Nat
Gateway stringName - The name of the NatGateway.
- Network
Interface stringId - The ID of the network interface.
- Overdue
Time string - The overdue time of the NatGateway.
- Spec string
- The specification of the NatGateway.
- Status string
- The status of the NatGateway.
- Subnet
Id string - The id of the Subnet.
-
List<Get
Gateways Nat Gateway Tag> - Tags.
- Updated
At string - The update time of the NatGateway.
- Vpc
Id string - The id of the VPC.
- Billing
Type string - The billing type of the NatGateway.
- Business
Status string - Whether the NatGateway is locked.
- Creation
Time string - The creation time of the NatGateway.
- Deleted
Time string - The deleted time of the NatGateway.
- Description string
- The description of the NatGateway.
- Eip
Addresses []GetGateways Nat Gateway Eip Address - The eip addresses of the NatGateway.
- Id string
- The ID of the NatGateway.
- Lock
Reason string - The reason why locking NatGateway.
- Nat
Gateway stringId - The ID of the NatGateway.
- Nat
Gateway stringName - The name of the NatGateway.
- Network
Interface stringId - The ID of the network interface.
- Overdue
Time string - The overdue time of the NatGateway.
- Spec string
- The specification of the NatGateway.
- Status string
- The status of the NatGateway.
- Subnet
Id string - The id of the Subnet.
-
[]Get
Gateways Nat Gateway Tag - Tags.
- Updated
At string - The update time of the NatGateway.
- Vpc
Id string - The id of the VPC.
- billing
Type String - The billing type of the NatGateway.
- business
Status String - Whether the NatGateway is locked.
- creation
Time String - The creation time of the NatGateway.
- deleted
Time String - The deleted time of the NatGateway.
- description String
- The description of the NatGateway.
- eip
Addresses List<GetGateways Nat Gateway Eip Address> - The eip addresses of the NatGateway.
- id String
- The ID of the NatGateway.
- lock
Reason String - The reason why locking NatGateway.
- nat
Gateway StringId - The ID of the NatGateway.
- nat
Gateway StringName - The name of the NatGateway.
- network
Interface StringId - The ID of the network interface.
- overdue
Time String - The overdue time of the NatGateway.
- spec String
- The specification of the NatGateway.
- status String
- The status of the NatGateway.
- subnet
Id String - The id of the Subnet.
-
List<Get
Gateways Nat Gateway Tag> - Tags.
- updated
At String - The update time of the NatGateway.
- vpc
Id String - The id of the VPC.
- billing
Type string - The billing type of the NatGateway.
- business
Status string - Whether the NatGateway is locked.
- creation
Time string - The creation time of the NatGateway.
- deleted
Time string - The deleted time of the NatGateway.
- description string
- The description of the NatGateway.
- eip
Addresses GetGateways Nat Gateway Eip Address[] - The eip addresses of the NatGateway.
- id string
- The ID of the NatGateway.
- lock
Reason string - The reason why locking NatGateway.
- nat
Gateway stringId - The ID of the NatGateway.
- nat
Gateway stringName - The name of the NatGateway.
- network
Interface stringId - The ID of the network interface.
- overdue
Time string - The overdue time of the NatGateway.
- spec string
- The specification of the NatGateway.
- status string
- The status of the NatGateway.
- subnet
Id string - The id of the Subnet.
-
Get
Gateways Nat Gateway Tag[] - Tags.
- updated
At string - The update time of the NatGateway.
- vpc
Id string - The id of the VPC.
- billing_
type str - The billing type of the NatGateway.
- business_
status str - Whether the NatGateway is locked.
- creation_
time str - The creation time of the NatGateway.
- deleted_
time str - The deleted time of the NatGateway.
- description str
- The description of the NatGateway.
- eip_
addresses Sequence[GetGateways Nat Gateway Eip Address] - The eip addresses of the NatGateway.
- id str
- The ID of the NatGateway.
- lock_
reason str - The reason why locking NatGateway.
- nat_
gateway_ strid - The ID of the NatGateway.
- nat_
gateway_ strname - The name of the NatGateway.
- network_
interface_ strid - The ID of the network interface.
- overdue_
time str - The overdue time of the NatGateway.
- spec str
- The specification of the NatGateway.
- status str
- The status of the NatGateway.
- subnet_
id str - The id of the Subnet.
-
Sequence[Get
Gateways Nat Gateway Tag] - Tags.
- updated_
at str - The update time of the NatGateway.
- vpc_
id str - The id of the VPC.
- billing
Type String - The billing type of the NatGateway.
- business
Status String - Whether the NatGateway is locked.
- creation
Time String - The creation time of the NatGateway.
- deleted
Time String - The deleted time of the NatGateway.
- description String
- The description of the NatGateway.
- eip
Addresses List<Property Map> - The eip addresses of the NatGateway.
- id String
- The ID of the NatGateway.
- lock
Reason String - The reason why locking NatGateway.
- nat
Gateway StringId - The ID of the NatGateway.
- nat
Gateway StringName - The name of the NatGateway.
- network
Interface StringId - The ID of the network interface.
- overdue
Time String - The overdue time of the NatGateway.
- spec String
- The specification of the NatGateway.
- status String
- The status of the NatGateway.
- subnet
Id String - The id of the Subnet.
- List<Property Map>
- Tags.
- updated
At String - The update time of the NatGateway.
- vpc
Id String - The id of the VPC.
GetGatewaysNatGatewayEipAddress
- Allocation
Id string - The ID of Eip.
- Eip
Address string - The address of Eip.
- Using
Status string - The using status of Eip.
- Allocation
Id string - The ID of Eip.
- Eip
Address string - The address of Eip.
- Using
Status string - The using status of Eip.
- allocation
Id String - The ID of Eip.
- eip
Address String - The address of Eip.
- using
Status String - The using status of Eip.
- allocation
Id string - The ID of Eip.
- eip
Address string - The address of Eip.
- using
Status string - The using status of Eip.
- allocation_
id str - The ID of Eip.
- eip_
address str - The address of Eip.
- using_
status str - The using status of Eip.
- allocation
Id String - The ID of Eip.
- eip
Address String - The address of Eip.
- using
Status String - The using status of Eip.
GetGatewaysNatGatewayTag
GetGatewaysTag
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengineTerraform Provider.
Volcengine v0.0.38 published on Friday, Oct 31, 2025 by Volcengine
