This repository has been archived by the owner on Jul 6, 2023. It is now read-only.
/
getVPNConnection.go
66 lines (61 loc) · 2.17 KB
/
getVPNConnection.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ipsecvpn
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source providers a list of VPN Connection resources according to their ID, name and tag.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-ucloud/sdk/go/ucloud/ipsecvpn"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := ipsecvpn.LookupVPNConnection(ctx, nil, nil)
// if err != nil {
// return err
// }
// ctx.Export("first", example.VpnConnections[0].Id)
// return nil
// })
// }
// ```
func LookupVPNConnection(ctx *pulumi.Context, args *LookupVPNConnectionArgs, opts ...pulumi.InvokeOption) (*LookupVPNConnectionResult, error) {
var rv LookupVPNConnectionResult
err := ctx.Invoke("ucloud:ipsecvpn/getVPNConnection:getVPNConnection", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getVPNConnection.
type LookupVPNConnectionArgs struct {
// A list of VPN Connection IDs, all the VPN Connections belongs to the defined region will be retrieved if this argument is `[]`.
Ids []string `pulumi:"ids"`
// A regex string to filter resulting VPN Connections by name.
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
// A tag assigned to VPN Connection.
Tag *string `pulumi:"tag"`
}
// A collection of values returned by getVPNConnection.
type LookupVPNConnectionResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Ids []string `pulumi:"ids"`
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
// A tag assigned to the VPN Connection.
Tag *string `pulumi:"tag"`
// Total number of VPN Connections that satisfy the condition.
TotalCount int `pulumi:"totalCount"`
// It is a nested type. VPN Connections documented below.
VpnConnections []GetVPNConnectionVpnConnection `pulumi:"vpnConnections"`
}