/
getKubernetesCluster.go
217 lines (183 loc) · 10.2 KB
/
getKubernetesCluster.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
// 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 digitalocean
import (
"context"
"reflect"
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Retrieves information about a DigitalOcean Kubernetes cluster for use in other resources. This data source provides all of the cluster's properties as configured on your DigitalOcean account. This is useful if the cluster in question is not managed by the provider.
func LookupKubernetesCluster(ctx *pulumi.Context, args *LookupKubernetesClusterArgs, opts ...pulumi.InvokeOption) (*LookupKubernetesClusterResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupKubernetesClusterResult
err := ctx.Invoke("digitalocean:index/getKubernetesCluster:getKubernetesCluster", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getKubernetesCluster.
type LookupKubernetesClusterArgs struct {
// The name of Kubernetes cluster.
Name string `pulumi:"name"`
// A list of tag names applied to the node pool.
Tags []string `pulumi:"tags"`
}
// A collection of values returned by getKubernetesCluster.
type LookupKubernetesClusterResult struct {
// A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window.
AutoUpgrade bool `pulumi:"autoUpgrade"`
// The range of IP addresses in the overlay network of the Kubernetes cluster.
ClusterSubnet string `pulumi:"clusterSubnet"`
// The date and time when the node was created.
CreatedAt string `pulumi:"createdAt"`
// The base URL of the API server on the Kubernetes master node.
Endpoint string `pulumi:"endpoint"`
Ha bool `pulumi:"ha"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The public IPv4 address of the Kubernetes master node.
Ipv4Address string `pulumi:"ipv4Address"`
// A representation of the Kubernetes cluster's kubeconfig with the following attributes:
KubeConfigs []GetKubernetesClusterKubeConfig `pulumi:"kubeConfigs"`
// The maintenance policy of the Kubernetes cluster. Digital Ocean has a default maintenancen window.
MaintenancePolicies []GetKubernetesClusterMaintenancePolicy `pulumi:"maintenancePolicies"`
// The auto-generated name for the node.
Name string `pulumi:"name"`
// A list of node pools associated with the cluster. Each node pool exports the following attributes:
NodePools []GetKubernetesClusterNodePool `pulumi:"nodePools"`
// The slug identifier for the region where the Kubernetes cluster is located.
Region string `pulumi:"region"`
// The range of assignable IP addresses for services running in the Kubernetes cluster.
ServiceSubnet string `pulumi:"serviceSubnet"`
// A string indicating the current status of the individual node.
Status string `pulumi:"status"`
SurgeUpgrade bool `pulumi:"surgeUpgrade"`
// A list of tag names applied to the node pool.
Tags []string `pulumi:"tags"`
// The date and time when the node was last updated.
UpdatedAt string `pulumi:"updatedAt"`
// The uniform resource name (URN) for the Kubernetes cluster.
Urn string `pulumi:"urn"`
// The slug identifier for the version of Kubernetes used for the cluster.
Version string `pulumi:"version"`
// The ID of the VPC where the Kubernetes cluster is located.
VpcUuid string `pulumi:"vpcUuid"`
}
func LookupKubernetesClusterOutput(ctx *pulumi.Context, args LookupKubernetesClusterOutputArgs, opts ...pulumi.InvokeOption) LookupKubernetesClusterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupKubernetesClusterResult, error) {
args := v.(LookupKubernetesClusterArgs)
r, err := LookupKubernetesCluster(ctx, &args, opts...)
var s LookupKubernetesClusterResult
if r != nil {
s = *r
}
return s, err
}).(LookupKubernetesClusterResultOutput)
}
// A collection of arguments for invoking getKubernetesCluster.
type LookupKubernetesClusterOutputArgs struct {
// The name of Kubernetes cluster.
Name pulumi.StringInput `pulumi:"name"`
// A list of tag names applied to the node pool.
Tags pulumi.StringArrayInput `pulumi:"tags"`
}
func (LookupKubernetesClusterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupKubernetesClusterArgs)(nil)).Elem()
}
// A collection of values returned by getKubernetesCluster.
type LookupKubernetesClusterResultOutput struct{ *pulumi.OutputState }
func (LookupKubernetesClusterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupKubernetesClusterResult)(nil)).Elem()
}
func (o LookupKubernetesClusterResultOutput) ToLookupKubernetesClusterResultOutput() LookupKubernetesClusterResultOutput {
return o
}
func (o LookupKubernetesClusterResultOutput) ToLookupKubernetesClusterResultOutputWithContext(ctx context.Context) LookupKubernetesClusterResultOutput {
return o
}
// A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window.
func (o LookupKubernetesClusterResultOutput) AutoUpgrade() pulumi.BoolOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) bool { return v.AutoUpgrade }).(pulumi.BoolOutput)
}
// The range of IP addresses in the overlay network of the Kubernetes cluster.
func (o LookupKubernetesClusterResultOutput) ClusterSubnet() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.ClusterSubnet }).(pulumi.StringOutput)
}
// The date and time when the node was created.
func (o LookupKubernetesClusterResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// The base URL of the API server on the Kubernetes master node.
func (o LookupKubernetesClusterResultOutput) Endpoint() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Endpoint }).(pulumi.StringOutput)
}
func (o LookupKubernetesClusterResultOutput) Ha() pulumi.BoolOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) bool { return v.Ha }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupKubernetesClusterResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Id }).(pulumi.StringOutput)
}
// The public IPv4 address of the Kubernetes master node.
func (o LookupKubernetesClusterResultOutput) Ipv4Address() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Ipv4Address }).(pulumi.StringOutput)
}
// A representation of the Kubernetes cluster's kubeconfig with the following attributes:
func (o LookupKubernetesClusterResultOutput) KubeConfigs() GetKubernetesClusterKubeConfigArrayOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) []GetKubernetesClusterKubeConfig { return v.KubeConfigs }).(GetKubernetesClusterKubeConfigArrayOutput)
}
// The maintenance policy of the Kubernetes cluster. Digital Ocean has a default maintenancen window.
func (o LookupKubernetesClusterResultOutput) MaintenancePolicies() GetKubernetesClusterMaintenancePolicyArrayOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) []GetKubernetesClusterMaintenancePolicy {
return v.MaintenancePolicies
}).(GetKubernetesClusterMaintenancePolicyArrayOutput)
}
// The auto-generated name for the node.
func (o LookupKubernetesClusterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Name }).(pulumi.StringOutput)
}
// A list of node pools associated with the cluster. Each node pool exports the following attributes:
func (o LookupKubernetesClusterResultOutput) NodePools() GetKubernetesClusterNodePoolArrayOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) []GetKubernetesClusterNodePool { return v.NodePools }).(GetKubernetesClusterNodePoolArrayOutput)
}
// The slug identifier for the region where the Kubernetes cluster is located.
func (o LookupKubernetesClusterResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Region }).(pulumi.StringOutput)
}
// The range of assignable IP addresses for services running in the Kubernetes cluster.
func (o LookupKubernetesClusterResultOutput) ServiceSubnet() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.ServiceSubnet }).(pulumi.StringOutput)
}
// A string indicating the current status of the individual node.
func (o LookupKubernetesClusterResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Status }).(pulumi.StringOutput)
}
func (o LookupKubernetesClusterResultOutput) SurgeUpgrade() pulumi.BoolOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) bool { return v.SurgeUpgrade }).(pulumi.BoolOutput)
}
// A list of tag names applied to the node pool.
func (o LookupKubernetesClusterResultOutput) Tags() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) []string { return v.Tags }).(pulumi.StringArrayOutput)
}
// The date and time when the node was last updated.
func (o LookupKubernetesClusterResultOutput) UpdatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.UpdatedAt }).(pulumi.StringOutput)
}
// The uniform resource name (URN) for the Kubernetes cluster.
func (o LookupKubernetesClusterResultOutput) Urn() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Urn }).(pulumi.StringOutput)
}
// The slug identifier for the version of Kubernetes used for the cluster.
func (o LookupKubernetesClusterResultOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.Version }).(pulumi.StringOutput)
}
// The ID of the VPC where the Kubernetes cluster is located.
func (o LookupKubernetesClusterResultOutput) VpcUuid() pulumi.StringOutput {
return o.ApplyT(func(v LookupKubernetesClusterResult) string { return v.VpcUuid }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupKubernetesClusterResultOutput{})
}