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

ucloud.getVpnConnections

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 Connection resources according to their ID, name and tag.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getVpnConnections({});
    export const first = example.then(example => example.vpnConnections?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_vpn_connections()
    pulumi.export("first", example.vpn_connections[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.GetVpnConnections(ctx, &ucloud.GetVpnConnectionsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.VpnConnections[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetVpnConnections.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getVpnConnectionsResult => getVpnConnectionsResult.VpnConnections[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.GetVpnConnectionsArgs;
    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.getVpnConnections();
    
            ctx.export("first", example.applyValue(getVpnConnectionsResult -> getVpnConnectionsResult.vpnConnections()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getVpnConnections
          arguments: {}
    outputs:
      first: ${example.vpnConnections[0].id}
    

    Using getVpnConnections

    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 getVpnConnections(args: GetVpnConnectionsArgs, opts?: InvokeOptions): Promise<GetVpnConnectionsResult>
    function getVpnConnectionsOutput(args: GetVpnConnectionsOutputArgs, opts?: InvokeOptions): Output<GetVpnConnectionsResult>
    def get_vpn_connections(id: Optional[str] = None,
                            ids: Optional[Sequence[str]] = None,
                            name_regex: Optional[str] = None,
                            output_file: Optional[str] = None,
                            tag: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetVpnConnectionsResult
    def get_vpn_connections_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,
                            opts: Optional[InvokeOptions] = None) -> Output[GetVpnConnectionsResult]
    func GetVpnConnections(ctx *Context, args *GetVpnConnectionsArgs, opts ...InvokeOption) (*GetVpnConnectionsResult, error)
    func GetVpnConnectionsOutput(ctx *Context, args *GetVpnConnectionsOutputArgs, opts ...InvokeOption) GetVpnConnectionsResultOutput

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

    public static class GetVpnConnections 
    {
        public static Task<GetVpnConnectionsResult> InvokeAsync(GetVpnConnectionsArgs args, InvokeOptions? opts = null)
        public static Output<GetVpnConnectionsResult> Invoke(GetVpnConnectionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpnConnectionsResult> getVpnConnections(GetVpnConnectionsArgs args, InvokeOptions options)
    public static Output<GetVpnConnectionsResult> getVpnConnections(GetVpnConnectionsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getVpnConnections:getVpnConnections
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getVpnConnections Result

    The following output properties are available:

    Id string
    The ID of VPN Connection.
    Ids List<string>
    TotalCount double
    Total number of VPN Connections that satisfy the condition.
    VpnConnections List<GetVpnConnectionsVpnConnection>
    It is a nested type. VPN Connections documented below.
    NameRegex string
    OutputFile string
    Tag string
    A tag assigned to the VPN Connection.
    Id string
    The ID of VPN Connection.
    Ids []string
    TotalCount float64
    Total number of VPN Connections that satisfy the condition.
    VpnConnections []GetVpnConnectionsVpnConnection
    It is a nested type. VPN Connections documented below.
    NameRegex string
    OutputFile string
    Tag string
    A tag assigned to the VPN Connection.
    id String
    The ID of VPN Connection.
    ids List<String>
    totalCount Double
    Total number of VPN Connections that satisfy the condition.
    vpnConnections List<GetVpnConnectionsVpnConnection>
    It is a nested type. VPN Connections documented below.
    nameRegex String
    outputFile String
    tag String
    A tag assigned to the VPN Connection.
    id string
    The ID of VPN Connection.
    ids string[]
    totalCount number
    Total number of VPN Connections that satisfy the condition.
    vpnConnections GetVpnConnectionsVpnConnection[]
    It is a nested type. VPN Connections documented below.
    nameRegex string
    outputFile string
    tag string
    A tag assigned to the VPN Connection.
    id str
    The ID of VPN Connection.
    ids Sequence[str]
    total_count float
    Total number of VPN Connections that satisfy the condition.
    vpn_connections Sequence[GetVpnConnectionsVpnConnection]
    It is a nested type. VPN Connections documented below.
    name_regex str
    output_file str
    tag str
    A tag assigned to the VPN Connection.
    id String
    The ID of VPN Connection.
    ids List<String>
    totalCount Number
    Total number of VPN Connections that satisfy the condition.
    vpnConnections List<Property Map>
    It is a nested type. VPN Connections documented below.
    nameRegex String
    outputFile String
    tag String
    A tag assigned to the VPN Connection.

    Supporting Types

    GetVpnConnectionsVpnConnection

    CreateTime string
    The time of creation for VPN Connection, formatted in RFC3339 time string.
    CustomerGatewayId string
    The ID of VPN Customer Gateway.
    Id string
    The ID of VPN Connection.
    IkeConfigs List<GetVpnConnectionsVpnConnectionIkeConfig>
    It is a nested type which documented below.
    IpsecConfigs List<GetVpnConnectionsVpnConnectionIpsecConfig>
    It is a nested type which documented below.
    Name string
    The name of the VPN Connection.
    Remark string
    The remarks of VPN Connection.
    Tag string
    A tag assigned to VPN Connection.
    VpcId string
    The ID of VPC linked to the VPN Connection.
    VpnGatewayId string
    The ID of VPN Gateway.
    CreateTime string
    The time of creation for VPN Connection, formatted in RFC3339 time string.
    CustomerGatewayId string
    The ID of VPN Customer Gateway.
    Id string
    The ID of VPN Connection.
    IkeConfigs []GetVpnConnectionsVpnConnectionIkeConfig
    It is a nested type which documented below.
    IpsecConfigs []GetVpnConnectionsVpnConnectionIpsecConfig
    It is a nested type which documented below.
    Name string
    The name of the VPN Connection.
    Remark string
    The remarks of VPN Connection.
    Tag string
    A tag assigned to VPN Connection.
    VpcId string
    The ID of VPC linked to the VPN Connection.
    VpnGatewayId string
    The ID of VPN Gateway.
    createTime String
    The time of creation for VPN Connection, formatted in RFC3339 time string.
    customerGatewayId String
    The ID of VPN Customer Gateway.
    id String
    The ID of VPN Connection.
    ikeConfigs List<GetVpnConnectionsVpnConnectionIkeConfig>
    It is a nested type which documented below.
    ipsecConfigs List<GetVpnConnectionsVpnConnectionIpsecConfig>
    It is a nested type which documented below.
    name String
    The name of the VPN Connection.
    remark String
    The remarks of VPN Connection.
    tag String
    A tag assigned to VPN Connection.
    vpcId String
    The ID of VPC linked to the VPN Connection.
    vpnGatewayId String
    The ID of VPN Gateway.
    createTime string
    The time of creation for VPN Connection, formatted in RFC3339 time string.
    customerGatewayId string
    The ID of VPN Customer Gateway.
    id string
    The ID of VPN Connection.
    ikeConfigs GetVpnConnectionsVpnConnectionIkeConfig[]
    It is a nested type which documented below.
    ipsecConfigs GetVpnConnectionsVpnConnectionIpsecConfig[]
    It is a nested type which documented below.
    name string
    The name of the VPN Connection.
    remark string
    The remarks of VPN Connection.
    tag string
    A tag assigned to VPN Connection.
    vpcId string
    The ID of VPC linked to the VPN Connection.
    vpnGatewayId string
    The ID of VPN Gateway.
    create_time str
    The time of creation for VPN Connection, formatted in RFC3339 time string.
    customer_gateway_id str
    The ID of VPN Customer Gateway.
    id str
    The ID of VPN Connection.
    ike_configs Sequence[GetVpnConnectionsVpnConnectionIkeConfig]
    It is a nested type which documented below.
    ipsec_configs Sequence[GetVpnConnectionsVpnConnectionIpsecConfig]
    It is a nested type which documented below.
    name str
    The name of the VPN Connection.
    remark str
    The remarks of VPN Connection.
    tag str
    A tag assigned to VPN Connection.
    vpc_id str
    The ID of VPC linked to the VPN Connection.
    vpn_gateway_id str
    The ID of VPN Gateway.
    createTime String
    The time of creation for VPN Connection, formatted in RFC3339 time string.
    customerGatewayId String
    The ID of VPN Customer Gateway.
    id String
    The ID of VPN Connection.
    ikeConfigs List<Property Map>
    It is a nested type which documented below.
    ipsecConfigs List<Property Map>
    It is a nested type which documented below.
    name String
    The name of the VPN Connection.
    remark String
    The remarks of VPN Connection.
    tag String
    A tag assigned to VPN Connection.
    vpcId String
    The ID of VPC linked to the VPN Connection.
    vpnGatewayId String
    The ID of VPN Gateway.

    GetVpnConnectionsVpnConnectionIkeConfig

    AuthenticationAlgorithm string
    The authentication algorithm of IPSec negotiation.
    DhGroup string
    The Diffie-Hellman group used by IKE negotiation.
    EncryptionAlgorithm string
    The encryption algorithm of IPSec negotiation.
    ExchangeMode string
    The negotiation exchange mode of IKE V1 of VPN gateway.
    IkeVersion string
    The version of the IKE protocol.
    LocalId string
    The identification of the VPN gateway.
    PreSharedKey string
    The key used for authentication between the VPN gateway and the Customer gateway.
    RemoteId string
    The identification of the Customer gateway.
    SaLifeTime double
    The Security Association lifecycle as the result of IPSec negotiation.
    AuthenticationAlgorithm string
    The authentication algorithm of IPSec negotiation.
    DhGroup string
    The Diffie-Hellman group used by IKE negotiation.
    EncryptionAlgorithm string
    The encryption algorithm of IPSec negotiation.
    ExchangeMode string
    The negotiation exchange mode of IKE V1 of VPN gateway.
    IkeVersion string
    The version of the IKE protocol.
    LocalId string
    The identification of the VPN gateway.
    PreSharedKey string
    The key used for authentication between the VPN gateway and the Customer gateway.
    RemoteId string
    The identification of the Customer gateway.
    SaLifeTime float64
    The Security Association lifecycle as the result of IPSec negotiation.
    authenticationAlgorithm String
    The authentication algorithm of IPSec negotiation.
    dhGroup String
    The Diffie-Hellman group used by IKE negotiation.
    encryptionAlgorithm String
    The encryption algorithm of IPSec negotiation.
    exchangeMode String
    The negotiation exchange mode of IKE V1 of VPN gateway.
    ikeVersion String
    The version of the IKE protocol.
    localId String
    The identification of the VPN gateway.
    preSharedKey String
    The key used for authentication between the VPN gateway and the Customer gateway.
    remoteId String
    The identification of the Customer gateway.
    saLifeTime Double
    The Security Association lifecycle as the result of IPSec negotiation.
    authenticationAlgorithm string
    The authentication algorithm of IPSec negotiation.
    dhGroup string
    The Diffie-Hellman group used by IKE negotiation.
    encryptionAlgorithm string
    The encryption algorithm of IPSec negotiation.
    exchangeMode string
    The negotiation exchange mode of IKE V1 of VPN gateway.
    ikeVersion string
    The version of the IKE protocol.
    localId string
    The identification of the VPN gateway.
    preSharedKey string
    The key used for authentication between the VPN gateway and the Customer gateway.
    remoteId string
    The identification of the Customer gateway.
    saLifeTime number
    The Security Association lifecycle as the result of IPSec negotiation.
    authentication_algorithm str
    The authentication algorithm of IPSec negotiation.
    dh_group str
    The Diffie-Hellman group used by IKE negotiation.
    encryption_algorithm str
    The encryption algorithm of IPSec negotiation.
    exchange_mode str
    The negotiation exchange mode of IKE V1 of VPN gateway.
    ike_version str
    The version of the IKE protocol.
    local_id str
    The identification of the VPN gateway.
    pre_shared_key str
    The key used for authentication between the VPN gateway and the Customer gateway.
    remote_id str
    The identification of the Customer gateway.
    sa_life_time float
    The Security Association lifecycle as the result of IPSec negotiation.
    authenticationAlgorithm String
    The authentication algorithm of IPSec negotiation.
    dhGroup String
    The Diffie-Hellman group used by IKE negotiation.
    encryptionAlgorithm String
    The encryption algorithm of IPSec negotiation.
    exchangeMode String
    The negotiation exchange mode of IKE V1 of VPN gateway.
    ikeVersion String
    The version of the IKE protocol.
    localId String
    The identification of the VPN gateway.
    preSharedKey String
    The key used for authentication between the VPN gateway and the Customer gateway.
    remoteId String
    The identification of the Customer gateway.
    saLifeTime Number
    The Security Association lifecycle as the result of IPSec negotiation.

    GetVpnConnectionsVpnConnectionIpsecConfig

    AuthenticationAlgorithm string
    The authentication algorithm of IPSec negotiation.
    EncryptionAlgorithm string
    The encryption algorithm of IPSec negotiation.
    LocalSubnetIds List<string>
    The id list of Local subnet.
    PfsDhGroup string
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open.
    Protocol string
    The security protocol of IPSec negotiation.
    RemoteSubnets List<string>
    The ip address list of remote subnet.
    SaLifeTime double
    The Security Association lifecycle as the result of IPSec negotiation.
    SaLifeTimeBytes double
    The Security Association lifecycle in bytes as the result of IPSec negotiation.
    AuthenticationAlgorithm string
    The authentication algorithm of IPSec negotiation.
    EncryptionAlgorithm string
    The encryption algorithm of IPSec negotiation.
    LocalSubnetIds []string
    The id list of Local subnet.
    PfsDhGroup string
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open.
    Protocol string
    The security protocol of IPSec negotiation.
    RemoteSubnets []string
    The ip address list of remote subnet.
    SaLifeTime float64
    The Security Association lifecycle as the result of IPSec negotiation.
    SaLifeTimeBytes float64
    The Security Association lifecycle in bytes as the result of IPSec negotiation.
    authenticationAlgorithm String
    The authentication algorithm of IPSec negotiation.
    encryptionAlgorithm String
    The encryption algorithm of IPSec negotiation.
    localSubnetIds List<String>
    The id list of Local subnet.
    pfsDhGroup String
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open.
    protocol String
    The security protocol of IPSec negotiation.
    remoteSubnets List<String>
    The ip address list of remote subnet.
    saLifeTime Double
    The Security Association lifecycle as the result of IPSec negotiation.
    saLifeTimeBytes Double
    The Security Association lifecycle in bytes as the result of IPSec negotiation.
    authenticationAlgorithm string
    The authentication algorithm of IPSec negotiation.
    encryptionAlgorithm string
    The encryption algorithm of IPSec negotiation.
    localSubnetIds string[]
    The id list of Local subnet.
    pfsDhGroup string
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open.
    protocol string
    The security protocol of IPSec negotiation.
    remoteSubnets string[]
    The ip address list of remote subnet.
    saLifeTime number
    The Security Association lifecycle as the result of IPSec negotiation.
    saLifeTimeBytes number
    The Security Association lifecycle in bytes as the result of IPSec negotiation.
    authentication_algorithm str
    The authentication algorithm of IPSec negotiation.
    encryption_algorithm str
    The encryption algorithm of IPSec negotiation.
    local_subnet_ids Sequence[str]
    The id list of Local subnet.
    pfs_dh_group str
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open.
    protocol str
    The security protocol of IPSec negotiation.
    remote_subnets Sequence[str]
    The ip address list of remote subnet.
    sa_life_time float
    The Security Association lifecycle as the result of IPSec negotiation.
    sa_life_time_bytes float
    The Security Association lifecycle in bytes as the result of IPSec negotiation.
    authenticationAlgorithm String
    The authentication algorithm of IPSec negotiation.
    encryptionAlgorithm String
    The encryption algorithm of IPSec negotiation.
    localSubnetIds List<String>
    The id list of Local subnet.
    pfsDhGroup String
    Whether the PFS of IPSec negotiation is on or off, disable as off, The Diffie-Hellman group as open.
    protocol String
    The security protocol of IPSec negotiation.
    remoteSubnets List<String>
    The ip address list of remote subnet.
    saLifeTime Number
    The Security Association lifecycle as the result of IPSec negotiation.
    saLifeTimeBytes Number
    The Security Association lifecycle in bytes as the result of IPSec negotiation.

    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