-
Notifications
You must be signed in to change notification settings - Fork 155
/
devicePool.go
322 lines (276 loc) · 12.5 KB
/
devicePool.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
// *** 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 devicefarm
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to manage AWS Device Farm Device Pools.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/devicefarm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := devicefarm.NewDevicePool(ctx, "example", &devicefarm.DevicePoolArgs{
// ProjectArn: pulumi.Any(aws_devicefarm_project.Example.Arn),
// Rules: devicefarm.DevicePoolRuleArray{
// &devicefarm.DevicePoolRuleArgs{
// Attribute: pulumi.String("OS_VERSION"),
// Operator: pulumi.String("EQUALS"),
// Value: pulumi.String("\"AVAILABLE\""),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// DeviceFarm Device Pools can be imported by their arn
//
// ```sh
// $ pulumi import aws:devicefarm/devicePool:DevicePool example arn:aws:devicefarm:us-west-2:123456789012:devicepool:4fa784c7-ccb4-4dbf-ba4f-02198320daa1/4fa784c7-ccb4-4dbf-ba4f-02198320daa1
// ```
type DevicePool struct {
pulumi.CustomResourceState
// The Amazon Resource Name of this Device Pool
Arn pulumi.StringOutput `pulumi:"arn"`
// The device pool's description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The number of devices that Device Farm can add to your device pool.
MaxDevices pulumi.IntPtrOutput `pulumi:"maxDevices"`
// The name of the Device Pool
Name pulumi.StringOutput `pulumi:"name"`
// The ARN of the project for the device pool.
ProjectArn pulumi.StringOutput `pulumi:"projectArn"`
// The device pool's rules. See Rule.
Rules DevicePoolRuleArrayOutput `pulumi:"rules"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
Type pulumi.StringOutput `pulumi:"type"`
}
// NewDevicePool registers a new resource with the given unique name, arguments, and options.
func NewDevicePool(ctx *pulumi.Context,
name string, args *DevicePoolArgs, opts ...pulumi.ResourceOption) (*DevicePool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ProjectArn == nil {
return nil, errors.New("invalid value for required argument 'ProjectArn'")
}
if args.Rules == nil {
return nil, errors.New("invalid value for required argument 'Rules'")
}
var resource DevicePool
err := ctx.RegisterResource("aws:devicefarm/devicePool:DevicePool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDevicePool gets an existing DevicePool 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 GetDevicePool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DevicePoolState, opts ...pulumi.ResourceOption) (*DevicePool, error) {
var resource DevicePool
err := ctx.ReadResource("aws:devicefarm/devicePool:DevicePool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DevicePool resources.
type devicePoolState struct {
// The Amazon Resource Name of this Device Pool
Arn *string `pulumi:"arn"`
// The device pool's description.
Description *string `pulumi:"description"`
// The number of devices that Device Farm can add to your device pool.
MaxDevices *int `pulumi:"maxDevices"`
// The name of the Device Pool
Name *string `pulumi:"name"`
// The ARN of the project for the device pool.
ProjectArn *string `pulumi:"projectArn"`
// The device pool's rules. See Rule.
Rules []DevicePoolRule `pulumi:"rules"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
TagsAll map[string]string `pulumi:"tagsAll"`
Type *string `pulumi:"type"`
}
type DevicePoolState struct {
// The Amazon Resource Name of this Device Pool
Arn pulumi.StringPtrInput
// The device pool's description.
Description pulumi.StringPtrInput
// The number of devices that Device Farm can add to your device pool.
MaxDevices pulumi.IntPtrInput
// The name of the Device Pool
Name pulumi.StringPtrInput
// The ARN of the project for the device pool.
ProjectArn pulumi.StringPtrInput
// The device pool's rules. See Rule.
Rules DevicePoolRuleArrayInput
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
TagsAll pulumi.StringMapInput
Type pulumi.StringPtrInput
}
func (DevicePoolState) ElementType() reflect.Type {
return reflect.TypeOf((*devicePoolState)(nil)).Elem()
}
type devicePoolArgs struct {
// The device pool's description.
Description *string `pulumi:"description"`
// The number of devices that Device Farm can add to your device pool.
MaxDevices *int `pulumi:"maxDevices"`
// The name of the Device Pool
Name *string `pulumi:"name"`
// The ARN of the project for the device pool.
ProjectArn string `pulumi:"projectArn"`
// The device pool's rules. See Rule.
Rules []DevicePoolRule `pulumi:"rules"`
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
TagsAll map[string]string `pulumi:"tagsAll"`
}
// The set of arguments for constructing a DevicePool resource.
type DevicePoolArgs struct {
// The device pool's description.
Description pulumi.StringPtrInput
// The number of devices that Device Farm can add to your device pool.
MaxDevices pulumi.IntPtrInput
// The name of the Device Pool
Name pulumi.StringPtrInput
// The ARN of the project for the device pool.
ProjectArn pulumi.StringInput
// The device pool's rules. See Rule.
Rules DevicePoolRuleArrayInput
// A map of tags to assign to the resource. If configured with a provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider [`defaultTags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block).
TagsAll pulumi.StringMapInput
}
func (DevicePoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*devicePoolArgs)(nil)).Elem()
}
type DevicePoolInput interface {
pulumi.Input
ToDevicePoolOutput() DevicePoolOutput
ToDevicePoolOutputWithContext(ctx context.Context) DevicePoolOutput
}
func (*DevicePool) ElementType() reflect.Type {
return reflect.TypeOf((**DevicePool)(nil)).Elem()
}
func (i *DevicePool) ToDevicePoolOutput() DevicePoolOutput {
return i.ToDevicePoolOutputWithContext(context.Background())
}
func (i *DevicePool) ToDevicePoolOutputWithContext(ctx context.Context) DevicePoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevicePoolOutput)
}
// DevicePoolArrayInput is an input type that accepts DevicePoolArray and DevicePoolArrayOutput values.
// You can construct a concrete instance of `DevicePoolArrayInput` via:
//
// DevicePoolArray{ DevicePoolArgs{...} }
type DevicePoolArrayInput interface {
pulumi.Input
ToDevicePoolArrayOutput() DevicePoolArrayOutput
ToDevicePoolArrayOutputWithContext(context.Context) DevicePoolArrayOutput
}
type DevicePoolArray []DevicePoolInput
func (DevicePoolArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DevicePool)(nil)).Elem()
}
func (i DevicePoolArray) ToDevicePoolArrayOutput() DevicePoolArrayOutput {
return i.ToDevicePoolArrayOutputWithContext(context.Background())
}
func (i DevicePoolArray) ToDevicePoolArrayOutputWithContext(ctx context.Context) DevicePoolArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevicePoolArrayOutput)
}
// DevicePoolMapInput is an input type that accepts DevicePoolMap and DevicePoolMapOutput values.
// You can construct a concrete instance of `DevicePoolMapInput` via:
//
// DevicePoolMap{ "key": DevicePoolArgs{...} }
type DevicePoolMapInput interface {
pulumi.Input
ToDevicePoolMapOutput() DevicePoolMapOutput
ToDevicePoolMapOutputWithContext(context.Context) DevicePoolMapOutput
}
type DevicePoolMap map[string]DevicePoolInput
func (DevicePoolMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DevicePool)(nil)).Elem()
}
func (i DevicePoolMap) ToDevicePoolMapOutput() DevicePoolMapOutput {
return i.ToDevicePoolMapOutputWithContext(context.Background())
}
func (i DevicePoolMap) ToDevicePoolMapOutputWithContext(ctx context.Context) DevicePoolMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DevicePoolMapOutput)
}
type DevicePoolOutput struct{ *pulumi.OutputState }
func (DevicePoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DevicePool)(nil)).Elem()
}
func (o DevicePoolOutput) ToDevicePoolOutput() DevicePoolOutput {
return o
}
func (o DevicePoolOutput) ToDevicePoolOutputWithContext(ctx context.Context) DevicePoolOutput {
return o
}
type DevicePoolArrayOutput struct{ *pulumi.OutputState }
func (DevicePoolArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DevicePool)(nil)).Elem()
}
func (o DevicePoolArrayOutput) ToDevicePoolArrayOutput() DevicePoolArrayOutput {
return o
}
func (o DevicePoolArrayOutput) ToDevicePoolArrayOutputWithContext(ctx context.Context) DevicePoolArrayOutput {
return o
}
func (o DevicePoolArrayOutput) Index(i pulumi.IntInput) DevicePoolOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DevicePool {
return vs[0].([]*DevicePool)[vs[1].(int)]
}).(DevicePoolOutput)
}
type DevicePoolMapOutput struct{ *pulumi.OutputState }
func (DevicePoolMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DevicePool)(nil)).Elem()
}
func (o DevicePoolMapOutput) ToDevicePoolMapOutput() DevicePoolMapOutput {
return o
}
func (o DevicePoolMapOutput) ToDevicePoolMapOutputWithContext(ctx context.Context) DevicePoolMapOutput {
return o
}
func (o DevicePoolMapOutput) MapIndex(k pulumi.StringInput) DevicePoolOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DevicePool {
return vs[0].(map[string]*DevicePool)[vs[1].(string)]
}).(DevicePoolOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DevicePoolInput)(nil)).Elem(), &DevicePool{})
pulumi.RegisterInputType(reflect.TypeOf((*DevicePoolArrayInput)(nil)).Elem(), DevicePoolArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DevicePoolMapInput)(nil)).Elem(), DevicePoolMap{})
pulumi.RegisterOutputType(DevicePoolOutput{})
pulumi.RegisterOutputType(DevicePoolArrayOutput{})
pulumi.RegisterOutputType(DevicePoolMapOutput{})
}