ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud
ucloud.getVpnGateways
Explore with Pulumi AI
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
[]
. - Name
Regex string - A regex string to filter resulting VPN Gateways by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Tag string
- A tag assigned to VPN Gateway.
- Vpc
Id 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
[]
. - Name
Regex string - A regex string to filter resulting VPN Gateways by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Tag string
- A tag assigned to VPN Gateway.
- Vpc
Id 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
[]
. - name
Regex String - A regex string to filter resulting VPN Gateways by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - tag String
- A tag assigned to VPN Gateway.
- vpc
Id 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
[]
. - name
Regex string - A regex string to filter resulting VPN Gateways by name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - tag string
- A tag assigned to VPN Gateway.
- vpc
Id 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
[]
. - name
Regex String - A regex string to filter resulting VPN Gateways by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - tag String
- A tag assigned to VPN Gateway.
- vpc
Id 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>
- Total
Count double - Total number of VPN Gateways that satisfy the condition.
- Vpn
Gateways List<GetVpn Gateways Vpn Gateway> - It is a nested type. VPN Gateways documented below.
- Name
Regex string - Output
File string - Tag string
- A tag assigned to the VPN Gateway.
- Vpc
Id string - The ID of VPC linked to the VPN Gateway.
- Id string
- The ID of VPN Gateway.
- Ids []string
- Total
Count float64 - Total number of VPN Gateways that satisfy the condition.
- Vpn
Gateways []GetVpn Gateways Vpn Gateway - It is a nested type. VPN Gateways documented below.
- Name
Regex string - Output
File string - Tag string
- A tag assigned to the VPN Gateway.
- Vpc
Id string - The ID of VPC linked to the VPN Gateway.
- id String
- The ID of VPN Gateway.
- ids List<String>
- total
Count Double - Total number of VPN Gateways that satisfy the condition.
- vpn
Gateways List<GetVpn Gateways Vpn Gateway> - It is a nested type. VPN Gateways documented below.
- name
Regex String - output
File String - tag String
- A tag assigned to the VPN Gateway.
- vpc
Id String - The ID of VPC linked to the VPN Gateway.
- id string
- The ID of VPN Gateway.
- ids string[]
- total
Count number - Total number of VPN Gateways that satisfy the condition.
- vpn
Gateways GetVpn Gateways Vpn Gateway[] - It is a nested type. VPN Gateways documented below.
- name
Regex string - output
File string - tag string
- A tag assigned to the VPN Gateway.
- vpc
Id 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[GetVpn Gateways Vpn Gateway] - 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>
- total
Count Number - Total number of VPN Gateways that satisfy the condition.
- vpn
Gateways List<Property Map> - It is a nested type. VPN Gateways documented below.
- name
Regex String - output
File String - tag String
- A tag assigned to the VPN Gateway.
- vpc
Id String - The ID of VPC linked to the VPN Gateway.
Supporting Types
GetVpnGatewaysVpnGateway
- Auto
Renew bool - Whether to renew an VPN Gateway automatically or not.
- Charge
Type string - The charge type of VPN Gateway.
- Create
Time string - The time of creation for VPN Gateway, formatted in RFC3339 time string.
- Expire
Time 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.
- Ip
Sets List<GetVpn Gateways Vpn Gateway Ip Set> - 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.
- Vpc
Id string - The ID of VPC linked to the VPN Gateway.
- Auto
Renew bool - Whether to renew an VPN Gateway automatically or not.
- Charge
Type string - The charge type of VPN Gateway.
- Create
Time string - The time of creation for VPN Gateway, formatted in RFC3339 time string.
- Expire
Time 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.
- Ip
Sets []GetVpn Gateways Vpn Gateway Ip Set - 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.
- Vpc
Id string - The ID of VPC linked to the VPN Gateway.
- auto
Renew Boolean - Whether to renew an VPN Gateway automatically or not.
- charge
Type String - The charge type of VPN Gateway.
- create
Time String - The time of creation for VPN Gateway, formatted in RFC3339 time string.
- expire
Time 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.
- ip
Sets List<GetVpn Gateways Vpn Gateway Ip Set> - 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.
- vpc
Id String - The ID of VPC linked to the VPN Gateway.
- auto
Renew boolean - Whether to renew an VPN Gateway automatically or not.
- charge
Type string - The charge type of VPN Gateway.
- create
Time string - The time of creation for VPN Gateway, formatted in RFC3339 time string.
- expire
Time 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.
- ip
Sets GetVpn Gateways Vpn Gateway Ip Set[] - 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.
- vpc
Id 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[GetVpn Gateways Vpn Gateway Ip Set] - 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.
- auto
Renew Boolean - Whether to renew an VPN Gateway automatically or not.
- charge
Type String - The charge type of VPN Gateway.
- create
Time String - The time of creation for VPN Gateway, formatted in RFC3339 time string.
- expire
Time 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.
- ip
Sets 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.
- vpc
Id String - The ID of VPC linked to the VPN Gateway.
GetVpnGatewaysVpnGatewayIpSet
- Internet
Type string - Type of Elastic IP routes.
- Ip string
- Elastic IP address.
- Internet
Type string - Type of Elastic IP routes.
- Ip string
- Elastic IP address.
- internet
Type String - Type of Elastic IP routes.
- ip String
- Elastic IP address.
- internet
Type string - Type of Elastic IP routes.
- ip string
- Elastic IP address.
- internet_
type str - Type of Elastic IP routes.
- ip str
- Elastic IP address.
- internet
Type 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.