generated from pulumi/pulumi-tf-provider-boilerplate
/
getNode.go
185 lines (163 loc) · 7.46 KB
/
getNode.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
182
183
184
185
// 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 sdm
import (
"context"
"reflect"
"github.com/pierskarsenbarg/pulumi-sdm/sdk/go/sdm/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Nodes make up the strongDM network, and allow your users to connect securely to your resources.
//
// There are two types of nodes:
// 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
// 2. **Gateways:** a relay that also listens for connections from strongDM clients
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pierskarsenbarg/pulumi-sdm/sdk/go/sdm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := sdm.LookupNode(ctx, &sdm.LookupNodeArgs{
// Tags: map[string]interface{}{
// "env": "dev",
// "region": "us-west",
// },
// Type: pulumi.StringRef("gateway"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupNode(ctx *pulumi.Context, args *LookupNodeArgs, opts ...pulumi.InvokeOption) (*LookupNodeResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupNodeResult
err := ctx.Invoke("sdm:index/getNode:getNode", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getNode.
type LookupNodeArgs struct {
// The hostname/port tuple which the gateway daemon will bind to. If not provided on create, set to "0.0.0.0:listen_address_port".
BindAddress *string `pulumi:"bindAddress"`
// Unique identifier of the Relay.
Id *string `pulumi:"id"`
// The public hostname/port tuple at which the gateway will be accessible to clients.
ListenAddress *string `pulumi:"listenAddress"`
// Unique human-readable name of the Relay. Node names must include only letters, numbers, and hyphens (no spaces, underscores, or other special characters). Generated if not provided on create.
Name *string `pulumi:"name"`
// Tags is a map of key, value pairs.
Tags map[string]interface{} `pulumi:"tags"`
// a filter to select all items of a certain subtype. See the [filter documentation](https://www.strongdm.com/docs/automation/getting-started/filters for more information.
Type *string `pulumi:"type"`
}
// A collection of values returned by getNode.
type LookupNodeResult struct {
// The hostname/port tuple which the gateway daemon will bind to. If not provided on create, set to "0.0.0.0:listen_address_port".
BindAddress *string `pulumi:"bindAddress"`
// Unique identifier of the Relay.
Id *string `pulumi:"id"`
// a list of strings of ids of data sources that match the given arguments.
Ids []string `pulumi:"ids"`
// The public hostname/port tuple at which the gateway will be accessible to clients.
ListenAddress *string `pulumi:"listenAddress"`
// Unique human-readable name of the Relay. Node names must include only letters, numbers, and hyphens (no spaces, underscores, or other special characters). Generated if not provided on create.
Name *string `pulumi:"name"`
// A single element list containing a map, where each key lists one of the following objects:
// * gateway:
Nodes []GetNodeNode `pulumi:"nodes"`
// Tags is a map of key, value pairs.
Tags map[string]interface{} `pulumi:"tags"`
Type *string `pulumi:"type"`
}
func LookupNodeOutput(ctx *pulumi.Context, args LookupNodeOutputArgs, opts ...pulumi.InvokeOption) LookupNodeResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupNodeResult, error) {
args := v.(LookupNodeArgs)
r, err := LookupNode(ctx, &args, opts...)
var s LookupNodeResult
if r != nil {
s = *r
}
return s, err
}).(LookupNodeResultOutput)
}
// A collection of arguments for invoking getNode.
type LookupNodeOutputArgs struct {
// The hostname/port tuple which the gateway daemon will bind to. If not provided on create, set to "0.0.0.0:listen_address_port".
BindAddress pulumi.StringPtrInput `pulumi:"bindAddress"`
// Unique identifier of the Relay.
Id pulumi.StringPtrInput `pulumi:"id"`
// The public hostname/port tuple at which the gateway will be accessible to clients.
ListenAddress pulumi.StringPtrInput `pulumi:"listenAddress"`
// Unique human-readable name of the Relay. Node names must include only letters, numbers, and hyphens (no spaces, underscores, or other special characters). Generated if not provided on create.
Name pulumi.StringPtrInput `pulumi:"name"`
// Tags is a map of key, value pairs.
Tags pulumi.MapInput `pulumi:"tags"`
// a filter to select all items of a certain subtype. See the [filter documentation](https://www.strongdm.com/docs/automation/getting-started/filters for more information.
Type pulumi.StringPtrInput `pulumi:"type"`
}
func (LookupNodeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodeArgs)(nil)).Elem()
}
// A collection of values returned by getNode.
type LookupNodeResultOutput struct{ *pulumi.OutputState }
func (LookupNodeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodeResult)(nil)).Elem()
}
func (o LookupNodeResultOutput) ToLookupNodeResultOutput() LookupNodeResultOutput {
return o
}
func (o LookupNodeResultOutput) ToLookupNodeResultOutputWithContext(ctx context.Context) LookupNodeResultOutput {
return o
}
// The hostname/port tuple which the gateway daemon will bind to. If not provided on create, set to "0.0.0.0:listen_address_port".
func (o LookupNodeResultOutput) BindAddress() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupNodeResult) *string { return v.BindAddress }).(pulumi.StringPtrOutput)
}
// Unique identifier of the Relay.
func (o LookupNodeResultOutput) Id() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupNodeResult) *string { return v.Id }).(pulumi.StringPtrOutput)
}
// a list of strings of ids of data sources that match the given arguments.
func (o LookupNodeResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupNodeResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
// The public hostname/port tuple at which the gateway will be accessible to clients.
func (o LookupNodeResultOutput) ListenAddress() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupNodeResult) *string { return v.ListenAddress }).(pulumi.StringPtrOutput)
}
// Unique human-readable name of the Relay. Node names must include only letters, numbers, and hyphens (no spaces, underscores, or other special characters). Generated if not provided on create.
func (o LookupNodeResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupNodeResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// A single element list containing a map, where each key lists one of the following objects:
// * gateway:
func (o LookupNodeResultOutput) Nodes() GetNodeNodeArrayOutput {
return o.ApplyT(func(v LookupNodeResult) []GetNodeNode { return v.Nodes }).(GetNodeNodeArrayOutput)
}
// Tags is a map of key, value pairs.
func (o LookupNodeResultOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v LookupNodeResult) map[string]interface{} { return v.Tags }).(pulumi.MapOutput)
}
func (o LookupNodeResultOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupNodeResult) *string { return v.Type }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupNodeResultOutput{})
}