generated from pulumi/pulumi-tf-provider-boilerplate
/
getTwingateResources.go
179 lines (157 loc) · 7.13 KB
/
getTwingateResources.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
// 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"
)
// Resources in Twingate represent servers on the private network that clients can connect to. Resources can be defined by IP, CIDR range, FQDN, or DNS zone. For more information, see the Twingate [documentation](https://docs.twingate.com/docs/resources-and-access-nodes).
//
// ## 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.GetTwingateResources(ctx, &twingate.GetTwingateResourcesArgs{
// Name: pulumi.StringRef("<your resource's name>"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetTwingateResources(ctx *pulumi.Context, args *GetTwingateResourcesArgs, opts ...pulumi.InvokeOption) (*GetTwingateResourcesResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetTwingateResourcesResult
err := ctx.Invoke("twingate:index/getTwingateResources:getTwingateResources", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getTwingateResources.
type GetTwingateResourcesArgs struct {
// The name of the Resource
Name *string `pulumi:"name"`
// Match when the value exist in the name of the resource.
NameContains *string `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the resource.
NameExclude *string `pulumi:"nameExclude"`
// The name of the resource must start with the value.
NamePrefix *string `pulumi:"namePrefix"`
// The regular expression match of the name of the resource.
NameRegexp *string `pulumi:"nameRegexp"`
// The name of the resource must end with the value.
NameSuffix *string `pulumi:"nameSuffix"`
}
// A collection of values returned by getTwingateResources.
type GetTwingateResourcesResult struct {
// The ID of this resource.
Id string `pulumi:"id"`
// Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
Name *string `pulumi:"name"`
// Match when the value exist in the name of the resource.
NameContains *string `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the resource.
NameExclude *string `pulumi:"nameExclude"`
// The name of the resource must start with the value.
NamePrefix *string `pulumi:"namePrefix"`
// The regular expression match of the name of the resource.
NameRegexp *string `pulumi:"nameRegexp"`
// The name of the resource must end with the value.
NameSuffix *string `pulumi:"nameSuffix"`
// List of Resources
Resources []GetTwingateResourcesResource `pulumi:"resources"`
}
func GetTwingateResourcesOutput(ctx *pulumi.Context, args GetTwingateResourcesOutputArgs, opts ...pulumi.InvokeOption) GetTwingateResourcesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetTwingateResourcesResult, error) {
args := v.(GetTwingateResourcesArgs)
r, err := GetTwingateResources(ctx, &args, opts...)
var s GetTwingateResourcesResult
if r != nil {
s = *r
}
return s, err
}).(GetTwingateResourcesResultOutput)
}
// A collection of arguments for invoking getTwingateResources.
type GetTwingateResourcesOutputArgs struct {
// The name of the Resource
Name pulumi.StringPtrInput `pulumi:"name"`
// Match when the value exist in the name of the resource.
NameContains pulumi.StringPtrInput `pulumi:"nameContains"`
// Match when the exact value does not exist in the name of the resource.
NameExclude pulumi.StringPtrInput `pulumi:"nameExclude"`
// The name of the resource must start with the value.
NamePrefix pulumi.StringPtrInput `pulumi:"namePrefix"`
// The regular expression match of the name of the resource.
NameRegexp pulumi.StringPtrInput `pulumi:"nameRegexp"`
// The name of the resource must end with the value.
NameSuffix pulumi.StringPtrInput `pulumi:"nameSuffix"`
}
func (GetTwingateResourcesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetTwingateResourcesArgs)(nil)).Elem()
}
// A collection of values returned by getTwingateResources.
type GetTwingateResourcesResultOutput struct{ *pulumi.OutputState }
func (GetTwingateResourcesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetTwingateResourcesResult)(nil)).Elem()
}
func (o GetTwingateResourcesResultOutput) ToGetTwingateResourcesResultOutput() GetTwingateResourcesResultOutput {
return o
}
func (o GetTwingateResourcesResultOutput) ToGetTwingateResourcesResultOutputWithContext(ctx context.Context) GetTwingateResourcesResultOutput {
return o
}
// The ID of this resource.
func (o GetTwingateResourcesResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) string { return v.Id }).(pulumi.StringOutput)
}
// Returns only resources that exactly match this name. If no options are passed it will return all resources. Only one option can be used at a time.
func (o GetTwingateResourcesResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// Match when the value exist in the name of the resource.
func (o GetTwingateResourcesResultOutput) NameContains() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) *string { return v.NameContains }).(pulumi.StringPtrOutput)
}
// Match when the exact value does not exist in the name of the resource.
func (o GetTwingateResourcesResultOutput) NameExclude() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) *string { return v.NameExclude }).(pulumi.StringPtrOutput)
}
// The name of the resource must start with the value.
func (o GetTwingateResourcesResultOutput) NamePrefix() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) *string { return v.NamePrefix }).(pulumi.StringPtrOutput)
}
// The regular expression match of the name of the resource.
func (o GetTwingateResourcesResultOutput) NameRegexp() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) *string { return v.NameRegexp }).(pulumi.StringPtrOutput)
}
// The name of the resource must end with the value.
func (o GetTwingateResourcesResultOutput) NameSuffix() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) *string { return v.NameSuffix }).(pulumi.StringPtrOutput)
}
// List of Resources
func (o GetTwingateResourcesResultOutput) Resources() GetTwingateResourcesResourceArrayOutput {
return o.ApplyT(func(v GetTwingateResourcesResult) []GetTwingateResourcesResource { return v.Resources }).(GetTwingateResourcesResourceArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetTwingateResourcesResultOutput{})
}