This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
virtualMachineScaleSet.go
316 lines (292 loc) · 15.4 KB
/
virtualMachineScaleSet.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20180401
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Describes a Virtual Machine Scale Set.
type VirtualMachineScaleSet struct {
pulumi.CustomResourceState
// The identity of the virtual machine scale set, if configured.
Identity VirtualMachineScaleSetIdentityResponsePtrOutput `pulumi:"identity"`
// Resource location
Location pulumi.StringOutput `pulumi:"location"`
// Resource name
Name pulumi.StringOutput `pulumi:"name"`
// Specifies whether the Virtual Machine Scale Set should be overprovisioned.
Overprovision pulumi.BoolPtrOutput `pulumi:"overprovision"`
// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan PlanResponsePtrOutput `pulumi:"plan"`
// Fault Domain count for each placement group.
PlatformFaultDomainCount pulumi.IntPtrOutput `pulumi:"platformFaultDomainCount"`
// The provisioning state, which only appears in the response.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01.
ProximityPlacementGroup SubResourceResponsePtrOutput `pulumi:"proximityPlacementGroup"`
// When true this limits the scale set to a single placement group, of max size 100 virtual machines.
SinglePlacementGroup pulumi.BoolPtrOutput `pulumi:"singlePlacementGroup"`
// The virtual machine scale set sku.
Sku SkuResponsePtrOutput `pulumi:"sku"`
// Resource tags
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Resource type
Type pulumi.StringOutput `pulumi:"type"`
// Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
UniqueId pulumi.StringOutput `pulumi:"uniqueId"`
// The upgrade policy.
UpgradePolicy UpgradePolicyResponsePtrOutput `pulumi:"upgradePolicy"`
// The virtual machine profile.
VirtualMachineProfile VirtualMachineScaleSetVMProfileResponsePtrOutput `pulumi:"virtualMachineProfile"`
// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.
ZoneBalance pulumi.BoolPtrOutput `pulumi:"zoneBalance"`
// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set.
Zones pulumi.StringArrayOutput `pulumi:"zones"`
}
// NewVirtualMachineScaleSet registers a new resource with the given unique name, arguments, and options.
func NewVirtualMachineScaleSet(ctx *pulumi.Context,
name string, args *VirtualMachineScaleSetArgs, opts ...pulumi.ResourceOption) (*VirtualMachineScaleSet, 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.VmScaleSetName == nil {
return nil, errors.New("invalid value for required argument 'VmScaleSetName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:compute/latest:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20150615:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20160330:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20160430preview:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20170330:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20171201:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20180601:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20181001:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20190301:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20190701:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20191201:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20200601:VirtualMachineScaleSet"),
},
{
Type: pulumi.String("azure-nextgen:compute/v20201201:VirtualMachineScaleSet"),
},
})
opts = append(opts, aliases)
var resource VirtualMachineScaleSet
err := ctx.RegisterResource("azure-nextgen:compute/v20180401:VirtualMachineScaleSet", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetVirtualMachineScaleSet gets an existing VirtualMachineScaleSet 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 GetVirtualMachineScaleSet(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *VirtualMachineScaleSetState, opts ...pulumi.ResourceOption) (*VirtualMachineScaleSet, error) {
var resource VirtualMachineScaleSet
err := ctx.ReadResource("azure-nextgen:compute/v20180401:VirtualMachineScaleSet", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering VirtualMachineScaleSet resources.
type virtualMachineScaleSetState struct {
// The identity of the virtual machine scale set, if configured.
Identity *VirtualMachineScaleSetIdentityResponse `pulumi:"identity"`
// Resource location
Location *string `pulumi:"location"`
// Resource name
Name *string `pulumi:"name"`
// Specifies whether the Virtual Machine Scale Set should be overprovisioned.
Overprovision *bool `pulumi:"overprovision"`
// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan *PlanResponse `pulumi:"plan"`
// Fault Domain count for each placement group.
PlatformFaultDomainCount *int `pulumi:"platformFaultDomainCount"`
// The provisioning state, which only appears in the response.
ProvisioningState *string `pulumi:"provisioningState"`
// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01.
ProximityPlacementGroup *SubResourceResponse `pulumi:"proximityPlacementGroup"`
// When true this limits the scale set to a single placement group, of max size 100 virtual machines.
SinglePlacementGroup *bool `pulumi:"singlePlacementGroup"`
// The virtual machine scale set sku.
Sku *SkuResponse `pulumi:"sku"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// Resource type
Type *string `pulumi:"type"`
// Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
UniqueId *string `pulumi:"uniqueId"`
// The upgrade policy.
UpgradePolicy *UpgradePolicyResponse `pulumi:"upgradePolicy"`
// The virtual machine profile.
VirtualMachineProfile *VirtualMachineScaleSetVMProfileResponse `pulumi:"virtualMachineProfile"`
// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.
ZoneBalance *bool `pulumi:"zoneBalance"`
// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set.
Zones []string `pulumi:"zones"`
}
type VirtualMachineScaleSetState struct {
// The identity of the virtual machine scale set, if configured.
Identity VirtualMachineScaleSetIdentityResponsePtrInput
// Resource location
Location pulumi.StringPtrInput
// Resource name
Name pulumi.StringPtrInput
// Specifies whether the Virtual Machine Scale Set should be overprovisioned.
Overprovision pulumi.BoolPtrInput
// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan PlanResponsePtrInput
// Fault Domain count for each placement group.
PlatformFaultDomainCount pulumi.IntPtrInput
// The provisioning state, which only appears in the response.
ProvisioningState pulumi.StringPtrInput
// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01.
ProximityPlacementGroup SubResourceResponsePtrInput
// When true this limits the scale set to a single placement group, of max size 100 virtual machines.
SinglePlacementGroup pulumi.BoolPtrInput
// The virtual machine scale set sku.
Sku SkuResponsePtrInput
// Resource tags
Tags pulumi.StringMapInput
// Resource type
Type pulumi.StringPtrInput
// Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
UniqueId pulumi.StringPtrInput
// The upgrade policy.
UpgradePolicy UpgradePolicyResponsePtrInput
// The virtual machine profile.
VirtualMachineProfile VirtualMachineScaleSetVMProfileResponsePtrInput
// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.
ZoneBalance pulumi.BoolPtrInput
// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set.
Zones pulumi.StringArrayInput
}
func (VirtualMachineScaleSetState) ElementType() reflect.Type {
return reflect.TypeOf((*virtualMachineScaleSetState)(nil)).Elem()
}
type virtualMachineScaleSetArgs struct {
// The identity of the virtual machine scale set, if configured.
Identity *VirtualMachineScaleSetIdentity `pulumi:"identity"`
// Resource location
Location *string `pulumi:"location"`
// Specifies whether the Virtual Machine Scale Set should be overprovisioned.
Overprovision *bool `pulumi:"overprovision"`
// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan *Plan `pulumi:"plan"`
// Fault Domain count for each placement group.
PlatformFaultDomainCount *int `pulumi:"platformFaultDomainCount"`
// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01.
ProximityPlacementGroup *SubResource `pulumi:"proximityPlacementGroup"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// When true this limits the scale set to a single placement group, of max size 100 virtual machines.
SinglePlacementGroup *bool `pulumi:"singlePlacementGroup"`
// The virtual machine scale set sku.
Sku *Sku `pulumi:"sku"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// The upgrade policy.
UpgradePolicy *UpgradePolicy `pulumi:"upgradePolicy"`
// The virtual machine profile.
VirtualMachineProfile *VirtualMachineScaleSetVMProfile `pulumi:"virtualMachineProfile"`
// The name of the VM scale set to create or update.
VmScaleSetName string `pulumi:"vmScaleSetName"`
// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.
ZoneBalance *bool `pulumi:"zoneBalance"`
// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set.
Zones []string `pulumi:"zones"`
}
// The set of arguments for constructing a VirtualMachineScaleSet resource.
type VirtualMachineScaleSetArgs struct {
// The identity of the virtual machine scale set, if configured.
Identity VirtualMachineScaleSetIdentityPtrInput
// Resource location
Location pulumi.StringPtrInput
// Specifies whether the Virtual Machine Scale Set should be overprovisioned.
Overprovision pulumi.BoolPtrInput
// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
Plan PlanPtrInput
// Fault Domain count for each placement group.
PlatformFaultDomainCount pulumi.IntPtrInput
// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. <br><br>Minimum api-version: 2018-04-01.
ProximityPlacementGroup SubResourcePtrInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// When true this limits the scale set to a single placement group, of max size 100 virtual machines.
SinglePlacementGroup pulumi.BoolPtrInput
// The virtual machine scale set sku.
Sku SkuPtrInput
// Resource tags
Tags pulumi.StringMapInput
// The upgrade policy.
UpgradePolicy UpgradePolicyPtrInput
// The virtual machine profile.
VirtualMachineProfile VirtualMachineScaleSetVMProfilePtrInput
// The name of the VM scale set to create or update.
VmScaleSetName pulumi.StringInput
// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.
ZoneBalance pulumi.BoolPtrInput
// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set.
Zones pulumi.StringArrayInput
}
func (VirtualMachineScaleSetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*virtualMachineScaleSetArgs)(nil)).Elem()
}
type VirtualMachineScaleSetInput interface {
pulumi.Input
ToVirtualMachineScaleSetOutput() VirtualMachineScaleSetOutput
ToVirtualMachineScaleSetOutputWithContext(ctx context.Context) VirtualMachineScaleSetOutput
}
func (*VirtualMachineScaleSet) ElementType() reflect.Type {
return reflect.TypeOf((*VirtualMachineScaleSet)(nil))
}
func (i *VirtualMachineScaleSet) ToVirtualMachineScaleSetOutput() VirtualMachineScaleSetOutput {
return i.ToVirtualMachineScaleSetOutputWithContext(context.Background())
}
func (i *VirtualMachineScaleSet) ToVirtualMachineScaleSetOutputWithContext(ctx context.Context) VirtualMachineScaleSetOutput {
return pulumi.ToOutputWithContext(ctx, i).(VirtualMachineScaleSetOutput)
}
type VirtualMachineScaleSetOutput struct {
*pulumi.OutputState
}
func (VirtualMachineScaleSetOutput) ElementType() reflect.Type {
return reflect.TypeOf((*VirtualMachineScaleSet)(nil))
}
func (o VirtualMachineScaleSetOutput) ToVirtualMachineScaleSetOutput() VirtualMachineScaleSetOutput {
return o
}
func (o VirtualMachineScaleSetOutput) ToVirtualMachineScaleSetOutputWithContext(ctx context.Context) VirtualMachineScaleSetOutput {
return o
}
func init() {
pulumi.RegisterOutputType(VirtualMachineScaleSetOutput{})
}