Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine
volcengine.nat.Gateways
Explore with Pulumi AI
Use this data source to query detailed information of nat gateways
Example Usage
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 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
})
}
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());
}
}
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])
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),
});
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) GatewaysResultOutput
public 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: volcengine:nat:Gateways
arguments:
# arguments dictionary
The 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<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.
- []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<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.
- 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[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.
Gateways Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Nat
Gateways List<GatewaysNat 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<Gateways
Tag> - Tags.
- Vpc
Id string - The ID of the VPC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Nat
Gateways []GatewaysNat 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.
- []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<GatewaysNat 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<Gateways
Tag> - Tags.
- vpc
Id String - The ID of the VPC.
- id string
- The provider-assigned unique ID for this managed resource.
- nat
Gateways GatewaysNat 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.
- 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[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[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
GatewaysNatGateway
- 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<GatewaysNat 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<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 []GatewaysNat 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.
- []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<GatewaysNat 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<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 GatewaysNat 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.
- 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[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[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.
GatewaysNatGatewayEipAddress
- 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.
GatewaysNatGatewayTag
GatewaysTag
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.