github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/datasync/locationSmb.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 datasync
     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  // Manages a SMB Location within AWS DataSync.
    16  //
    17  // > **NOTE:** The DataSync Agents must be available before creating this resource.
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
    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 := datasync.NewLocationSmb(ctx, "example", &datasync.LocationSmbArgs{
    35  //				ServerHostname: pulumi.String("smb.example.com"),
    36  //				Subdirectory:   pulumi.String("/exported/path"),
    37  //				User:           pulumi.String("Guest"),
    38  //				Password:       pulumi.String("ANotGreatPassword"),
    39  //				AgentArns: pulumi.StringArray{
    40  //					exampleAwsDatasyncAgent.Arn,
    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 `aws_datasync_location_smb` using the Amazon Resource Name (ARN). For example:
    56  //
    57  // ```sh
    58  // $ pulumi import aws:datasync/locationSmb:LocationSmb example arn:aws:datasync:us-east-1:123456789012:location/loc-12345678901234567
    59  // ```
    60  type LocationSmb struct {
    61  	pulumi.CustomResourceState
    62  
    63  	// A list of DataSync Agent ARNs with which this location will be associated.
    64  	AgentArns pulumi.StringArrayOutput `pulumi:"agentArns"`
    65  	// Amazon Resource Name (ARN) of the DataSync Location.
    66  	Arn pulumi.StringOutput `pulumi:"arn"`
    67  	// The name of the Windows domain the SMB server belongs to.
    68  	Domain pulumi.StringOutput `pulumi:"domain"`
    69  	// Configuration block containing mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
    70  	MountOptions LocationSmbMountOptionsPtrOutput `pulumi:"mountOptions"`
    71  	// The password of the user who can mount the share and has file permissions in the SMB.
    72  	Password pulumi.StringOutput `pulumi:"password"`
    73  	// Specifies the IP address or DNS name of the SMB server. The DataSync Agent(s) use this to mount the SMB share.
    74  	ServerHostname pulumi.StringOutput `pulumi:"serverHostname"`
    75  	// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
    76  	Subdirectory pulumi.StringOutput `pulumi:"subdirectory"`
    77  	// Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    78  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    79  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    80  	//
    81  	// Deprecated: Please use `tags` instead.
    82  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    83  	Uri     pulumi.StringOutput    `pulumi:"uri"`
    84  	// The user who can mount the share and has file and folder permissions in the SMB share.
    85  	User pulumi.StringOutput `pulumi:"user"`
    86  }
    87  
    88  // NewLocationSmb registers a new resource with the given unique name, arguments, and options.
    89  func NewLocationSmb(ctx *pulumi.Context,
    90  	name string, args *LocationSmbArgs, opts ...pulumi.ResourceOption) (*LocationSmb, error) {
    91  	if args == nil {
    92  		return nil, errors.New("missing one or more required arguments")
    93  	}
    94  
    95  	if args.AgentArns == nil {
    96  		return nil, errors.New("invalid value for required argument 'AgentArns'")
    97  	}
    98  	if args.Password == nil {
    99  		return nil, errors.New("invalid value for required argument 'Password'")
   100  	}
   101  	if args.ServerHostname == nil {
   102  		return nil, errors.New("invalid value for required argument 'ServerHostname'")
   103  	}
   104  	if args.Subdirectory == nil {
   105  		return nil, errors.New("invalid value for required argument 'Subdirectory'")
   106  	}
   107  	if args.User == nil {
   108  		return nil, errors.New("invalid value for required argument 'User'")
   109  	}
   110  	if args.Password != nil {
   111  		args.Password = pulumi.ToSecret(args.Password).(pulumi.StringInput)
   112  	}
   113  	secrets := pulumi.AdditionalSecretOutputs([]string{
   114  		"password",
   115  	})
   116  	opts = append(opts, secrets)
   117  	opts = internal.PkgResourceDefaultOpts(opts)
   118  	var resource LocationSmb
   119  	err := ctx.RegisterResource("aws:datasync/locationSmb:LocationSmb", name, args, &resource, opts...)
   120  	if err != nil {
   121  		return nil, err
   122  	}
   123  	return &resource, nil
   124  }
   125  
   126  // GetLocationSmb gets an existing LocationSmb resource's state with the given name, ID, and optional
   127  // state properties that are used to uniquely qualify the lookup (nil if not required).
   128  func GetLocationSmb(ctx *pulumi.Context,
   129  	name string, id pulumi.IDInput, state *LocationSmbState, opts ...pulumi.ResourceOption) (*LocationSmb, error) {
   130  	var resource LocationSmb
   131  	err := ctx.ReadResource("aws:datasync/locationSmb:LocationSmb", name, id, state, &resource, opts...)
   132  	if err != nil {
   133  		return nil, err
   134  	}
   135  	return &resource, nil
   136  }
   137  
   138  // Input properties used for looking up and filtering LocationSmb resources.
   139  type locationSmbState struct {
   140  	// A list of DataSync Agent ARNs with which this location will be associated.
   141  	AgentArns []string `pulumi:"agentArns"`
   142  	// Amazon Resource Name (ARN) of the DataSync Location.
   143  	Arn *string `pulumi:"arn"`
   144  	// The name of the Windows domain the SMB server belongs to.
   145  	Domain *string `pulumi:"domain"`
   146  	// Configuration block containing mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
   147  	MountOptions *LocationSmbMountOptions `pulumi:"mountOptions"`
   148  	// The password of the user who can mount the share and has file permissions in the SMB.
   149  	Password *string `pulumi:"password"`
   150  	// Specifies the IP address or DNS name of the SMB server. The DataSync Agent(s) use this to mount the SMB share.
   151  	ServerHostname *string `pulumi:"serverHostname"`
   152  	// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
   153  	Subdirectory *string `pulumi:"subdirectory"`
   154  	// Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   155  	Tags map[string]string `pulumi:"tags"`
   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 map[string]string `pulumi:"tagsAll"`
   160  	Uri     *string           `pulumi:"uri"`
   161  	// The user who can mount the share and has file and folder permissions in the SMB share.
   162  	User *string `pulumi:"user"`
   163  }
   164  
   165  type LocationSmbState struct {
   166  	// A list of DataSync Agent ARNs with which this location will be associated.
   167  	AgentArns pulumi.StringArrayInput
   168  	// Amazon Resource Name (ARN) of the DataSync Location.
   169  	Arn pulumi.StringPtrInput
   170  	// The name of the Windows domain the SMB server belongs to.
   171  	Domain pulumi.StringPtrInput
   172  	// Configuration block containing mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
   173  	MountOptions LocationSmbMountOptionsPtrInput
   174  	// The password of the user who can mount the share and has file permissions in the SMB.
   175  	Password pulumi.StringPtrInput
   176  	// Specifies the IP address or DNS name of the SMB server. The DataSync Agent(s) use this to mount the SMB share.
   177  	ServerHostname pulumi.StringPtrInput
   178  	// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
   179  	Subdirectory pulumi.StringPtrInput
   180  	// Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   181  	Tags pulumi.StringMapInput
   182  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   183  	//
   184  	// Deprecated: Please use `tags` instead.
   185  	TagsAll pulumi.StringMapInput
   186  	Uri     pulumi.StringPtrInput
   187  	// The user who can mount the share and has file and folder permissions in the SMB share.
   188  	User pulumi.StringPtrInput
   189  }
   190  
   191  func (LocationSmbState) ElementType() reflect.Type {
   192  	return reflect.TypeOf((*locationSmbState)(nil)).Elem()
   193  }
   194  
   195  type locationSmbArgs struct {
   196  	// A list of DataSync Agent ARNs with which this location will be associated.
   197  	AgentArns []string `pulumi:"agentArns"`
   198  	// The name of the Windows domain the SMB server belongs to.
   199  	Domain *string `pulumi:"domain"`
   200  	// Configuration block containing mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
   201  	MountOptions *LocationSmbMountOptions `pulumi:"mountOptions"`
   202  	// The password of the user who can mount the share and has file permissions in the SMB.
   203  	Password string `pulumi:"password"`
   204  	// Specifies the IP address or DNS name of the SMB server. The DataSync Agent(s) use this to mount the SMB share.
   205  	ServerHostname string `pulumi:"serverHostname"`
   206  	// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
   207  	Subdirectory string `pulumi:"subdirectory"`
   208  	// Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   209  	Tags map[string]string `pulumi:"tags"`
   210  	// The user who can mount the share and has file and folder permissions in the SMB share.
   211  	User string `pulumi:"user"`
   212  }
   213  
   214  // The set of arguments for constructing a LocationSmb resource.
   215  type LocationSmbArgs struct {
   216  	// A list of DataSync Agent ARNs with which this location will be associated.
   217  	AgentArns pulumi.StringArrayInput
   218  	// The name of the Windows domain the SMB server belongs to.
   219  	Domain pulumi.StringPtrInput
   220  	// Configuration block containing mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
   221  	MountOptions LocationSmbMountOptionsPtrInput
   222  	// The password of the user who can mount the share and has file permissions in the SMB.
   223  	Password pulumi.StringInput
   224  	// Specifies the IP address or DNS name of the SMB server. The DataSync Agent(s) use this to mount the SMB share.
   225  	ServerHostname pulumi.StringInput
   226  	// Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
   227  	Subdirectory pulumi.StringInput
   228  	// Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   229  	Tags pulumi.StringMapInput
   230  	// The user who can mount the share and has file and folder permissions in the SMB share.
   231  	User pulumi.StringInput
   232  }
   233  
   234  func (LocationSmbArgs) ElementType() reflect.Type {
   235  	return reflect.TypeOf((*locationSmbArgs)(nil)).Elem()
   236  }
   237  
   238  type LocationSmbInput interface {
   239  	pulumi.Input
   240  
   241  	ToLocationSmbOutput() LocationSmbOutput
   242  	ToLocationSmbOutputWithContext(ctx context.Context) LocationSmbOutput
   243  }
   244  
   245  func (*LocationSmb) ElementType() reflect.Type {
   246  	return reflect.TypeOf((**LocationSmb)(nil)).Elem()
   247  }
   248  
   249  func (i *LocationSmb) ToLocationSmbOutput() LocationSmbOutput {
   250  	return i.ToLocationSmbOutputWithContext(context.Background())
   251  }
   252  
   253  func (i *LocationSmb) ToLocationSmbOutputWithContext(ctx context.Context) LocationSmbOutput {
   254  	return pulumi.ToOutputWithContext(ctx, i).(LocationSmbOutput)
   255  }
   256  
   257  // LocationSmbArrayInput is an input type that accepts LocationSmbArray and LocationSmbArrayOutput values.
   258  // You can construct a concrete instance of `LocationSmbArrayInput` via:
   259  //
   260  //	LocationSmbArray{ LocationSmbArgs{...} }
   261  type LocationSmbArrayInput interface {
   262  	pulumi.Input
   263  
   264  	ToLocationSmbArrayOutput() LocationSmbArrayOutput
   265  	ToLocationSmbArrayOutputWithContext(context.Context) LocationSmbArrayOutput
   266  }
   267  
   268  type LocationSmbArray []LocationSmbInput
   269  
   270  func (LocationSmbArray) ElementType() reflect.Type {
   271  	return reflect.TypeOf((*[]*LocationSmb)(nil)).Elem()
   272  }
   273  
   274  func (i LocationSmbArray) ToLocationSmbArrayOutput() LocationSmbArrayOutput {
   275  	return i.ToLocationSmbArrayOutputWithContext(context.Background())
   276  }
   277  
   278  func (i LocationSmbArray) ToLocationSmbArrayOutputWithContext(ctx context.Context) LocationSmbArrayOutput {
   279  	return pulumi.ToOutputWithContext(ctx, i).(LocationSmbArrayOutput)
   280  }
   281  
   282  // LocationSmbMapInput is an input type that accepts LocationSmbMap and LocationSmbMapOutput values.
   283  // You can construct a concrete instance of `LocationSmbMapInput` via:
   284  //
   285  //	LocationSmbMap{ "key": LocationSmbArgs{...} }
   286  type LocationSmbMapInput interface {
   287  	pulumi.Input
   288  
   289  	ToLocationSmbMapOutput() LocationSmbMapOutput
   290  	ToLocationSmbMapOutputWithContext(context.Context) LocationSmbMapOutput
   291  }
   292  
   293  type LocationSmbMap map[string]LocationSmbInput
   294  
   295  func (LocationSmbMap) ElementType() reflect.Type {
   296  	return reflect.TypeOf((*map[string]*LocationSmb)(nil)).Elem()
   297  }
   298  
   299  func (i LocationSmbMap) ToLocationSmbMapOutput() LocationSmbMapOutput {
   300  	return i.ToLocationSmbMapOutputWithContext(context.Background())
   301  }
   302  
   303  func (i LocationSmbMap) ToLocationSmbMapOutputWithContext(ctx context.Context) LocationSmbMapOutput {
   304  	return pulumi.ToOutputWithContext(ctx, i).(LocationSmbMapOutput)
   305  }
   306  
   307  type LocationSmbOutput struct{ *pulumi.OutputState }
   308  
   309  func (LocationSmbOutput) ElementType() reflect.Type {
   310  	return reflect.TypeOf((**LocationSmb)(nil)).Elem()
   311  }
   312  
   313  func (o LocationSmbOutput) ToLocationSmbOutput() LocationSmbOutput {
   314  	return o
   315  }
   316  
   317  func (o LocationSmbOutput) ToLocationSmbOutputWithContext(ctx context.Context) LocationSmbOutput {
   318  	return o
   319  }
   320  
   321  // A list of DataSync Agent ARNs with which this location will be associated.
   322  func (o LocationSmbOutput) AgentArns() pulumi.StringArrayOutput {
   323  	return o.ApplyT(func(v *LocationSmb) pulumi.StringArrayOutput { return v.AgentArns }).(pulumi.StringArrayOutput)
   324  }
   325  
   326  // Amazon Resource Name (ARN) of the DataSync Location.
   327  func (o LocationSmbOutput) Arn() pulumi.StringOutput {
   328  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   329  }
   330  
   331  // The name of the Windows domain the SMB server belongs to.
   332  func (o LocationSmbOutput) Domain() pulumi.StringOutput {
   333  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput)
   334  }
   335  
   336  // Configuration block containing mount options used by DataSync to access the SMB Server. Can be `AUTOMATIC`, `SMB2`, or `SMB3`.
   337  func (o LocationSmbOutput) MountOptions() LocationSmbMountOptionsPtrOutput {
   338  	return o.ApplyT(func(v *LocationSmb) LocationSmbMountOptionsPtrOutput { return v.MountOptions }).(LocationSmbMountOptionsPtrOutput)
   339  }
   340  
   341  // The password of the user who can mount the share and has file permissions in the SMB.
   342  func (o LocationSmbOutput) Password() pulumi.StringOutput {
   343  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.Password }).(pulumi.StringOutput)
   344  }
   345  
   346  // Specifies the IP address or DNS name of the SMB server. The DataSync Agent(s) use this to mount the SMB share.
   347  func (o LocationSmbOutput) ServerHostname() pulumi.StringOutput {
   348  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.ServerHostname }).(pulumi.StringOutput)
   349  }
   350  
   351  // Subdirectory to perform actions as source or destination. Should be exported by the NFS server.
   352  func (o LocationSmbOutput) Subdirectory() pulumi.StringOutput {
   353  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.Subdirectory }).(pulumi.StringOutput)
   354  }
   355  
   356  // Key-value pairs of resource tags to assign to the DataSync Location. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   357  func (o LocationSmbOutput) Tags() pulumi.StringMapOutput {
   358  	return o.ApplyT(func(v *LocationSmb) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   359  }
   360  
   361  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   362  //
   363  // Deprecated: Please use `tags` instead.
   364  func (o LocationSmbOutput) TagsAll() pulumi.StringMapOutput {
   365  	return o.ApplyT(func(v *LocationSmb) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   366  }
   367  
   368  func (o LocationSmbOutput) Uri() pulumi.StringOutput {
   369  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.Uri }).(pulumi.StringOutput)
   370  }
   371  
   372  // The user who can mount the share and has file and folder permissions in the SMB share.
   373  func (o LocationSmbOutput) User() pulumi.StringOutput {
   374  	return o.ApplyT(func(v *LocationSmb) pulumi.StringOutput { return v.User }).(pulumi.StringOutput)
   375  }
   376  
   377  type LocationSmbArrayOutput struct{ *pulumi.OutputState }
   378  
   379  func (LocationSmbArrayOutput) ElementType() reflect.Type {
   380  	return reflect.TypeOf((*[]*LocationSmb)(nil)).Elem()
   381  }
   382  
   383  func (o LocationSmbArrayOutput) ToLocationSmbArrayOutput() LocationSmbArrayOutput {
   384  	return o
   385  }
   386  
   387  func (o LocationSmbArrayOutput) ToLocationSmbArrayOutputWithContext(ctx context.Context) LocationSmbArrayOutput {
   388  	return o
   389  }
   390  
   391  func (o LocationSmbArrayOutput) Index(i pulumi.IntInput) LocationSmbOutput {
   392  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LocationSmb {
   393  		return vs[0].([]*LocationSmb)[vs[1].(int)]
   394  	}).(LocationSmbOutput)
   395  }
   396  
   397  type LocationSmbMapOutput struct{ *pulumi.OutputState }
   398  
   399  func (LocationSmbMapOutput) ElementType() reflect.Type {
   400  	return reflect.TypeOf((*map[string]*LocationSmb)(nil)).Elem()
   401  }
   402  
   403  func (o LocationSmbMapOutput) ToLocationSmbMapOutput() LocationSmbMapOutput {
   404  	return o
   405  }
   406  
   407  func (o LocationSmbMapOutput) ToLocationSmbMapOutputWithContext(ctx context.Context) LocationSmbMapOutput {
   408  	return o
   409  }
   410  
   411  func (o LocationSmbMapOutput) MapIndex(k pulumi.StringInput) LocationSmbOutput {
   412  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LocationSmb {
   413  		return vs[0].(map[string]*LocationSmb)[vs[1].(string)]
   414  	}).(LocationSmbOutput)
   415  }
   416  
   417  func init() {
   418  	pulumi.RegisterInputType(reflect.TypeOf((*LocationSmbInput)(nil)).Elem(), &LocationSmb{})
   419  	pulumi.RegisterInputType(reflect.TypeOf((*LocationSmbArrayInput)(nil)).Elem(), LocationSmbArray{})
   420  	pulumi.RegisterInputType(reflect.TypeOf((*LocationSmbMapInput)(nil)).Elem(), LocationSmbMap{})
   421  	pulumi.RegisterOutputType(LocationSmbOutput{})
   422  	pulumi.RegisterOutputType(LocationSmbArrayOutput{})
   423  	pulumi.RegisterOutputType(LocationSmbMapOutput{})
   424  }