github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/devicefarm/devicePool.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package devicefarm
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a resource to manage AWS Device Farm Device Pools.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/devicefarm"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := devicefarm.NewDevicePool(ctx, "example", &devicefarm.DevicePoolArgs{
    33  //				Name:       pulumi.String("example"),
    34  //				ProjectArn: pulumi.Any(exampleAwsDevicefarmProject.Arn),
    35  //				Rules: devicefarm.DevicePoolRuleArray{
    36  //					&devicefarm.DevicePoolRuleArgs{
    37  //						Attribute: pulumi.String("OS_VERSION"),
    38  //						Operator:  pulumi.String("EQUALS"),
    39  //						Value:     pulumi.String("\"AVAILABLE\""),
    40  //					},
    41  //				},
    42  //			})
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ## Import
    54  //
    55  // Using `pulumi import`, import DeviceFarm Device Pools using their ARN. For example:
    56  //
    57  // ```sh
    58  // $ 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
    59  // ```
    60  type DevicePool struct {
    61  	pulumi.CustomResourceState
    62  
    63  	// The Amazon Resource Name of this Device Pool
    64  	Arn pulumi.StringOutput `pulumi:"arn"`
    65  	// The device pool's description.
    66  	Description pulumi.StringPtrOutput `pulumi:"description"`
    67  	// The number of devices that Device Farm can add to your device pool.
    68  	MaxDevices pulumi.IntPtrOutput `pulumi:"maxDevices"`
    69  	// The name of the Device Pool
    70  	Name pulumi.StringOutput `pulumi:"name"`
    71  	// The ARN of the project for the device pool.
    72  	ProjectArn pulumi.StringOutput `pulumi:"projectArn"`
    73  	// The device pool's rules. See Rule.
    74  	Rules DevicePoolRuleArrayOutput `pulumi:"rules"`
    75  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    76  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    77  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    78  	//
    79  	// Deprecated: Please use `tags` instead.
    80  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    81  	Type    pulumi.StringOutput    `pulumi:"type"`
    82  }
    83  
    84  // NewDevicePool registers a new resource with the given unique name, arguments, and options.
    85  func NewDevicePool(ctx *pulumi.Context,
    86  	name string, args *DevicePoolArgs, opts ...pulumi.ResourceOption) (*DevicePool, error) {
    87  	if args == nil {
    88  		return nil, errors.New("missing one or more required arguments")
    89  	}
    90  
    91  	if args.ProjectArn == nil {
    92  		return nil, errors.New("invalid value for required argument 'ProjectArn'")
    93  	}
    94  	if args.Rules == nil {
    95  		return nil, errors.New("invalid value for required argument 'Rules'")
    96  	}
    97  	opts = internal.PkgResourceDefaultOpts(opts)
    98  	var resource DevicePool
    99  	err := ctx.RegisterResource("aws:devicefarm/devicePool:DevicePool", name, args, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // GetDevicePool gets an existing DevicePool resource's state with the given name, ID, and optional
   107  // state properties that are used to uniquely qualify the lookup (nil if not required).
   108  func GetDevicePool(ctx *pulumi.Context,
   109  	name string, id pulumi.IDInput, state *DevicePoolState, opts ...pulumi.ResourceOption) (*DevicePool, error) {
   110  	var resource DevicePool
   111  	err := ctx.ReadResource("aws:devicefarm/devicePool:DevicePool", name, id, state, &resource, opts...)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return &resource, nil
   116  }
   117  
   118  // Input properties used for looking up and filtering DevicePool resources.
   119  type devicePoolState struct {
   120  	// The Amazon Resource Name of this Device Pool
   121  	Arn *string `pulumi:"arn"`
   122  	// The device pool's description.
   123  	Description *string `pulumi:"description"`
   124  	// The number of devices that Device Farm can add to your device pool.
   125  	MaxDevices *int `pulumi:"maxDevices"`
   126  	// The name of the Device Pool
   127  	Name *string `pulumi:"name"`
   128  	// The ARN of the project for the device pool.
   129  	ProjectArn *string `pulumi:"projectArn"`
   130  	// The device pool's rules. See Rule.
   131  	Rules []DevicePoolRule `pulumi:"rules"`
   132  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   133  	Tags map[string]string `pulumi:"tags"`
   134  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   135  	//
   136  	// Deprecated: Please use `tags` instead.
   137  	TagsAll map[string]string `pulumi:"tagsAll"`
   138  	Type    *string           `pulumi:"type"`
   139  }
   140  
   141  type DevicePoolState struct {
   142  	// The Amazon Resource Name of this Device Pool
   143  	Arn pulumi.StringPtrInput
   144  	// The device pool's description.
   145  	Description pulumi.StringPtrInput
   146  	// The number of devices that Device Farm can add to your device pool.
   147  	MaxDevices pulumi.IntPtrInput
   148  	// The name of the Device Pool
   149  	Name pulumi.StringPtrInput
   150  	// The ARN of the project for the device pool.
   151  	ProjectArn pulumi.StringPtrInput
   152  	// The device pool's rules. See Rule.
   153  	Rules DevicePoolRuleArrayInput
   154  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   155  	Tags pulumi.StringMapInput
   156  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   157  	//
   158  	// Deprecated: Please use `tags` instead.
   159  	TagsAll pulumi.StringMapInput
   160  	Type    pulumi.StringPtrInput
   161  }
   162  
   163  func (DevicePoolState) ElementType() reflect.Type {
   164  	return reflect.TypeOf((*devicePoolState)(nil)).Elem()
   165  }
   166  
   167  type devicePoolArgs struct {
   168  	// The device pool's description.
   169  	Description *string `pulumi:"description"`
   170  	// The number of devices that Device Farm can add to your device pool.
   171  	MaxDevices *int `pulumi:"maxDevices"`
   172  	// The name of the Device Pool
   173  	Name *string `pulumi:"name"`
   174  	// The ARN of the project for the device pool.
   175  	ProjectArn string `pulumi:"projectArn"`
   176  	// The device pool's rules. See Rule.
   177  	Rules []DevicePoolRule `pulumi:"rules"`
   178  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   179  	Tags map[string]string `pulumi:"tags"`
   180  }
   181  
   182  // The set of arguments for constructing a DevicePool resource.
   183  type DevicePoolArgs struct {
   184  	// The device pool's description.
   185  	Description pulumi.StringPtrInput
   186  	// The number of devices that Device Farm can add to your device pool.
   187  	MaxDevices pulumi.IntPtrInput
   188  	// The name of the Device Pool
   189  	Name pulumi.StringPtrInput
   190  	// The ARN of the project for the device pool.
   191  	ProjectArn pulumi.StringInput
   192  	// The device pool's rules. See Rule.
   193  	Rules DevicePoolRuleArrayInput
   194  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   195  	Tags pulumi.StringMapInput
   196  }
   197  
   198  func (DevicePoolArgs) ElementType() reflect.Type {
   199  	return reflect.TypeOf((*devicePoolArgs)(nil)).Elem()
   200  }
   201  
   202  type DevicePoolInput interface {
   203  	pulumi.Input
   204  
   205  	ToDevicePoolOutput() DevicePoolOutput
   206  	ToDevicePoolOutputWithContext(ctx context.Context) DevicePoolOutput
   207  }
   208  
   209  func (*DevicePool) ElementType() reflect.Type {
   210  	return reflect.TypeOf((**DevicePool)(nil)).Elem()
   211  }
   212  
   213  func (i *DevicePool) ToDevicePoolOutput() DevicePoolOutput {
   214  	return i.ToDevicePoolOutputWithContext(context.Background())
   215  }
   216  
   217  func (i *DevicePool) ToDevicePoolOutputWithContext(ctx context.Context) DevicePoolOutput {
   218  	return pulumi.ToOutputWithContext(ctx, i).(DevicePoolOutput)
   219  }
   220  
   221  // DevicePoolArrayInput is an input type that accepts DevicePoolArray and DevicePoolArrayOutput values.
   222  // You can construct a concrete instance of `DevicePoolArrayInput` via:
   223  //
   224  //	DevicePoolArray{ DevicePoolArgs{...} }
   225  type DevicePoolArrayInput interface {
   226  	pulumi.Input
   227  
   228  	ToDevicePoolArrayOutput() DevicePoolArrayOutput
   229  	ToDevicePoolArrayOutputWithContext(context.Context) DevicePoolArrayOutput
   230  }
   231  
   232  type DevicePoolArray []DevicePoolInput
   233  
   234  func (DevicePoolArray) ElementType() reflect.Type {
   235  	return reflect.TypeOf((*[]*DevicePool)(nil)).Elem()
   236  }
   237  
   238  func (i DevicePoolArray) ToDevicePoolArrayOutput() DevicePoolArrayOutput {
   239  	return i.ToDevicePoolArrayOutputWithContext(context.Background())
   240  }
   241  
   242  func (i DevicePoolArray) ToDevicePoolArrayOutputWithContext(ctx context.Context) DevicePoolArrayOutput {
   243  	return pulumi.ToOutputWithContext(ctx, i).(DevicePoolArrayOutput)
   244  }
   245  
   246  // DevicePoolMapInput is an input type that accepts DevicePoolMap and DevicePoolMapOutput values.
   247  // You can construct a concrete instance of `DevicePoolMapInput` via:
   248  //
   249  //	DevicePoolMap{ "key": DevicePoolArgs{...} }
   250  type DevicePoolMapInput interface {
   251  	pulumi.Input
   252  
   253  	ToDevicePoolMapOutput() DevicePoolMapOutput
   254  	ToDevicePoolMapOutputWithContext(context.Context) DevicePoolMapOutput
   255  }
   256  
   257  type DevicePoolMap map[string]DevicePoolInput
   258  
   259  func (DevicePoolMap) ElementType() reflect.Type {
   260  	return reflect.TypeOf((*map[string]*DevicePool)(nil)).Elem()
   261  }
   262  
   263  func (i DevicePoolMap) ToDevicePoolMapOutput() DevicePoolMapOutput {
   264  	return i.ToDevicePoolMapOutputWithContext(context.Background())
   265  }
   266  
   267  func (i DevicePoolMap) ToDevicePoolMapOutputWithContext(ctx context.Context) DevicePoolMapOutput {
   268  	return pulumi.ToOutputWithContext(ctx, i).(DevicePoolMapOutput)
   269  }
   270  
   271  type DevicePoolOutput struct{ *pulumi.OutputState }
   272  
   273  func (DevicePoolOutput) ElementType() reflect.Type {
   274  	return reflect.TypeOf((**DevicePool)(nil)).Elem()
   275  }
   276  
   277  func (o DevicePoolOutput) ToDevicePoolOutput() DevicePoolOutput {
   278  	return o
   279  }
   280  
   281  func (o DevicePoolOutput) ToDevicePoolOutputWithContext(ctx context.Context) DevicePoolOutput {
   282  	return o
   283  }
   284  
   285  // The Amazon Resource Name of this Device Pool
   286  func (o DevicePoolOutput) Arn() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *DevicePool) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   288  }
   289  
   290  // The device pool's description.
   291  func (o DevicePoolOutput) Description() pulumi.StringPtrOutput {
   292  	return o.ApplyT(func(v *DevicePool) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   293  }
   294  
   295  // The number of devices that Device Farm can add to your device pool.
   296  func (o DevicePoolOutput) MaxDevices() pulumi.IntPtrOutput {
   297  	return o.ApplyT(func(v *DevicePool) pulumi.IntPtrOutput { return v.MaxDevices }).(pulumi.IntPtrOutput)
   298  }
   299  
   300  // The name of the Device Pool
   301  func (o DevicePoolOutput) Name() pulumi.StringOutput {
   302  	return o.ApplyT(func(v *DevicePool) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   303  }
   304  
   305  // The ARN of the project for the device pool.
   306  func (o DevicePoolOutput) ProjectArn() pulumi.StringOutput {
   307  	return o.ApplyT(func(v *DevicePool) pulumi.StringOutput { return v.ProjectArn }).(pulumi.StringOutput)
   308  }
   309  
   310  // The device pool's rules. See Rule.
   311  func (o DevicePoolOutput) Rules() DevicePoolRuleArrayOutput {
   312  	return o.ApplyT(func(v *DevicePool) DevicePoolRuleArrayOutput { return v.Rules }).(DevicePoolRuleArrayOutput)
   313  }
   314  
   315  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   316  func (o DevicePoolOutput) Tags() pulumi.StringMapOutput {
   317  	return o.ApplyT(func(v *DevicePool) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   318  }
   319  
   320  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   321  //
   322  // Deprecated: Please use `tags` instead.
   323  func (o DevicePoolOutput) TagsAll() pulumi.StringMapOutput {
   324  	return o.ApplyT(func(v *DevicePool) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   325  }
   326  
   327  func (o DevicePoolOutput) Type() pulumi.StringOutput {
   328  	return o.ApplyT(func(v *DevicePool) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
   329  }
   330  
   331  type DevicePoolArrayOutput struct{ *pulumi.OutputState }
   332  
   333  func (DevicePoolArrayOutput) ElementType() reflect.Type {
   334  	return reflect.TypeOf((*[]*DevicePool)(nil)).Elem()
   335  }
   336  
   337  func (o DevicePoolArrayOutput) ToDevicePoolArrayOutput() DevicePoolArrayOutput {
   338  	return o
   339  }
   340  
   341  func (o DevicePoolArrayOutput) ToDevicePoolArrayOutputWithContext(ctx context.Context) DevicePoolArrayOutput {
   342  	return o
   343  }
   344  
   345  func (o DevicePoolArrayOutput) Index(i pulumi.IntInput) DevicePoolOutput {
   346  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DevicePool {
   347  		return vs[0].([]*DevicePool)[vs[1].(int)]
   348  	}).(DevicePoolOutput)
   349  }
   350  
   351  type DevicePoolMapOutput struct{ *pulumi.OutputState }
   352  
   353  func (DevicePoolMapOutput) ElementType() reflect.Type {
   354  	return reflect.TypeOf((*map[string]*DevicePool)(nil)).Elem()
   355  }
   356  
   357  func (o DevicePoolMapOutput) ToDevicePoolMapOutput() DevicePoolMapOutput {
   358  	return o
   359  }
   360  
   361  func (o DevicePoolMapOutput) ToDevicePoolMapOutputWithContext(ctx context.Context) DevicePoolMapOutput {
   362  	return o
   363  }
   364  
   365  func (o DevicePoolMapOutput) MapIndex(k pulumi.StringInput) DevicePoolOutput {
   366  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DevicePool {
   367  		return vs[0].(map[string]*DevicePool)[vs[1].(string)]
   368  	}).(DevicePoolOutput)
   369  }
   370  
   371  func init() {
   372  	pulumi.RegisterInputType(reflect.TypeOf((*DevicePoolInput)(nil)).Elem(), &DevicePool{})
   373  	pulumi.RegisterInputType(reflect.TypeOf((*DevicePoolArrayInput)(nil)).Elem(), DevicePoolArray{})
   374  	pulumi.RegisterInputType(reflect.TypeOf((*DevicePoolMapInput)(nil)).Elem(), DevicePoolMap{})
   375  	pulumi.RegisterOutputType(DevicePoolOutput{})
   376  	pulumi.RegisterOutputType(DevicePoolArrayOutput{})
   377  	pulumi.RegisterOutputType(DevicePoolMapOutput{})
   378  }