-
Notifications
You must be signed in to change notification settings - Fork 51
/
pool.go
235 lines (222 loc) · 12.9 KB
/
pool.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
// *** 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 batch
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages an Azure Batch pool.
type Pool struct {
pulumi.CustomResourceState
// Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.
AccountName pulumi.StringOutput `pulumi:"accountName"`
// A `autoScale` block that describes the scale settings when using auto scale.
AutoScale PoolAutoScalePtrOutput `pulumi:"autoScale"`
// One or more `certificate` blocks that describe the certificates to be installed on each compute node in the pool.
Certificates PoolCertificateArrayOutput `pulumi:"certificates"`
// The container configuration used in the pool's VMs.
ContainerConfiguration PoolContainerConfigurationPtrOutput `pulumi:"containerConfiguration"`
// Specifies the display name of the Batch pool.
DisplayName pulumi.StringPtrOutput `pulumi:"displayName"`
// A `fixedScale` block that describes the scale settings when using fixed scale.
FixedScale PoolFixedScalePtrOutput `pulumi:"fixedScale"`
// Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to `1`. Changing this forces a new resource to be created.
MaxTasksPerNode pulumi.IntPtrOutput `pulumi:"maxTasksPerNode"`
// A map of custom batch pool metadata.
Metadata pulumi.StringMapOutput `pulumi:"metadata"`
// Specifies the name of the Batch pool. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// A `networkConfiguration` block that describes the network configurations for the Batch pool.
NetworkConfiguration PoolNetworkConfigurationPtrOutput `pulumi:"networkConfiguration"`
// Specifies the Sku of the node agents that will be created in the Batch pool.
NodeAgentSkuId pulumi.StringOutput `pulumi:"nodeAgentSkuId"`
// The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `startTask` block that describes the start task settings for the Batch pool.
StartTask PoolStartTaskPtrOutput `pulumi:"startTask"`
StopPendingResizeOperation pulumi.BoolPtrOutput `pulumi:"stopPendingResizeOperation"`
// A `storageImageReference` for the virtual machines that will compose the Batch pool.
StorageImageReference PoolStorageImageReferenceOutput `pulumi:"storageImageReference"`
// Specifies the size of the VM created in the Batch pool.
VmSize pulumi.StringOutput `pulumi:"vmSize"`
}
// NewPool registers a new resource with the given unique name, arguments, and options.
func NewPool(ctx *pulumi.Context,
name string, args *PoolArgs, opts ...pulumi.ResourceOption) (*Pool, error) {
if args == nil || args.AccountName == nil {
return nil, errors.New("missing required argument 'AccountName'")
}
if args == nil || args.NodeAgentSkuId == nil {
return nil, errors.New("missing required argument 'NodeAgentSkuId'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.StorageImageReference == nil {
return nil, errors.New("missing required argument 'StorageImageReference'")
}
if args == nil || args.VmSize == nil {
return nil, errors.New("missing required argument 'VmSize'")
}
if args == nil {
args = &PoolArgs{}
}
var resource Pool
err := ctx.RegisterResource("azure:batch/pool:Pool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPool gets an existing Pool 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 GetPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PoolState, opts ...pulumi.ResourceOption) (*Pool, error) {
var resource Pool
err := ctx.ReadResource("azure:batch/pool:Pool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Pool resources.
type poolState struct {
// Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.
AccountName *string `pulumi:"accountName"`
// A `autoScale` block that describes the scale settings when using auto scale.
AutoScale *PoolAutoScale `pulumi:"autoScale"`
// One or more `certificate` blocks that describe the certificates to be installed on each compute node in the pool.
Certificates []PoolCertificate `pulumi:"certificates"`
// The container configuration used in the pool's VMs.
ContainerConfiguration *PoolContainerConfiguration `pulumi:"containerConfiguration"`
// Specifies the display name of the Batch pool.
DisplayName *string `pulumi:"displayName"`
// A `fixedScale` block that describes the scale settings when using fixed scale.
FixedScale *PoolFixedScale `pulumi:"fixedScale"`
// Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to `1`. Changing this forces a new resource to be created.
MaxTasksPerNode *int `pulumi:"maxTasksPerNode"`
// A map of custom batch pool metadata.
Metadata map[string]string `pulumi:"metadata"`
// Specifies the name of the Batch pool. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `networkConfiguration` block that describes the network configurations for the Batch pool.
NetworkConfiguration *PoolNetworkConfiguration `pulumi:"networkConfiguration"`
// Specifies the Sku of the node agents that will be created in the Batch pool.
NodeAgentSkuId *string `pulumi:"nodeAgentSkuId"`
// The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A `startTask` block that describes the start task settings for the Batch pool.
StartTask *PoolStartTask `pulumi:"startTask"`
StopPendingResizeOperation *bool `pulumi:"stopPendingResizeOperation"`
// A `storageImageReference` for the virtual machines that will compose the Batch pool.
StorageImageReference *PoolStorageImageReference `pulumi:"storageImageReference"`
// Specifies the size of the VM created in the Batch pool.
VmSize *string `pulumi:"vmSize"`
}
type PoolState struct {
// Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.
AccountName pulumi.StringPtrInput
// A `autoScale` block that describes the scale settings when using auto scale.
AutoScale PoolAutoScalePtrInput
// One or more `certificate` blocks that describe the certificates to be installed on each compute node in the pool.
Certificates PoolCertificateArrayInput
// The container configuration used in the pool's VMs.
ContainerConfiguration PoolContainerConfigurationPtrInput
// Specifies the display name of the Batch pool.
DisplayName pulumi.StringPtrInput
// A `fixedScale` block that describes the scale settings when using fixed scale.
FixedScale PoolFixedScalePtrInput
// Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to `1`. Changing this forces a new resource to be created.
MaxTasksPerNode pulumi.IntPtrInput
// A map of custom batch pool metadata.
Metadata pulumi.StringMapInput
// Specifies the name of the Batch pool. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `networkConfiguration` block that describes the network configurations for the Batch pool.
NetworkConfiguration PoolNetworkConfigurationPtrInput
// Specifies the Sku of the node agents that will be created in the Batch pool.
NodeAgentSkuId pulumi.StringPtrInput
// The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// A `startTask` block that describes the start task settings for the Batch pool.
StartTask PoolStartTaskPtrInput
StopPendingResizeOperation pulumi.BoolPtrInput
// A `storageImageReference` for the virtual machines that will compose the Batch pool.
StorageImageReference PoolStorageImageReferencePtrInput
// Specifies the size of the VM created in the Batch pool.
VmSize pulumi.StringPtrInput
}
func (PoolState) ElementType() reflect.Type {
return reflect.TypeOf((*poolState)(nil)).Elem()
}
type poolArgs struct {
// Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.
AccountName string `pulumi:"accountName"`
// A `autoScale` block that describes the scale settings when using auto scale.
AutoScale *PoolAutoScale `pulumi:"autoScale"`
// One or more `certificate` blocks that describe the certificates to be installed on each compute node in the pool.
Certificates []PoolCertificate `pulumi:"certificates"`
// The container configuration used in the pool's VMs.
ContainerConfiguration *PoolContainerConfiguration `pulumi:"containerConfiguration"`
// Specifies the display name of the Batch pool.
DisplayName *string `pulumi:"displayName"`
// A `fixedScale` block that describes the scale settings when using fixed scale.
FixedScale *PoolFixedScale `pulumi:"fixedScale"`
// Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to `1`. Changing this forces a new resource to be created.
MaxTasksPerNode *int `pulumi:"maxTasksPerNode"`
// A map of custom batch pool metadata.
Metadata map[string]string `pulumi:"metadata"`
// Specifies the name of the Batch pool. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// A `networkConfiguration` block that describes the network configurations for the Batch pool.
NetworkConfiguration *PoolNetworkConfiguration `pulumi:"networkConfiguration"`
// Specifies the Sku of the node agents that will be created in the Batch pool.
NodeAgentSkuId string `pulumi:"nodeAgentSkuId"`
// The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A `startTask` block that describes the start task settings for the Batch pool.
StartTask *PoolStartTask `pulumi:"startTask"`
StopPendingResizeOperation *bool `pulumi:"stopPendingResizeOperation"`
// A `storageImageReference` for the virtual machines that will compose the Batch pool.
StorageImageReference PoolStorageImageReference `pulumi:"storageImageReference"`
// Specifies the size of the VM created in the Batch pool.
VmSize string `pulumi:"vmSize"`
}
// The set of arguments for constructing a Pool resource.
type PoolArgs struct {
// Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.
AccountName pulumi.StringInput
// A `autoScale` block that describes the scale settings when using auto scale.
AutoScale PoolAutoScalePtrInput
// One or more `certificate` blocks that describe the certificates to be installed on each compute node in the pool.
Certificates PoolCertificateArrayInput
// The container configuration used in the pool's VMs.
ContainerConfiguration PoolContainerConfigurationPtrInput
// Specifies the display name of the Batch pool.
DisplayName pulumi.StringPtrInput
// A `fixedScale` block that describes the scale settings when using fixed scale.
FixedScale PoolFixedScalePtrInput
// Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to `1`. Changing this forces a new resource to be created.
MaxTasksPerNode pulumi.IntPtrInput
// A map of custom batch pool metadata.
Metadata pulumi.StringMapInput
// Specifies the name of the Batch pool. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// A `networkConfiguration` block that describes the network configurations for the Batch pool.
NetworkConfiguration PoolNetworkConfigurationPtrInput
// Specifies the Sku of the node agents that will be created in the Batch pool.
NodeAgentSkuId pulumi.StringInput
// The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// A `startTask` block that describes the start task settings for the Batch pool.
StartTask PoolStartTaskPtrInput
StopPendingResizeOperation pulumi.BoolPtrInput
// A `storageImageReference` for the virtual machines that will compose the Batch pool.
StorageImageReference PoolStorageImageReferenceInput
// Specifies the size of the VM created in the Batch pool.
VmSize pulumi.StringInput
}
func (PoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*poolArgs)(nil)).Elem()
}