forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab.go
351 lines (303 loc) · 15.5 KB
/
lab.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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package devtestlab
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A lab.
// Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
//
// Other available API versions: 2016-05-15.
type Lab struct {
pulumi.CustomResourceState
// The properties of any lab announcement associated with this lab
Announcement LabAnnouncementPropertiesResponsePtrOutput `pulumi:"announcement"`
// The lab's artifact storage account.
ArtifactsStorageAccount pulumi.StringOutput `pulumi:"artifactsStorageAccount"`
// The creation date of the lab.
CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
// The lab's default premium storage account.
DefaultPremiumStorageAccount pulumi.StringOutput `pulumi:"defaultPremiumStorageAccount"`
// The lab's default storage account.
DefaultStorageAccount pulumi.StringOutput `pulumi:"defaultStorageAccount"`
// The access rights to be granted to the user when provisioning an environment
EnvironmentPermission pulumi.StringPtrOutput `pulumi:"environmentPermission"`
// Extended properties of the lab used for experimental features
ExtendedProperties pulumi.StringMapOutput `pulumi:"extendedProperties"`
// Type of storage used by the lab. It can be either Premium or Standard. Default is Premium.
LabStorageType pulumi.StringPtrOutput `pulumi:"labStorageType"`
// The load balancer used to for lab VMs that use shared IP address.
LoadBalancerId pulumi.StringOutput `pulumi:"loadBalancerId"`
// The location of the resource.
Location pulumi.StringPtrOutput `pulumi:"location"`
// The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user.
MandatoryArtifactsResourceIdsLinux pulumi.StringArrayOutput `pulumi:"mandatoryArtifactsResourceIdsLinux"`
// The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user.
MandatoryArtifactsResourceIdsWindows pulumi.StringArrayOutput `pulumi:"mandatoryArtifactsResourceIdsWindows"`
// The name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
// The Network Security Group attached to the lab VMs Network interfaces to restrict open ports.
NetworkSecurityGroupId pulumi.StringOutput `pulumi:"networkSecurityGroupId"`
// The lab's premium data disk storage account.
PremiumDataDiskStorageAccount pulumi.StringOutput `pulumi:"premiumDataDiskStorageAccount"`
// The setting to enable usage of premium data disks.
// When its value is 'Enabled', creation of standard or premium data disks is allowed.
// When its value is 'Disabled', only creation of standard data disks is allowed.
PremiumDataDisks pulumi.StringPtrOutput `pulumi:"premiumDataDisks"`
// The provisioning status of the resource.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The public IP address for the lab's load balancer.
PublicIpId pulumi.StringOutput `pulumi:"publicIpId"`
// The properties of any lab support message associated with this lab
Support LabSupportPropertiesResponsePtrOutput `pulumi:"support"`
// The tags of the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
// The unique immutable identifier of a resource (Guid).
UniqueIdentifier pulumi.StringOutput `pulumi:"uniqueIdentifier"`
// The lab's Key vault.
VaultName pulumi.StringOutput `pulumi:"vaultName"`
// The resource group in which all new lab virtual machines will be created. To let DevTest Labs manage resource group creation, set this value to null.
VmCreationResourceGroup pulumi.StringOutput `pulumi:"vmCreationResourceGroup"`
}
// NewLab registers a new resource with the given unique name, arguments, and options.
func NewLab(ctx *pulumi.Context,
name string, args *LabArgs, opts ...pulumi.ResourceOption) (*Lab, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.LabStorageType == nil {
args.LabStorageType = pulumi.StringPtr("Premium")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:devtestlab/v20150521preview:Lab"),
},
{
Type: pulumi.String("azure-native:devtestlab/v20160515:Lab"),
},
{
Type: pulumi.String("azure-native:devtestlab/v20180915:Lab"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource Lab
err := ctx.RegisterResource("azure-native:devtestlab:Lab", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLab gets an existing Lab 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 GetLab(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LabState, opts ...pulumi.ResourceOption) (*Lab, error) {
var resource Lab
err := ctx.ReadResource("azure-native:devtestlab:Lab", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Lab resources.
type labState struct {
}
type LabState struct {
}
func (LabState) ElementType() reflect.Type {
return reflect.TypeOf((*labState)(nil)).Elem()
}
type labArgs struct {
// The properties of any lab announcement associated with this lab
Announcement *LabAnnouncementProperties `pulumi:"announcement"`
// The access rights to be granted to the user when provisioning an environment
EnvironmentPermission *string `pulumi:"environmentPermission"`
// Extended properties of the lab used for experimental features
ExtendedProperties map[string]string `pulumi:"extendedProperties"`
// Type of storage used by the lab. It can be either Premium or Standard. Default is Premium.
LabStorageType *string `pulumi:"labStorageType"`
// The location of the resource.
Location *string `pulumi:"location"`
// The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user.
MandatoryArtifactsResourceIdsLinux []string `pulumi:"mandatoryArtifactsResourceIdsLinux"`
// The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user.
MandatoryArtifactsResourceIdsWindows []string `pulumi:"mandatoryArtifactsResourceIdsWindows"`
// The name of the lab.
Name *string `pulumi:"name"`
// The setting to enable usage of premium data disks.
// When its value is 'Enabled', creation of standard or premium data disks is allowed.
// When its value is 'Disabled', only creation of standard data disks is allowed.
PremiumDataDisks *string `pulumi:"premiumDataDisks"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The properties of any lab support message associated with this lab
Support *LabSupportProperties `pulumi:"support"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Lab resource.
type LabArgs struct {
// The properties of any lab announcement associated with this lab
Announcement LabAnnouncementPropertiesPtrInput
// The access rights to be granted to the user when provisioning an environment
EnvironmentPermission pulumi.StringPtrInput
// Extended properties of the lab used for experimental features
ExtendedProperties pulumi.StringMapInput
// Type of storage used by the lab. It can be either Premium or Standard. Default is Premium.
LabStorageType pulumi.StringPtrInput
// The location of the resource.
Location pulumi.StringPtrInput
// The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user.
MandatoryArtifactsResourceIdsLinux pulumi.StringArrayInput
// The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user.
MandatoryArtifactsResourceIdsWindows pulumi.StringArrayInput
// The name of the lab.
Name pulumi.StringPtrInput
// The setting to enable usage of premium data disks.
// When its value is 'Enabled', creation of standard or premium data disks is allowed.
// When its value is 'Disabled', only creation of standard data disks is allowed.
PremiumDataDisks pulumi.StringPtrInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// The properties of any lab support message associated with this lab
Support LabSupportPropertiesPtrInput
// The tags of the resource.
Tags pulumi.StringMapInput
}
func (LabArgs) ElementType() reflect.Type {
return reflect.TypeOf((*labArgs)(nil)).Elem()
}
type LabInput interface {
pulumi.Input
ToLabOutput() LabOutput
ToLabOutputWithContext(ctx context.Context) LabOutput
}
func (*Lab) ElementType() reflect.Type {
return reflect.TypeOf((**Lab)(nil)).Elem()
}
func (i *Lab) ToLabOutput() LabOutput {
return i.ToLabOutputWithContext(context.Background())
}
func (i *Lab) ToLabOutputWithContext(ctx context.Context) LabOutput {
return pulumi.ToOutputWithContext(ctx, i).(LabOutput)
}
type LabOutput struct{ *pulumi.OutputState }
func (LabOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Lab)(nil)).Elem()
}
func (o LabOutput) ToLabOutput() LabOutput {
return o
}
func (o LabOutput) ToLabOutputWithContext(ctx context.Context) LabOutput {
return o
}
// The properties of any lab announcement associated with this lab
func (o LabOutput) Announcement() LabAnnouncementPropertiesResponsePtrOutput {
return o.ApplyT(func(v *Lab) LabAnnouncementPropertiesResponsePtrOutput { return v.Announcement }).(LabAnnouncementPropertiesResponsePtrOutput)
}
// The lab's artifact storage account.
func (o LabOutput) ArtifactsStorageAccount() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.ArtifactsStorageAccount }).(pulumi.StringOutput)
}
// The creation date of the lab.
func (o LabOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
}
// The lab's default premium storage account.
func (o LabOutput) DefaultPremiumStorageAccount() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.DefaultPremiumStorageAccount }).(pulumi.StringOutput)
}
// The lab's default storage account.
func (o LabOutput) DefaultStorageAccount() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.DefaultStorageAccount }).(pulumi.StringOutput)
}
// The access rights to be granted to the user when provisioning an environment
func (o LabOutput) EnvironmentPermission() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Lab) pulumi.StringPtrOutput { return v.EnvironmentPermission }).(pulumi.StringPtrOutput)
}
// Extended properties of the lab used for experimental features
func (o LabOutput) ExtendedProperties() pulumi.StringMapOutput {
return o.ApplyT(func(v *Lab) pulumi.StringMapOutput { return v.ExtendedProperties }).(pulumi.StringMapOutput)
}
// Type of storage used by the lab. It can be either Premium or Standard. Default is Premium.
func (o LabOutput) LabStorageType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Lab) pulumi.StringPtrOutput { return v.LabStorageType }).(pulumi.StringPtrOutput)
}
// The load balancer used to for lab VMs that use shared IP address.
func (o LabOutput) LoadBalancerId() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.LoadBalancerId }).(pulumi.StringOutput)
}
// The location of the resource.
func (o LabOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Lab) pulumi.StringPtrOutput { return v.Location }).(pulumi.StringPtrOutput)
}
// The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user.
func (o LabOutput) MandatoryArtifactsResourceIdsLinux() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Lab) pulumi.StringArrayOutput { return v.MandatoryArtifactsResourceIdsLinux }).(pulumi.StringArrayOutput)
}
// The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user.
func (o LabOutput) MandatoryArtifactsResourceIdsWindows() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Lab) pulumi.StringArrayOutput { return v.MandatoryArtifactsResourceIdsWindows }).(pulumi.StringArrayOutput)
}
// The name of the resource.
func (o LabOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The Network Security Group attached to the lab VMs Network interfaces to restrict open ports.
func (o LabOutput) NetworkSecurityGroupId() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.NetworkSecurityGroupId }).(pulumi.StringOutput)
}
// The lab's premium data disk storage account.
func (o LabOutput) PremiumDataDiskStorageAccount() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.PremiumDataDiskStorageAccount }).(pulumi.StringOutput)
}
// The setting to enable usage of premium data disks.
// When its value is 'Enabled', creation of standard or premium data disks is allowed.
// When its value is 'Disabled', only creation of standard data disks is allowed.
func (o LabOutput) PremiumDataDisks() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Lab) pulumi.StringPtrOutput { return v.PremiumDataDisks }).(pulumi.StringPtrOutput)
}
// The provisioning status of the resource.
func (o LabOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.ProvisioningState }).(pulumi.StringOutput)
}
// The public IP address for the lab's load balancer.
func (o LabOutput) PublicIpId() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.PublicIpId }).(pulumi.StringOutput)
}
// The properties of any lab support message associated with this lab
func (o LabOutput) Support() LabSupportPropertiesResponsePtrOutput {
return o.ApplyT(func(v *Lab) LabSupportPropertiesResponsePtrOutput { return v.Support }).(LabSupportPropertiesResponsePtrOutput)
}
// The tags of the resource.
func (o LabOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Lab) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of the resource.
func (o LabOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// The unique immutable identifier of a resource (Guid).
func (o LabOutput) UniqueIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.UniqueIdentifier }).(pulumi.StringOutput)
}
// The lab's Key vault.
func (o LabOutput) VaultName() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.VaultName }).(pulumi.StringOutput)
}
// The resource group in which all new lab virtual machines will be created. To let DevTest Labs manage resource group creation, set this value to null.
func (o LabOutput) VmCreationResourceGroup() pulumi.StringOutput {
return o.ApplyT(func(v *Lab) pulumi.StringOutput { return v.VmCreationResourceGroup }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LabOutput{})
}