generated from pulumi/pulumi-tf-provider-boilerplate
/
getCluster.go
331 lines (283 loc) · 18.8 KB
/
getCluster.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
// 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 rancher2
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve information about a Rancher v2 cluster.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-rancher2/sdk/v4/go/rancher2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := rancher2.LookupCluster(ctx, &rancher2.LookupClusterArgs{
// Name: "foo-custom",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) {
var rv LookupClusterResult
err := ctx.Invoke("rancher2:index/getCluster:getCluster", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCluster.
type LookupClusterArgs struct {
// The name of the Cluster (string)
Name string `pulumi:"name"`
}
// A collection of values returned by getCluster.
type LookupClusterResult struct {
// (Computed) Optional Agent Env Vars for Rancher agent. Just for Rancher v2.5.6 and above (list)
AgentEnvVars []string `pulumi:"agentEnvVars"`
// (Computed) The Azure aks configuration for `aks` Clusters. Conflicts with `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1)
AksConfig GetClusterAksConfig `pulumi:"aksConfig"`
// (Optional) The Azure AKS v2 configuration for creating/import `aks` Clusters. Conflicts with `aksConfig`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig` `k3sConfig` and `rkeConfig` (list maxitems:1)
AksConfigV2 GetClusterAksConfigV2 `pulumi:"aksConfigV2"`
// (Computed) Annotations for Node Pool object (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// (Computed) K8s cluster ca cert (string)
CaCert string `pulumi:"caCert"`
// (Computed) Enabling the [local cluster authorized endpoint](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#local-cluster-auth-endpoint) allows direct communication with the cluster, bypassing the Rancher API proxy. (list maxitems:1)
ClusterAuthEndpoint GetClusterClusterAuthEndpoint `pulumi:"clusterAuthEndpoint"`
// (Computed) Cluster monitoring config (list maxitems:1)
ClusterMonitoringInput GetClusterClusterMonitoringInput `pulumi:"clusterMonitoringInput"`
// (Computed) Cluster Registration Token generated for the cluster (list maxitems:1)
ClusterRegistrationToken GetClusterClusterRegistrationToken `pulumi:"clusterRegistrationToken"`
// (Computed) Cluster template answers (list maxitems:1)
ClusterTemplateAnswers GetClusterClusterTemplateAnswers `pulumi:"clusterTemplateAnswers"`
// (Computed) Cluster template ID (string)
ClusterTemplateId string `pulumi:"clusterTemplateId"`
// (Computed) Cluster template questions (list)
ClusterTemplateQuestions []GetClusterClusterTemplateQuestion `pulumi:"clusterTemplateQuestions"`
// (Computed) Cluster template revision ID (string)
ClusterTemplateRevisionId string `pulumi:"clusterTemplateRevisionId"`
// (Optional/Computed) [Default pod security policy template id](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#pod-security-policy-support) (string)
DefaultPodSecurityPolicyTemplateId string `pulumi:"defaultPodSecurityPolicyTemplateId"`
// (Computed) Default project ID for the cluster (string)
DefaultProjectId string `pulumi:"defaultProjectId"`
// (Computed) The description for Cluster (string)
Description string `pulumi:"description"`
// (Computed) The driver used for the Cluster. `imported`, `azurekubernetesservice`, `amazonelasticcontainerservice`, `googlekubernetesengine` and `rancherKubernetesEngine` are supported (string)
Driver string `pulumi:"driver"`
// (Computed) The Amazon eks configuration for `eks` Conflicts with `aksConfig`, `aksConfigV2`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1)
EksConfig GetClusterEksConfig `pulumi:"eksConfig"`
// (Computed) The Amazon EKS V2 configuration to create or import `eks` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `gkeConfig`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig`. For Rancher v2.5.x or above (list maxitems:1)
EksConfigV2 GetClusterEksConfigV2 `pulumi:"eksConfigV2"`
EnableClusterAlerting bool `pulumi:"enableClusterAlerting"`
// (Computed) Enable built-in cluster monitoring. Default `false` (bool)
EnableClusterMonitoring bool `pulumi:"enableClusterMonitoring"`
// (Computed) Enable project network isolation. Default `false` (bool)
EnableNetworkPolicy bool `pulumi:"enableNetworkPolicy"`
// (Computed) Fleet workspace name (string)
FleetWorkspaceName string `pulumi:"fleetWorkspaceName"`
// (Computed) The Google gke configuration for `gke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1) (list maxitems:1)
GkeConfig GetClusterGkeConfig `pulumi:"gkeConfig"`
// (Computed) The Google GKE V2 configuration for `gke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `okeConfig`, `k3sConfig` and `rkeConfig`. For Rancher v2.5.8 or above (list maxitems:1)
GkeConfigV2 GetClusterGkeConfigV2 `pulumi:"gkeConfigV2"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// (Computed) The K3S configuration for `k3s` imported Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig` and `rkeConfig` (list maxitems:1)
K3sConfig GetClusterK3sConfig `pulumi:"k3sConfig"`
// (Computed) Kube Config generated for the cluster (string)
KubeConfig string `pulumi:"kubeConfig"`
// (Computed) Labels for Node Pool object (map)
Labels map[string]interface{} `pulumi:"labels"`
Name string `pulumi:"name"`
// (Computed) The Oracle OKE configuration for `oke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `k3sConfig` and `rkeConfig` (list maxitems:1)
OkeConfig GetClusterOkeConfig `pulumi:"okeConfig"`
// (Computed) The RKE2 configuration for `rke2` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `gkeConfig`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1)
Rke2Config GetClusterRke2Config `pulumi:"rke2Config"`
// (Computed) The RKE configuration for `rke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig` and `k3sConfig` (list maxitems:1)
RkeConfig GetClusterRkeConfig `pulumi:"rkeConfig"`
ScheduledClusterScans []GetClusterScheduledClusterScan `pulumi:"scheduledClusterScans"`
// (Computed) System project ID for the cluster (string)
SystemProjectId string `pulumi:"systemProjectId"`
}
func LookupClusterOutput(ctx *pulumi.Context, args LookupClusterOutputArgs, opts ...pulumi.InvokeOption) LookupClusterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupClusterResult, error) {
args := v.(LookupClusterArgs)
r, err := LookupCluster(ctx, &args, opts...)
var s LookupClusterResult
if r != nil {
s = *r
}
return s, err
}).(LookupClusterResultOutput)
}
// A collection of arguments for invoking getCluster.
type LookupClusterOutputArgs struct {
// The name of the Cluster (string)
Name pulumi.StringInput `pulumi:"name"`
}
func (LookupClusterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupClusterArgs)(nil)).Elem()
}
// A collection of values returned by getCluster.
type LookupClusterResultOutput struct{ *pulumi.OutputState }
func (LookupClusterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupClusterResult)(nil)).Elem()
}
func (o LookupClusterResultOutput) ToLookupClusterResultOutput() LookupClusterResultOutput {
return o
}
func (o LookupClusterResultOutput) ToLookupClusterResultOutputWithContext(ctx context.Context) LookupClusterResultOutput {
return o
}
// (Computed) Optional Agent Env Vars for Rancher agent. Just for Rancher v2.5.6 and above (list)
func (o LookupClusterResultOutput) AgentEnvVars() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupClusterResult) []string { return v.AgentEnvVars }).(pulumi.StringArrayOutput)
}
// (Computed) The Azure aks configuration for `aks` Clusters. Conflicts with `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1)
func (o LookupClusterResultOutput) AksConfig() GetClusterAksConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterAksConfig { return v.AksConfig }).(GetClusterAksConfigOutput)
}
// (Optional) The Azure AKS v2 configuration for creating/import `aks` Clusters. Conflicts with `aksConfig`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig` `k3sConfig` and `rkeConfig` (list maxitems:1)
func (o LookupClusterResultOutput) AksConfigV2() GetClusterAksConfigV2Output {
return o.ApplyT(func(v LookupClusterResult) GetClusterAksConfigV2 { return v.AksConfigV2 }).(GetClusterAksConfigV2Output)
}
// (Computed) Annotations for Node Pool object (map)
func (o LookupClusterResultOutput) Annotations() pulumi.MapOutput {
return o.ApplyT(func(v LookupClusterResult) map[string]interface{} { return v.Annotations }).(pulumi.MapOutput)
}
// (Computed) K8s cluster ca cert (string)
func (o LookupClusterResultOutput) CaCert() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.CaCert }).(pulumi.StringOutput)
}
// (Computed) Enabling the [local cluster authorized endpoint](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#local-cluster-auth-endpoint) allows direct communication with the cluster, bypassing the Rancher API proxy. (list maxitems:1)
func (o LookupClusterResultOutput) ClusterAuthEndpoint() GetClusterClusterAuthEndpointOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterClusterAuthEndpoint { return v.ClusterAuthEndpoint }).(GetClusterClusterAuthEndpointOutput)
}
// (Computed) Cluster monitoring config (list maxitems:1)
func (o LookupClusterResultOutput) ClusterMonitoringInput() GetClusterClusterMonitoringInputOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterClusterMonitoringInput { return v.ClusterMonitoringInput }).(GetClusterClusterMonitoringInputOutput)
}
// (Computed) Cluster Registration Token generated for the cluster (list maxitems:1)
func (o LookupClusterResultOutput) ClusterRegistrationToken() GetClusterClusterRegistrationTokenOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterClusterRegistrationToken { return v.ClusterRegistrationToken }).(GetClusterClusterRegistrationTokenOutput)
}
// (Computed) Cluster template answers (list maxitems:1)
func (o LookupClusterResultOutput) ClusterTemplateAnswers() GetClusterClusterTemplateAnswersOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterClusterTemplateAnswers { return v.ClusterTemplateAnswers }).(GetClusterClusterTemplateAnswersOutput)
}
// (Computed) Cluster template ID (string)
func (o LookupClusterResultOutput) ClusterTemplateId() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterTemplateId }).(pulumi.StringOutput)
}
// (Computed) Cluster template questions (list)
func (o LookupClusterResultOutput) ClusterTemplateQuestions() GetClusterClusterTemplateQuestionArrayOutput {
return o.ApplyT(func(v LookupClusterResult) []GetClusterClusterTemplateQuestion { return v.ClusterTemplateQuestions }).(GetClusterClusterTemplateQuestionArrayOutput)
}
// (Computed) Cluster template revision ID (string)
func (o LookupClusterResultOutput) ClusterTemplateRevisionId() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterTemplateRevisionId }).(pulumi.StringOutput)
}
// (Optional/Computed) [Default pod security policy template id](https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/options/#pod-security-policy-support) (string)
func (o LookupClusterResultOutput) DefaultPodSecurityPolicyTemplateId() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.DefaultPodSecurityPolicyTemplateId }).(pulumi.StringOutput)
}
// (Computed) Default project ID for the cluster (string)
func (o LookupClusterResultOutput) DefaultProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.DefaultProjectId }).(pulumi.StringOutput)
}
// (Computed) The description for Cluster (string)
func (o LookupClusterResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Description }).(pulumi.StringOutput)
}
// (Computed) The driver used for the Cluster. `imported`, `azurekubernetesservice`, `amazonelasticcontainerservice`, `googlekubernetesengine` and `rancherKubernetesEngine` are supported (string)
func (o LookupClusterResultOutput) Driver() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Driver }).(pulumi.StringOutput)
}
// (Computed) The Amazon eks configuration for `eks` Conflicts with `aksConfig`, `aksConfigV2`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1)
func (o LookupClusterResultOutput) EksConfig() GetClusterEksConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterEksConfig { return v.EksConfig }).(GetClusterEksConfigOutput)
}
// (Computed) The Amazon EKS V2 configuration to create or import `eks` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `gkeConfig`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig`. For Rancher v2.5.x or above (list maxitems:1)
func (o LookupClusterResultOutput) EksConfigV2() GetClusterEksConfigV2Output {
return o.ApplyT(func(v LookupClusterResult) GetClusterEksConfigV2 { return v.EksConfigV2 }).(GetClusterEksConfigV2Output)
}
func (o LookupClusterResultOutput) EnableClusterAlerting() pulumi.BoolOutput {
return o.ApplyT(func(v LookupClusterResult) bool { return v.EnableClusterAlerting }).(pulumi.BoolOutput)
}
// (Computed) Enable built-in cluster monitoring. Default `false` (bool)
func (o LookupClusterResultOutput) EnableClusterMonitoring() pulumi.BoolOutput {
return o.ApplyT(func(v LookupClusterResult) bool { return v.EnableClusterMonitoring }).(pulumi.BoolOutput)
}
// (Computed) Enable project network isolation. Default `false` (bool)
func (o LookupClusterResultOutput) EnableNetworkPolicy() pulumi.BoolOutput {
return o.ApplyT(func(v LookupClusterResult) bool { return v.EnableNetworkPolicy }).(pulumi.BoolOutput)
}
// (Computed) Fleet workspace name (string)
func (o LookupClusterResultOutput) FleetWorkspaceName() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.FleetWorkspaceName }).(pulumi.StringOutput)
}
// (Computed) The Google gke configuration for `gke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfigV2`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1) (list maxitems:1)
func (o LookupClusterResultOutput) GkeConfig() GetClusterGkeConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterGkeConfig { return v.GkeConfig }).(GetClusterGkeConfigOutput)
}
// (Computed) The Google GKE V2 configuration for `gke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `okeConfig`, `k3sConfig` and `rkeConfig`. For Rancher v2.5.8 or above (list maxitems:1)
func (o LookupClusterResultOutput) GkeConfigV2() GetClusterGkeConfigV2Output {
return o.ApplyT(func(v LookupClusterResult) GetClusterGkeConfigV2 { return v.GkeConfigV2 }).(GetClusterGkeConfigV2Output)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupClusterResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Id }).(pulumi.StringOutput)
}
// (Computed) The K3S configuration for `k3s` imported Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig` and `rkeConfig` (list maxitems:1)
func (o LookupClusterResultOutput) K3sConfig() GetClusterK3sConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterK3sConfig { return v.K3sConfig }).(GetClusterK3sConfigOutput)
}
// (Computed) Kube Config generated for the cluster (string)
func (o LookupClusterResultOutput) KubeConfig() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.KubeConfig }).(pulumi.StringOutput)
}
// (Computed) Labels for Node Pool object (map)
func (o LookupClusterResultOutput) Labels() pulumi.MapOutput {
return o.ApplyT(func(v LookupClusterResult) map[string]interface{} { return v.Labels }).(pulumi.MapOutput)
}
func (o LookupClusterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Name }).(pulumi.StringOutput)
}
// (Computed) The Oracle OKE configuration for `oke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `k3sConfig` and `rkeConfig` (list maxitems:1)
func (o LookupClusterResultOutput) OkeConfig() GetClusterOkeConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterOkeConfig { return v.OkeConfig }).(GetClusterOkeConfigOutput)
}
// (Computed) The RKE2 configuration for `rke2` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `gkeConfig`, `okeConfig`, `k3sConfig` and `rkeConfig` (list maxitems:1)
func (o LookupClusterResultOutput) Rke2Config() GetClusterRke2ConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterRke2Config { return v.Rke2Config }).(GetClusterRke2ConfigOutput)
}
// (Computed) The RKE configuration for `rke` Clusters. Conflicts with `aksConfig`, `aksConfigV2`, `eksConfig`, `eksConfigV2`, `gkeConfig`, `gkeConfigV2`, `okeConfig` and `k3sConfig` (list maxitems:1)
func (o LookupClusterResultOutput) RkeConfig() GetClusterRkeConfigOutput {
return o.ApplyT(func(v LookupClusterResult) GetClusterRkeConfig { return v.RkeConfig }).(GetClusterRkeConfigOutput)
}
func (o LookupClusterResultOutput) ScheduledClusterScans() GetClusterScheduledClusterScanArrayOutput {
return o.ApplyT(func(v LookupClusterResult) []GetClusterScheduledClusterScan { return v.ScheduledClusterScans }).(GetClusterScheduledClusterScanArrayOutput)
}
// (Computed) System project ID for the cluster (string)
func (o LookupClusterResultOutput) SystemProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.SystemProjectId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupClusterResultOutput{})
}