Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine
volcengine.nat.Gateways
Explore with Pulumi AI
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.Zones({});
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.GatewaysOutput({
    ids: fooGateway.map(__item => __item.id),
});
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.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.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.Zones(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.GatewaysOutput(ctx, nat.GatewaysOutputArgs{
Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:nat-gateways:Gateways.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.Zones.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(zonesResult => zonesResult.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.Gateways.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.ZonesArgs;
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.GatewaysArgs;
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.Zones();
        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(zonesResult -> zonesResult.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.Gateways(GatewaysArgs.builder()
            .ids(fooGateway.stream().map(element -> element.id()).collect(toList()))
            .build());
    }
}
Coming soon!
Using Gateways
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 gateways(args: GatewaysArgs, opts?: InvokeOptions): Promise<GatewaysResult>
function gatewaysOutput(args: GatewaysOutputArgs, opts?: InvokeOptions): Output<GatewaysResult>def 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[GatewaysTag]] = None,
             vpc_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GatewaysResult
def 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[GatewaysTagArgs]]]] = None,
             vpc_id: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GatewaysResult]func Gateways(ctx *Context, args *GatewaysArgs, opts ...InvokeOption) (*GatewaysResult, error)
func GatewaysOutput(ctx *Context, args *GatewaysOutputArgs, opts ...InvokeOption) GatewaysResultOutputpublic static class Gateways 
{
    public static Task<GatewaysResult> InvokeAsync(GatewaysArgs args, InvokeOptions? opts = null)
    public static Output<GatewaysResult> Invoke(GatewaysInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GatewaysResult> gateways(GatewaysArgs args, InvokeOptions options)
public static Output<GatewaysResult> gateways(GatewaysArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:nat:Gateways
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Description string
- The description of the NatGateway.
- Ids List<string>
- The list of NatGateway IDs.
- NameRegex string
- The Name Regex of NatGateway.
- NatGateway stringName 
- The name of the NatGateway.
- OutputFile string
- File name where to save data source results.
- Spec string
- The specification of the NatGateway.
- SubnetId string
- The id of the Subnet.
- 
List<GatewaysTag> 
- Tags.
- VpcId string
- The id of the VPC.
- Description string
- The description of the NatGateway.
- Ids []string
- The list of NatGateway IDs.
- NameRegex string
- The Name Regex of NatGateway.
- NatGateway stringName 
- The name of the NatGateway.
- OutputFile string
- File name where to save data source results.
- Spec string
- The specification of the NatGateway.
- SubnetId string
- The id of the Subnet.
- 
[]GatewaysTag 
- Tags.
- VpcId string
- The id of the VPC.
- description String
- The description of the NatGateway.
- ids List<String>
- The list of NatGateway IDs.
- nameRegex String
- The Name Regex of NatGateway.
- natGateway StringName 
- The name of the NatGateway.
- outputFile String
- File name where to save data source results.
- spec String
- The specification of the NatGateway.
- subnetId String
- The id of the Subnet.
- 
List<GatewaysTag> 
- Tags.
- vpcId String
- The id of the VPC.
- description string
- The description of the NatGateway.
- ids string[]
- The list of NatGateway IDs.
- nameRegex string
- The Name Regex of NatGateway.
- natGateway stringName 
- The name of the NatGateway.
- outputFile string
- File name where to save data source results.
- spec string
- The specification of the NatGateway.
- subnetId string
- The id of the Subnet.
- 
GatewaysTag[] 
- Tags.
- vpcId 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[GatewaysTag] 
- Tags.
- vpc_id str
- The id of the VPC.
- description String
- The description of the NatGateway.
- ids List<String>
- The list of NatGateway IDs.
- nameRegex String
- The Name Regex of NatGateway.
- natGateway StringName 
- The name of the NatGateway.
- outputFile String
- File name where to save data source results.
- spec String
- The specification of the NatGateway.
- subnetId String
- The id of the Subnet.
- List<Property Map>
- Tags.
- vpcId String
- The id of the VPC.
Gateways Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- NatGateways List<GatewaysNat Gateway> 
- The collection of NatGateway query.
- TotalCount int
- The total count of NatGateway query.
- Description string
- The description of the NatGateway.
- Ids List<string>
- NameRegex string
- NatGateway stringName 
- The name of the NatGateway.
- OutputFile string
- Spec string
- The specification of the NatGateway.
- SubnetId string
- The ID of the Subnet.
- 
List<GatewaysTag> 
- Tags.
- VpcId string
- The ID of the VPC.
- Id string
- The provider-assigned unique ID for this managed resource.
- NatGateways []GatewaysNat Gateway 
- The collection of NatGateway query.
- TotalCount int
- The total count of NatGateway query.
- Description string
- The description of the NatGateway.
- Ids []string
- NameRegex string
- NatGateway stringName 
- The name of the NatGateway.
- OutputFile string
- Spec string
- The specification of the NatGateway.
- SubnetId string
- The ID of the Subnet.
- 
[]GatewaysTag 
- Tags.
- VpcId string
- The ID of the VPC.
- id String
- The provider-assigned unique ID for this managed resource.
- natGateways List<GatewaysNat Gateway> 
- The collection of NatGateway query.
- totalCount Integer
- The total count of NatGateway query.
- description String
- The description of the NatGateway.
- ids List<String>
- nameRegex String
- natGateway StringName 
- The name of the NatGateway.
- outputFile String
- spec String
- The specification of the NatGateway.
- subnetId String
- The ID of the Subnet.
- 
List<GatewaysTag> 
- Tags.
- vpcId String
- The ID of the VPC.
- id string
- The provider-assigned unique ID for this managed resource.
- natGateways GatewaysNat Gateway[] 
- The collection of NatGateway query.
- totalCount number
- The total count of NatGateway query.
- description string
- The description of the NatGateway.
- ids string[]
- nameRegex string
- natGateway stringName 
- The name of the NatGateway.
- outputFile string
- spec string
- The specification of the NatGateway.
- subnetId string
- The ID of the Subnet.
- 
GatewaysTag[] 
- Tags.
- vpcId string
- The ID of the VPC.
- id str
- The provider-assigned unique ID for this managed resource.
- nat_gateways Sequence[GatewaysNat 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[GatewaysTag] 
- Tags.
- vpc_id str
- The ID of the VPC.
- id String
- The provider-assigned unique ID for this managed resource.
- natGateways List<Property Map>
- The collection of NatGateway query.
- totalCount Number
- The total count of NatGateway query.
- description String
- The description of the NatGateway.
- ids List<String>
- nameRegex String
- natGateway StringName 
- The name of the NatGateway.
- outputFile String
- spec String
- The specification of the NatGateway.
- subnetId String
- The ID of the Subnet.
- List<Property Map>
- Tags.
- vpcId String
- The ID of the VPC.
Supporting Types
GatewaysNatGateway  
- BillingType string
- The billing type of the NatGateway.
- BusinessStatus string
- Whether the NatGateway is locked.
- CreationTime string
- The creation time of the NatGateway.
- DeletedTime string
- The deleted time of the NatGateway.
- Description string
- The description of the NatGateway.
- EipAddresses List<GatewaysNat Gateway Eip Address> 
- The eip addresses of the NatGateway.
- Id string
- The ID of the NatGateway.
- LockReason string
- The reason why locking NatGateway.
- NatGateway stringId 
- The ID of the NatGateway.
- NatGateway stringName 
- The name of the NatGateway.
- NetworkInterface stringId 
- The ID of the network interface.
- OverdueTime string
- The overdue time of the NatGateway.
- Spec string
- The specification of the NatGateway.
- Status string
- The status of the NatGateway.
- SubnetId string
- The id of the Subnet.
- 
List<GatewaysNat Gateway Tag> 
- Tags.
- UpdatedAt string
- The update time of the NatGateway.
- VpcId string
- The id of the VPC.
- BillingType string
- The billing type of the NatGateway.
- BusinessStatus string
- Whether the NatGateway is locked.
- CreationTime string
- The creation time of the NatGateway.
- DeletedTime string
- The deleted time of the NatGateway.
- Description string
- The description of the NatGateway.
- EipAddresses []GatewaysNat Gateway Eip Address 
- The eip addresses of the NatGateway.
- Id string
- The ID of the NatGateway.
- LockReason string
- The reason why locking NatGateway.
- NatGateway stringId 
- The ID of the NatGateway.
- NatGateway stringName 
- The name of the NatGateway.
- NetworkInterface stringId 
- The ID of the network interface.
- OverdueTime string
- The overdue time of the NatGateway.
- Spec string
- The specification of the NatGateway.
- Status string
- The status of the NatGateway.
- SubnetId string
- The id of the Subnet.
- 
[]GatewaysNat Gateway Tag 
- Tags.
- UpdatedAt string
- The update time of the NatGateway.
- VpcId string
- The id of the VPC.
- billingType String
- The billing type of the NatGateway.
- businessStatus String
- Whether the NatGateway is locked.
- creationTime String
- The creation time of the NatGateway.
- deletedTime String
- The deleted time of the NatGateway.
- description String
- The description of the NatGateway.
- eipAddresses List<GatewaysNat Gateway Eip Address> 
- The eip addresses of the NatGateway.
- id String
- The ID of the NatGateway.
- lockReason String
- The reason why locking NatGateway.
- natGateway StringId 
- The ID of the NatGateway.
- natGateway StringName 
- The name of the NatGateway.
- networkInterface StringId 
- The ID of the network interface.
- overdueTime String
- The overdue time of the NatGateway.
- spec String
- The specification of the NatGateway.
- status String
- The status of the NatGateway.
- subnetId String
- The id of the Subnet.
- 
List<GatewaysNat Gateway Tag> 
- Tags.
- updatedAt String
- The update time of the NatGateway.
- vpcId String
- The id of the VPC.
- billingType string
- The billing type of the NatGateway.
- businessStatus string
- Whether the NatGateway is locked.
- creationTime string
- The creation time of the NatGateway.
- deletedTime string
- The deleted time of the NatGateway.
- description string
- The description of the NatGateway.
- eipAddresses GatewaysNat Gateway Eip Address[] 
- The eip addresses of the NatGateway.
- id string
- The ID of the NatGateway.
- lockReason string
- The reason why locking NatGateway.
- natGateway stringId 
- The ID of the NatGateway.
- natGateway stringName 
- The name of the NatGateway.
- networkInterface stringId 
- The ID of the network interface.
- overdueTime string
- The overdue time of the NatGateway.
- spec string
- The specification of the NatGateway.
- status string
- The status of the NatGateway.
- subnetId string
- The id of the Subnet.
- 
GatewaysNat Gateway Tag[] 
- Tags.
- updatedAt string
- The update time of the NatGateway.
- vpcId 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[GatewaysNat 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[GatewaysNat Gateway Tag] 
- Tags.
- updated_at str
- The update time of the NatGateway.
- vpc_id str
- The id of the VPC.
- billingType String
- The billing type of the NatGateway.
- businessStatus String
- Whether the NatGateway is locked.
- creationTime String
- The creation time of the NatGateway.
- deletedTime String
- The deleted time of the NatGateway.
- description String
- The description of the NatGateway.
- eipAddresses List<Property Map>
- The eip addresses of the NatGateway.
- id String
- The ID of the NatGateway.
- lockReason String
- The reason why locking NatGateway.
- natGateway StringId 
- The ID of the NatGateway.
- natGateway StringName 
- The name of the NatGateway.
- networkInterface StringId 
- The ID of the network interface.
- overdueTime String
- The overdue time of the NatGateway.
- spec String
- The specification of the NatGateway.
- status String
- The status of the NatGateway.
- subnetId String
- The id of the Subnet.
- List<Property Map>
- Tags.
- updatedAt String
- The update time of the NatGateway.
- vpcId String
- The id of the VPC.
GatewaysNatGatewayEipAddress    
- AllocationId string
- The ID of Eip.
- EipAddress string
- The address of Eip.
- UsingStatus string
- The using status of Eip.
- AllocationId string
- The ID of Eip.
- EipAddress string
- The address of Eip.
- UsingStatus string
- The using status of Eip.
- allocationId String
- The ID of Eip.
- eipAddress String
- The address of Eip.
- usingStatus String
- The using status of Eip.
- allocationId string
- The ID of Eip.
- eipAddress string
- The address of Eip.
- usingStatus 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.
- allocationId String
- The ID of Eip.
- eipAddress String
- The address of Eip.
- usingStatus String
- The using status of Eip.
GatewaysNatGatewayTag   
GatewaysTag 
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the volcengineTerraform Provider.