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

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);
Copy
import pulumi
import pulumi_ucloud as ucloud

example = ucloud.get_vpn_connections()
pulumi.export("first", example.vpn_connections[0].id)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ucloud:getVpnConnections
      arguments: {}
outputs:
  first: ${example.vpnConnections[0].id}
Copy

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>
Copy
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]
Copy
func GetVpnConnections(ctx *Context, args *GetVpnConnectionsArgs, opts ...InvokeOption) (*GetVpnConnectionsResult, error)
func GetVpnConnectionsOutput(ctx *Context, args *GetVpnConnectionsOutputArgs, opts ...InvokeOption) GetVpnConnectionsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetVpnConnectionsResult> getVpnConnections(GetVpnConnectionsArgs args, InvokeOptions options)
public static Output<GetVpnConnectionsResult> getVpnConnections(GetVpnConnectionsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ucloud:index/getVpnConnections:getVpnConnections
  arguments:
    # arguments dictionary
Copy

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

GetVpnConnectionsVpnConnectionIkeConfig

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

GetVpnConnectionsVpnConnectionIpsecConfig

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