1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getVpnGateways
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getVpnGateways

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    This data source providers a list of VPN Gateway resources according to their ID, name, vpc and tag.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getVpnGateways({});
    export const first = example.then(example => example.vpnGateways?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_vpn_gateways()
    pulumi.export("first", example.vpn_gateways[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetVpnGateways(ctx, &ucloud.GetVpnGatewaysArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.VpnGateways[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetVpnGateways.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getVpnGatewaysResult => getVpnGatewaysResult.VpnGateways[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetVpnGatewaysArgs;
    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 example = UcloudFunctions.getVpnGateways();
    
            ctx.export("first", example.applyValue(getVpnGatewaysResult -> getVpnGatewaysResult.vpnGateways()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getVpnGateways
          arguments: {}
    outputs:
      first: ${example.vpnGateways[0].id}
    

    Using getVpnGateways

    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 getVpnGateways(args: GetVpnGatewaysArgs, opts?: InvokeOptions): Promise<GetVpnGatewaysResult>
    function getVpnGatewaysOutput(args: GetVpnGatewaysOutputArgs, opts?: InvokeOptions): Output<GetVpnGatewaysResult>
    def get_vpn_gateways(id: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         tag: Optional[str] = None,
                         vpc_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetVpnGatewaysResult
    def get_vpn_gateways_output(id: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         tag: Optional[pulumi.Input[str]] = None,
                         vpc_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetVpnGatewaysResult]
    func GetVpnGateways(ctx *Context, args *GetVpnGatewaysArgs, opts ...InvokeOption) (*GetVpnGatewaysResult, error)
    func GetVpnGatewaysOutput(ctx *Context, args *GetVpnGatewaysOutputArgs, opts ...InvokeOption) GetVpnGatewaysResultOutput

    > Note: This function is named GetVpnGateways in the Go SDK.

    public static class GetVpnGateways 
    {
        public static Task<GetVpnGatewaysResult> InvokeAsync(GetVpnGatewaysArgs args, InvokeOptions? opts = null)
        public static Output<GetVpnGatewaysResult> Invoke(GetVpnGatewaysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpnGatewaysResult> getVpnGateways(GetVpnGatewaysArgs args, InvokeOptions options)
    public static Output<GetVpnGatewaysResult> getVpnGateways(GetVpnGatewaysArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getVpnGateways:getVpnGateways
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of VPN Gateway.
    Ids List<string>
    A list of VPN Gateway IDs, all the VPN Gateways belongs to the defined region will be retrieved if this argument is [].
    NameRegex string
    A regex string to filter resulting VPN Gateways by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Tag string
    A tag assigned to VPN Gateway.
    VpcId string
    The ID of VPC linked to the VPN Gateway.
    Id string
    The ID of VPN Gateway.
    Ids []string
    A list of VPN Gateway IDs, all the VPN Gateways belongs to the defined region will be retrieved if this argument is [].
    NameRegex string
    A regex string to filter resulting VPN Gateways by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Tag string
    A tag assigned to VPN Gateway.
    VpcId string
    The ID of VPC linked to the VPN Gateway.
    id String
    The ID of VPN Gateway.
    ids List<String>
    A list of VPN Gateway IDs, all the VPN Gateways belongs to the defined region will be retrieved if this argument is [].
    nameRegex String
    A regex string to filter resulting VPN Gateways by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    tag String
    A tag assigned to VPN Gateway.
    vpcId String
    The ID of VPC linked to the VPN Gateway.
    id string
    The ID of VPN Gateway.
    ids string[]
    A list of VPN Gateway IDs, all the VPN Gateways belongs to the defined region will be retrieved if this argument is [].
    nameRegex string
    A regex string to filter resulting VPN Gateways by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    tag string
    A tag assigned to VPN Gateway.
    vpcId string
    The ID of VPC linked to the VPN Gateway.
    id str
    The ID of VPN Gateway.
    ids Sequence[str]
    A list of VPN Gateway IDs, all the VPN Gateways belongs to the defined region will be retrieved if this argument is [].
    name_regex str
    A regex string to filter resulting VPN Gateways by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    tag str
    A tag assigned to VPN Gateway.
    vpc_id str
    The ID of VPC linked to the VPN Gateway.
    id String
    The ID of VPN Gateway.
    ids List<String>
    A list of VPN Gateway IDs, all the VPN Gateways belongs to the defined region will be retrieved if this argument is [].
    nameRegex String
    A regex string to filter resulting VPN Gateways by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    tag String
    A tag assigned to VPN Gateway.
    vpcId String
    The ID of VPC linked to the VPN Gateway.

    getVpnGateways Result

    The following output properties are available:

    Id string
    The ID of VPN Gateway.
    Ids List<string>
    TotalCount double
    Total number of VPN Gateways that satisfy the condition.
    VpnGateways List<GetVpnGatewaysVpnGateway>
    It is a nested type. VPN Gateways documented below.
    NameRegex string
    OutputFile string
    Tag string
    A tag assigned to the VPN Gateway.
    VpcId string
    The ID of VPC linked to the VPN Gateway.
    Id string
    The ID of VPN Gateway.
    Ids []string
    TotalCount float64
    Total number of VPN Gateways that satisfy the condition.
    VpnGateways []GetVpnGatewaysVpnGateway
    It is a nested type. VPN Gateways documented below.
    NameRegex string
    OutputFile string
    Tag string
    A tag assigned to the VPN Gateway.
    VpcId string
    The ID of VPC linked to the VPN Gateway.
    id String
    The ID of VPN Gateway.
    ids List<String>
    totalCount Double
    Total number of VPN Gateways that satisfy the condition.
    vpnGateways List<GetVpnGatewaysVpnGateway>
    It is a nested type. VPN Gateways documented below.
    nameRegex String
    outputFile String
    tag String
    A tag assigned to the VPN Gateway.
    vpcId String
    The ID of VPC linked to the VPN Gateway.
    id string
    The ID of VPN Gateway.
    ids string[]
    totalCount number
    Total number of VPN Gateways that satisfy the condition.
    vpnGateways GetVpnGatewaysVpnGateway[]
    It is a nested type. VPN Gateways documented below.
    nameRegex string
    outputFile string
    tag string
    A tag assigned to the VPN Gateway.
    vpcId string
    The ID of VPC linked to the VPN Gateway.
    id str
    The ID of VPN Gateway.
    ids Sequence[str]
    total_count float
    Total number of VPN Gateways that satisfy the condition.
    vpn_gateways Sequence[GetVpnGatewaysVpnGateway]
    It is a nested type. VPN Gateways documented below.
    name_regex str
    output_file str
    tag str
    A tag assigned to the VPN Gateway.
    vpc_id str
    The ID of VPC linked to the VPN Gateway.
    id String
    The ID of VPN Gateway.
    ids List<String>
    totalCount Number
    Total number of VPN Gateways that satisfy the condition.
    vpnGateways List<Property Map>
    It is a nested type. VPN Gateways documented below.
    nameRegex String
    outputFile String
    tag String
    A tag assigned to the VPN Gateway.
    vpcId String
    The ID of VPC linked to the VPN Gateway.

    Supporting Types

    GetVpnGatewaysVpnGateway

    AutoRenew bool
    Whether to renew an VPN Gateway automatically or not.
    ChargeType string
    The charge type of VPN Gateway.
    CreateTime string
    The time of creation for VPN Gateway, formatted in RFC3339 time string.
    ExpireTime string
    The expiration time for VPN Gateway, formatted in RFC3339 time string.
    Grade string
    The type of the VPN Gateway.
    Id string
    The ID of VPN Gateway.
    IpSets List<GetVpnGatewaysVpnGatewayIpSet>
    It is a nested type which documented below.
    Name string
    The name of the VPN Gateway.
    Remark string
    The remarks of VPN Gateway.
    Tag string
    A tag assigned to VPN Gateway.
    VpcId string
    The ID of VPC linked to the VPN Gateway.
    AutoRenew bool
    Whether to renew an VPN Gateway automatically or not.
    ChargeType string
    The charge type of VPN Gateway.
    CreateTime string
    The time of creation for VPN Gateway, formatted in RFC3339 time string.
    ExpireTime string
    The expiration time for VPN Gateway, formatted in RFC3339 time string.
    Grade string
    The type of the VPN Gateway.
    Id string
    The ID of VPN Gateway.
    IpSets []GetVpnGatewaysVpnGatewayIpSet
    It is a nested type which documented below.
    Name string
    The name of the VPN Gateway.
    Remark string
    The remarks of VPN Gateway.
    Tag string
    A tag assigned to VPN Gateway.
    VpcId string
    The ID of VPC linked to the VPN Gateway.
    autoRenew Boolean
    Whether to renew an VPN Gateway automatically or not.
    chargeType String
    The charge type of VPN Gateway.
    createTime String
    The time of creation for VPN Gateway, formatted in RFC3339 time string.
    expireTime String
    The expiration time for VPN Gateway, formatted in RFC3339 time string.
    grade String
    The type of the VPN Gateway.
    id String
    The ID of VPN Gateway.
    ipSets List<GetVpnGatewaysVpnGatewayIpSet>
    It is a nested type which documented below.
    name String
    The name of the VPN Gateway.
    remark String
    The remarks of VPN Gateway.
    tag String
    A tag assigned to VPN Gateway.
    vpcId String
    The ID of VPC linked to the VPN Gateway.
    autoRenew boolean
    Whether to renew an VPN Gateway automatically or not.
    chargeType string
    The charge type of VPN Gateway.
    createTime string
    The time of creation for VPN Gateway, formatted in RFC3339 time string.
    expireTime string
    The expiration time for VPN Gateway, formatted in RFC3339 time string.
    grade string
    The type of the VPN Gateway.
    id string
    The ID of VPN Gateway.
    ipSets GetVpnGatewaysVpnGatewayIpSet[]
    It is a nested type which documented below.
    name string
    The name of the VPN Gateway.
    remark string
    The remarks of VPN Gateway.
    tag string
    A tag assigned to VPN Gateway.
    vpcId string
    The ID of VPC linked to the VPN Gateway.
    auto_renew bool
    Whether to renew an VPN Gateway automatically or not.
    charge_type str
    The charge type of VPN Gateway.
    create_time str
    The time of creation for VPN Gateway, formatted in RFC3339 time string.
    expire_time str
    The expiration time for VPN Gateway, formatted in RFC3339 time string.
    grade str
    The type of the VPN Gateway.
    id str
    The ID of VPN Gateway.
    ip_sets Sequence[GetVpnGatewaysVpnGatewayIpSet]
    It is a nested type which documented below.
    name str
    The name of the VPN Gateway.
    remark str
    The remarks of VPN Gateway.
    tag str
    A tag assigned to VPN Gateway.
    vpc_id str
    The ID of VPC linked to the VPN Gateway.
    autoRenew Boolean
    Whether to renew an VPN Gateway automatically or not.
    chargeType String
    The charge type of VPN Gateway.
    createTime String
    The time of creation for VPN Gateway, formatted in RFC3339 time string.
    expireTime String
    The expiration time for VPN Gateway, formatted in RFC3339 time string.
    grade String
    The type of the VPN Gateway.
    id String
    The ID of VPN Gateway.
    ipSets List<Property Map>
    It is a nested type which documented below.
    name String
    The name of the VPN Gateway.
    remark String
    The remarks of VPN Gateway.
    tag String
    A tag assigned to VPN Gateway.
    vpcId String
    The ID of VPC linked to the VPN Gateway.

    GetVpnGatewaysVpnGatewayIpSet

    InternetType string
    Type of Elastic IP routes.
    Ip string
    Elastic IP address.
    InternetType string
    Type of Elastic IP routes.
    Ip string
    Elastic IP address.
    internetType String
    Type of Elastic IP routes.
    ip String
    Elastic IP address.
    internetType string
    Type of Elastic IP routes.
    ip string
    Elastic IP address.
    internet_type str
    Type of Elastic IP routes.
    ip str
    Elastic IP address.
    internetType String
    Type of Elastic IP routes.
    ip String
    Elastic IP address.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud