github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/device.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 sagemaker
     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 SageMaker Device resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := sagemaker.NewDevice(ctx, "example", &sagemaker.DeviceArgs{
    35  //				DeviceFleetName: pulumi.Any(exampleAwsSagemakerDeviceFleet.DeviceFleetName),
    36  //				Device: &sagemaker.DeviceDeviceArgs{
    37  //					DeviceName: pulumi.String("example"),
    38  //				},
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import SageMaker Devices using the `device-fleet-name/device-name`. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:sagemaker/device:Device example my-fleet/my-device
    56  // ```
    57  type Device struct {
    58  	pulumi.CustomResourceState
    59  
    60  	AgentVersion pulumi.StringOutput `pulumi:"agentVersion"`
    61  	// The Amazon Resource Name (ARN) assigned by AWS to this Device.
    62  	Arn pulumi.StringOutput `pulumi:"arn"`
    63  	// The device to register with SageMaker Edge Manager. See Device details below.
    64  	Device DeviceDeviceOutput `pulumi:"device"`
    65  	// The name of the Device Fleet.
    66  	DeviceFleetName pulumi.StringOutput `pulumi:"deviceFleetName"`
    67  }
    68  
    69  // NewDevice registers a new resource with the given unique name, arguments, and options.
    70  func NewDevice(ctx *pulumi.Context,
    71  	name string, args *DeviceArgs, opts ...pulumi.ResourceOption) (*Device, error) {
    72  	if args == nil {
    73  		return nil, errors.New("missing one or more required arguments")
    74  	}
    75  
    76  	if args.Device == nil {
    77  		return nil, errors.New("invalid value for required argument 'Device'")
    78  	}
    79  	if args.DeviceFleetName == nil {
    80  		return nil, errors.New("invalid value for required argument 'DeviceFleetName'")
    81  	}
    82  	opts = internal.PkgResourceDefaultOpts(opts)
    83  	var resource Device
    84  	err := ctx.RegisterResource("aws:sagemaker/device:Device", name, args, &resource, opts...)
    85  	if err != nil {
    86  		return nil, err
    87  	}
    88  	return &resource, nil
    89  }
    90  
    91  // GetDevice gets an existing Device resource's state with the given name, ID, and optional
    92  // state properties that are used to uniquely qualify the lookup (nil if not required).
    93  func GetDevice(ctx *pulumi.Context,
    94  	name string, id pulumi.IDInput, state *DeviceState, opts ...pulumi.ResourceOption) (*Device, error) {
    95  	var resource Device
    96  	err := ctx.ReadResource("aws:sagemaker/device:Device", name, id, state, &resource, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return &resource, nil
   101  }
   102  
   103  // Input properties used for looking up and filtering Device resources.
   104  type deviceState struct {
   105  	AgentVersion *string `pulumi:"agentVersion"`
   106  	// The Amazon Resource Name (ARN) assigned by AWS to this Device.
   107  	Arn *string `pulumi:"arn"`
   108  	// The device to register with SageMaker Edge Manager. See Device details below.
   109  	Device *DeviceDevice `pulumi:"device"`
   110  	// The name of the Device Fleet.
   111  	DeviceFleetName *string `pulumi:"deviceFleetName"`
   112  }
   113  
   114  type DeviceState struct {
   115  	AgentVersion pulumi.StringPtrInput
   116  	// The Amazon Resource Name (ARN) assigned by AWS to this Device.
   117  	Arn pulumi.StringPtrInput
   118  	// The device to register with SageMaker Edge Manager. See Device details below.
   119  	Device DeviceDevicePtrInput
   120  	// The name of the Device Fleet.
   121  	DeviceFleetName pulumi.StringPtrInput
   122  }
   123  
   124  func (DeviceState) ElementType() reflect.Type {
   125  	return reflect.TypeOf((*deviceState)(nil)).Elem()
   126  }
   127  
   128  type deviceArgs struct {
   129  	// The device to register with SageMaker Edge Manager. See Device details below.
   130  	Device DeviceDevice `pulumi:"device"`
   131  	// The name of the Device Fleet.
   132  	DeviceFleetName string `pulumi:"deviceFleetName"`
   133  }
   134  
   135  // The set of arguments for constructing a Device resource.
   136  type DeviceArgs struct {
   137  	// The device to register with SageMaker Edge Manager. See Device details below.
   138  	Device DeviceDeviceInput
   139  	// The name of the Device Fleet.
   140  	DeviceFleetName pulumi.StringInput
   141  }
   142  
   143  func (DeviceArgs) ElementType() reflect.Type {
   144  	return reflect.TypeOf((*deviceArgs)(nil)).Elem()
   145  }
   146  
   147  type DeviceInput interface {
   148  	pulumi.Input
   149  
   150  	ToDeviceOutput() DeviceOutput
   151  	ToDeviceOutputWithContext(ctx context.Context) DeviceOutput
   152  }
   153  
   154  func (*Device) ElementType() reflect.Type {
   155  	return reflect.TypeOf((**Device)(nil)).Elem()
   156  }
   157  
   158  func (i *Device) ToDeviceOutput() DeviceOutput {
   159  	return i.ToDeviceOutputWithContext(context.Background())
   160  }
   161  
   162  func (i *Device) ToDeviceOutputWithContext(ctx context.Context) DeviceOutput {
   163  	return pulumi.ToOutputWithContext(ctx, i).(DeviceOutput)
   164  }
   165  
   166  // DeviceArrayInput is an input type that accepts DeviceArray and DeviceArrayOutput values.
   167  // You can construct a concrete instance of `DeviceArrayInput` via:
   168  //
   169  //	DeviceArray{ DeviceArgs{...} }
   170  type DeviceArrayInput interface {
   171  	pulumi.Input
   172  
   173  	ToDeviceArrayOutput() DeviceArrayOutput
   174  	ToDeviceArrayOutputWithContext(context.Context) DeviceArrayOutput
   175  }
   176  
   177  type DeviceArray []DeviceInput
   178  
   179  func (DeviceArray) ElementType() reflect.Type {
   180  	return reflect.TypeOf((*[]*Device)(nil)).Elem()
   181  }
   182  
   183  func (i DeviceArray) ToDeviceArrayOutput() DeviceArrayOutput {
   184  	return i.ToDeviceArrayOutputWithContext(context.Background())
   185  }
   186  
   187  func (i DeviceArray) ToDeviceArrayOutputWithContext(ctx context.Context) DeviceArrayOutput {
   188  	return pulumi.ToOutputWithContext(ctx, i).(DeviceArrayOutput)
   189  }
   190  
   191  // DeviceMapInput is an input type that accepts DeviceMap and DeviceMapOutput values.
   192  // You can construct a concrete instance of `DeviceMapInput` via:
   193  //
   194  //	DeviceMap{ "key": DeviceArgs{...} }
   195  type DeviceMapInput interface {
   196  	pulumi.Input
   197  
   198  	ToDeviceMapOutput() DeviceMapOutput
   199  	ToDeviceMapOutputWithContext(context.Context) DeviceMapOutput
   200  }
   201  
   202  type DeviceMap map[string]DeviceInput
   203  
   204  func (DeviceMap) ElementType() reflect.Type {
   205  	return reflect.TypeOf((*map[string]*Device)(nil)).Elem()
   206  }
   207  
   208  func (i DeviceMap) ToDeviceMapOutput() DeviceMapOutput {
   209  	return i.ToDeviceMapOutputWithContext(context.Background())
   210  }
   211  
   212  func (i DeviceMap) ToDeviceMapOutputWithContext(ctx context.Context) DeviceMapOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(DeviceMapOutput)
   214  }
   215  
   216  type DeviceOutput struct{ *pulumi.OutputState }
   217  
   218  func (DeviceOutput) ElementType() reflect.Type {
   219  	return reflect.TypeOf((**Device)(nil)).Elem()
   220  }
   221  
   222  func (o DeviceOutput) ToDeviceOutput() DeviceOutput {
   223  	return o
   224  }
   225  
   226  func (o DeviceOutput) ToDeviceOutputWithContext(ctx context.Context) DeviceOutput {
   227  	return o
   228  }
   229  
   230  func (o DeviceOutput) AgentVersion() pulumi.StringOutput {
   231  	return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.AgentVersion }).(pulumi.StringOutput)
   232  }
   233  
   234  // The Amazon Resource Name (ARN) assigned by AWS to this Device.
   235  func (o DeviceOutput) Arn() pulumi.StringOutput {
   236  	return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   237  }
   238  
   239  // The device to register with SageMaker Edge Manager. See Device details below.
   240  func (o DeviceOutput) Device() DeviceDeviceOutput {
   241  	return o.ApplyT(func(v *Device) DeviceDeviceOutput { return v.Device }).(DeviceDeviceOutput)
   242  }
   243  
   244  // The name of the Device Fleet.
   245  func (o DeviceOutput) DeviceFleetName() pulumi.StringOutput {
   246  	return o.ApplyT(func(v *Device) pulumi.StringOutput { return v.DeviceFleetName }).(pulumi.StringOutput)
   247  }
   248  
   249  type DeviceArrayOutput struct{ *pulumi.OutputState }
   250  
   251  func (DeviceArrayOutput) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*[]*Device)(nil)).Elem()
   253  }
   254  
   255  func (o DeviceArrayOutput) ToDeviceArrayOutput() DeviceArrayOutput {
   256  	return o
   257  }
   258  
   259  func (o DeviceArrayOutput) ToDeviceArrayOutputWithContext(ctx context.Context) DeviceArrayOutput {
   260  	return o
   261  }
   262  
   263  func (o DeviceArrayOutput) Index(i pulumi.IntInput) DeviceOutput {
   264  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Device {
   265  		return vs[0].([]*Device)[vs[1].(int)]
   266  	}).(DeviceOutput)
   267  }
   268  
   269  type DeviceMapOutput struct{ *pulumi.OutputState }
   270  
   271  func (DeviceMapOutput) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*map[string]*Device)(nil)).Elem()
   273  }
   274  
   275  func (o DeviceMapOutput) ToDeviceMapOutput() DeviceMapOutput {
   276  	return o
   277  }
   278  
   279  func (o DeviceMapOutput) ToDeviceMapOutputWithContext(ctx context.Context) DeviceMapOutput {
   280  	return o
   281  }
   282  
   283  func (o DeviceMapOutput) MapIndex(k pulumi.StringInput) DeviceOutput {
   284  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Device {
   285  		return vs[0].(map[string]*Device)[vs[1].(string)]
   286  	}).(DeviceOutput)
   287  }
   288  
   289  func init() {
   290  	pulumi.RegisterInputType(reflect.TypeOf((*DeviceInput)(nil)).Elem(), &Device{})
   291  	pulumi.RegisterInputType(reflect.TypeOf((*DeviceArrayInput)(nil)).Elem(), DeviceArray{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*DeviceMapInput)(nil)).Elem(), DeviceMap{})
   293  	pulumi.RegisterOutputType(DeviceOutput{})
   294  	pulumi.RegisterOutputType(DeviceArrayOutput{})
   295  	pulumi.RegisterOutputType(DeviceMapOutput{})
   296  }