generated from pulumi/pulumi-tf-provider-boilerplate
/
getTwingateRemoteNetworks.go
181 lines (159 loc) · 7.66 KB
/
getTwingateRemoteNetworks.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package twingate
import (
"context"
"reflect"
"github.com/Twingate/pulumi-twingate/sdk/v3/go/twingate/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A Remote Network represents a single private network in Twingate that can have one or more Connectors and Resources assigned to it. You must create a Remote Network before creating Resources and Connectors that belong to it. For more information, see Twingate's [documentation](https://docs.twingate.com/docs/remote-networks).
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/Twingate/pulumi-twingate/sdk/v3/go/twingate"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := twingate.GetTwingateRemoteNetworks(ctx, &twingate.GetTwingateRemoteNetworksArgs{
// Name: pulumi.StringRef("<your network's name>"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetTwingateRemoteNetworks(ctx *pulumi.Context, args *GetTwingateRemoteNetworksArgs, opts ...pulumi.InvokeOption) (*GetTwingateRemoteNetworksResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetTwingateRemoteNetworksResult
err := ctx.Invoke("twingate:index/getTwingateRemoteNetworks:getTwingateRemoteNetworks", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getTwingateRemoteNetworks.
type GetTwingateRemoteNetworksArgs struct {
// The name of the Remote Network.
Name *string `pulumi:"name"`
// Match when the value exist in the name of the remote network.
NameContains *string `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the remote network.
NameExclude *string `pulumi:"nameExclude"`
// The name of the remote network must start with the value.
NamePrefix *string `pulumi:"namePrefix"`
// The regular expression match of the name of the remote network.
NameRegexp *string `pulumi:"nameRegexp"`
// The name of the remote network must end with the value.
NameSuffix *string `pulumi:"nameSuffix"`
}
// A collection of values returned by getTwingateRemoteNetworks.
type GetTwingateRemoteNetworksResult struct {
// The ID of this resource.
Id string `pulumi:"id"`
// Returns only remote networks that exactly match this name. If no options are passed it will return all remote networks. Only one option can be used at a time.
Name *string `pulumi:"name"`
// Match when the value exist in the name of the remote network.
NameContains *string `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the remote network.
NameExclude *string `pulumi:"nameExclude"`
// The name of the remote network must start with the value.
NamePrefix *string `pulumi:"namePrefix"`
// The regular expression match of the name of the remote network.
NameRegexp *string `pulumi:"nameRegexp"`
// The name of the remote network must end with the value.
NameSuffix *string `pulumi:"nameSuffix"`
// List of Remote Networks
RemoteNetworks []GetTwingateRemoteNetworksRemoteNetwork `pulumi:"remoteNetworks"`
}
func GetTwingateRemoteNetworksOutput(ctx *pulumi.Context, args GetTwingateRemoteNetworksOutputArgs, opts ...pulumi.InvokeOption) GetTwingateRemoteNetworksResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetTwingateRemoteNetworksResult, error) {
args := v.(GetTwingateRemoteNetworksArgs)
r, err := GetTwingateRemoteNetworks(ctx, &args, opts...)
var s GetTwingateRemoteNetworksResult
if r != nil {
s = *r
}
return s, err
}).(GetTwingateRemoteNetworksResultOutput)
}
// A collection of arguments for invoking getTwingateRemoteNetworks.
type GetTwingateRemoteNetworksOutputArgs struct {
// The name of the Remote Network.
Name pulumi.StringPtrInput `pulumi:"name"`
// Match when the value exist in the name of the remote network.
NameContains pulumi.StringPtrInput `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the remote network.
NameExclude pulumi.StringPtrInput `pulumi:"nameExclude"`
// The name of the remote network must start with the value.
NamePrefix pulumi.StringPtrInput `pulumi:"namePrefix"`
// The regular expression match of the name of the remote network.
NameRegexp pulumi.StringPtrInput `pulumi:"nameRegexp"`
// The name of the remote network must end with the value.
NameSuffix pulumi.StringPtrInput `pulumi:"nameSuffix"`
}
func (GetTwingateRemoteNetworksOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetTwingateRemoteNetworksArgs)(nil)).Elem()
}
// A collection of values returned by getTwingateRemoteNetworks.
type GetTwingateRemoteNetworksResultOutput struct{ *pulumi.OutputState }
func (GetTwingateRemoteNetworksResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetTwingateRemoteNetworksResult)(nil)).Elem()
}
func (o GetTwingateRemoteNetworksResultOutput) ToGetTwingateRemoteNetworksResultOutput() GetTwingateRemoteNetworksResultOutput {
return o
}
func (o GetTwingateRemoteNetworksResultOutput) ToGetTwingateRemoteNetworksResultOutputWithContext(ctx context.Context) GetTwingateRemoteNetworksResultOutput {
return o
}
// The ID of this resource.
func (o GetTwingateRemoteNetworksResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) string { return v.Id }).(pulumi.StringOutput)
}
// Returns only remote networks that exactly match this name. If no options are passed it will return all remote networks. Only one option can be used at a time.
func (o GetTwingateRemoteNetworksResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// Match when the value exist in the name of the remote network.
func (o GetTwingateRemoteNetworksResultOutput) NameContains() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) *string { return v.NameContains }).(pulumi.StringPtrOutput)
}
// Match when the exact value does not exist in the name of the remote network.
func (o GetTwingateRemoteNetworksResultOutput) NameExclude() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) *string { return v.NameExclude }).(pulumi.StringPtrOutput)
}
// The name of the remote network must start with the value.
func (o GetTwingateRemoteNetworksResultOutput) NamePrefix() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) *string { return v.NamePrefix }).(pulumi.StringPtrOutput)
}
// The regular expression match of the name of the remote network.
func (o GetTwingateRemoteNetworksResultOutput) NameRegexp() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) *string { return v.NameRegexp }).(pulumi.StringPtrOutput)
}
// The name of the remote network must end with the value.
func (o GetTwingateRemoteNetworksResultOutput) NameSuffix() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) *string { return v.NameSuffix }).(pulumi.StringPtrOutput)
}
// List of Remote Networks
func (o GetTwingateRemoteNetworksResultOutput) RemoteNetworks() GetTwingateRemoteNetworksRemoteNetworkArrayOutput {
return o.ApplyT(func(v GetTwingateRemoteNetworksResult) []GetTwingateRemoteNetworksRemoteNetwork {
return v.RemoteNetworks
}).(GetTwingateRemoteNetworksRemoteNetworkArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetTwingateRemoteNetworksResultOutput{})
}