-
Notifications
You must be signed in to change notification settings - Fork 51
/
cluster.go
261 lines (248 loc) · 11.7 KB
/
cluster.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package kusto
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages a Kusto (also known as Azure Data Explorer) Cluster
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/kusto"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
// Location: pulumi.String("East US"),
// })
// if err != nil {
// return err
// }
// _, err = kusto.NewCluster(ctx, "example", &kusto.ClusterArgs{
// Location: rg.Location,
// ResourceGroupName: rg.Name,
// Sku: &kusto.ClusterSkuArgs{
// Name: pulumi.String("Standard_D13_v2"),
// Capacity: pulumi.Int(2),
// },
// Tags: pulumi.StringMap{
// "Environment": pulumi.String("Production"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type Cluster struct {
pulumi.CustomResourceState
// The Kusto Cluster URI to be used for data ingestion.
DataIngestionUri pulumi.StringOutput `pulumi:"dataIngestionUri"`
// Specifies if the cluster's disks are encrypted.
EnableDiskEncryption pulumi.BoolPtrOutput `pulumi:"enableDiskEncryption"`
// Specifies if the purge operations are enabled.
EnablePurge pulumi.BoolPtrOutput `pulumi:"enablePurge"`
// Specifies if the streaming ingest is enabled.
EnableStreamingIngest pulumi.BoolPtrOutput `pulumi:"enableStreamingIngest"`
// A identity block.
Identity ClusterIdentityOutput `pulumi:"identity"`
// An list of `languageExtensions` to enable. Valid values are: `PYTHON` and `R`.
LanguageExtensions pulumi.StringArrayOutput `pulumi:"languageExtensions"`
// The location where the Kusto Cluster should be created. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The name of the Kusto Cluster to create. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// An `optimizedAutoScale` block as defined below.
OptimizedAutoScale ClusterOptimizedAutoScalePtrOutput `pulumi:"optimizedAutoScale"`
// Specifies the Resource Group where the Kusto Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `sku` block as defined below.
Sku ClusterSkuOutput `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Specifies a list of tenant IDs that are trusted by the cluster.
TrustedExternalTenants pulumi.StringArrayOutput `pulumi:"trustedExternalTenants"`
// The FQDN of the Azure Kusto Cluster.
Uri pulumi.StringOutput `pulumi:"uri"`
// A `virtualNetworkConfiguration` block as defined below.
VirtualNetworkConfiguration ClusterVirtualNetworkConfigurationPtrOutput `pulumi:"virtualNetworkConfiguration"`
// A list of Availability Zones in which the cluster instances should be created in. Changing this forces a new resource to be created.
Zones pulumi.StringArrayOutput `pulumi:"zones"`
}
// NewCluster registers a new resource with the given unique name, arguments, and options.
func NewCluster(ctx *pulumi.Context,
name string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Sku == nil {
return nil, errors.New("missing required argument 'Sku'")
}
if args == nil {
args = &ClusterArgs{}
}
var resource Cluster
err := ctx.RegisterResource("azure:kusto/cluster:Cluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCluster gets an existing Cluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ClusterState, opts ...pulumi.ResourceOption) (*Cluster, error) {
var resource Cluster
err := ctx.ReadResource("azure:kusto/cluster:Cluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Cluster resources.
type clusterState struct {
// The Kusto Cluster URI to be used for data ingestion.
DataIngestionUri *string `pulumi:"dataIngestionUri"`
// Specifies if the cluster's disks are encrypted.
EnableDiskEncryption *bool `pulumi:"enableDiskEncryption"`
// Specifies if the purge operations are enabled.
EnablePurge *bool `pulumi:"enablePurge"`
// Specifies if the streaming ingest is enabled.
EnableStreamingIngest *bool `pulumi:"enableStreamingIngest"`
// A identity block.
Identity *ClusterIdentity `pulumi:"identity"`
// An list of `languageExtensions` to enable. Valid values are: `PYTHON` and `R`.
LanguageExtensions []string `pulumi:"languageExtensions"`
// The location where the Kusto Cluster should be created. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The name of the Kusto Cluster to create. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// An `optimizedAutoScale` block as defined below.
OptimizedAutoScale *ClusterOptimizedAutoScale `pulumi:"optimizedAutoScale"`
// Specifies the Resource Group where the Kusto Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A `sku` block as defined below.
Sku *ClusterSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Specifies a list of tenant IDs that are trusted by the cluster.
TrustedExternalTenants []string `pulumi:"trustedExternalTenants"`
// The FQDN of the Azure Kusto Cluster.
Uri *string `pulumi:"uri"`
// A `virtualNetworkConfiguration` block as defined below.
VirtualNetworkConfiguration *ClusterVirtualNetworkConfiguration `pulumi:"virtualNetworkConfiguration"`
// A list of Availability Zones in which the cluster instances should be created in. Changing this forces a new resource to be created.
Zones []string `pulumi:"zones"`
}
type ClusterState struct {
// The Kusto Cluster URI to be used for data ingestion.
DataIngestionUri pulumi.StringPtrInput
// Specifies if the cluster's disks are encrypted.
EnableDiskEncryption pulumi.BoolPtrInput
// Specifies if the purge operations are enabled.
EnablePurge pulumi.BoolPtrInput
// Specifies if the streaming ingest is enabled.
EnableStreamingIngest pulumi.BoolPtrInput
// A identity block.
Identity ClusterIdentityPtrInput
// An list of `languageExtensions` to enable. Valid values are: `PYTHON` and `R`.
LanguageExtensions pulumi.StringArrayInput
// The location where the Kusto Cluster should be created. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The name of the Kusto Cluster to create. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// An `optimizedAutoScale` block as defined below.
OptimizedAutoScale ClusterOptimizedAutoScalePtrInput
// Specifies the Resource Group where the Kusto Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A `sku` block as defined below.
Sku ClusterSkuPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Specifies a list of tenant IDs that are trusted by the cluster.
TrustedExternalTenants pulumi.StringArrayInput
// The FQDN of the Azure Kusto Cluster.
Uri pulumi.StringPtrInput
// A `virtualNetworkConfiguration` block as defined below.
VirtualNetworkConfiguration ClusterVirtualNetworkConfigurationPtrInput
// A list of Availability Zones in which the cluster instances should be created in. Changing this forces a new resource to be created.
Zones pulumi.StringArrayInput
}
func (ClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*clusterState)(nil)).Elem()
}
type clusterArgs struct {
// Specifies if the cluster's disks are encrypted.
EnableDiskEncryption *bool `pulumi:"enableDiskEncryption"`
// Specifies if the purge operations are enabled.
EnablePurge *bool `pulumi:"enablePurge"`
// Specifies if the streaming ingest is enabled.
EnableStreamingIngest *bool `pulumi:"enableStreamingIngest"`
// A identity block.
Identity *ClusterIdentity `pulumi:"identity"`
// An list of `languageExtensions` to enable. Valid values are: `PYTHON` and `R`.
LanguageExtensions []string `pulumi:"languageExtensions"`
// The location where the Kusto Cluster should be created. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The name of the Kusto Cluster to create. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// An `optimizedAutoScale` block as defined below.
OptimizedAutoScale *ClusterOptimizedAutoScale `pulumi:"optimizedAutoScale"`
// Specifies the Resource Group where the Kusto Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A `sku` block as defined below.
Sku ClusterSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
// Specifies a list of tenant IDs that are trusted by the cluster.
TrustedExternalTenants []string `pulumi:"trustedExternalTenants"`
// A `virtualNetworkConfiguration` block as defined below.
VirtualNetworkConfiguration *ClusterVirtualNetworkConfiguration `pulumi:"virtualNetworkConfiguration"`
// A list of Availability Zones in which the cluster instances should be created in. Changing this forces a new resource to be created.
Zones []string `pulumi:"zones"`
}
// The set of arguments for constructing a Cluster resource.
type ClusterArgs struct {
// Specifies if the cluster's disks are encrypted.
EnableDiskEncryption pulumi.BoolPtrInput
// Specifies if the purge operations are enabled.
EnablePurge pulumi.BoolPtrInput
// Specifies if the streaming ingest is enabled.
EnableStreamingIngest pulumi.BoolPtrInput
// A identity block.
Identity ClusterIdentityPtrInput
// An list of `languageExtensions` to enable. Valid values are: `PYTHON` and `R`.
LanguageExtensions pulumi.StringArrayInput
// The location where the Kusto Cluster should be created. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The name of the Kusto Cluster to create. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// An `optimizedAutoScale` block as defined below.
OptimizedAutoScale ClusterOptimizedAutoScalePtrInput
// Specifies the Resource Group where the Kusto Cluster should exist. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A `sku` block as defined below.
Sku ClusterSkuInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
// Specifies a list of tenant IDs that are trusted by the cluster.
TrustedExternalTenants pulumi.StringArrayInput
// A `virtualNetworkConfiguration` block as defined below.
VirtualNetworkConfiguration ClusterVirtualNetworkConfigurationPtrInput
// A list of Availability Zones in which the cluster instances should be created in. Changing this forces a new resource to be created.
Zones pulumi.StringArrayInput
}
func (ClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*clusterArgs)(nil)).Elem()
}