github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/datasync/efsLocation.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 an AWS DataSync EFS Location.
    16  //
    17  // > **NOTE:** The EFS File System must have a mounted EFS Mount Target 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"
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			_, err := datasync.NewEfsLocation(ctx, "example", &datasync.EfsLocationArgs{
    36  //				EfsFileSystemArn: pulumi.Any(exampleAwsEfsMountTarget.FileSystemArn),
    37  //				Ec2Config: &datasync.EfsLocationEc2ConfigArgs{
    38  //					SecurityGroupArns: pulumi.StringArray{
    39  //						exampleAwsSecurityGroup.Arn,
    40  //					},
    41  //					SubnetArn: pulumi.Any(exampleAwsSubnet.Arn),
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import `aws_datasync_location_efs` using the DataSync Task Amazon Resource Name (ARN). For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:datasync/efsLocation:EfsLocation example arn:aws:datasync:us-east-1:123456789012:location/loc-12345678901234567
    60  // ```
    61  type EfsLocation struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
    65  	AccessPointArn pulumi.StringPtrOutput `pulumi:"accessPointArn"`
    66  	// Amazon Resource Name (ARN) of the DataSync Location.
    67  	Arn pulumi.StringOutput `pulumi:"arn"`
    68  	// Configuration block containing EC2 configurations for connecting to the EFS File System.
    69  	Ec2Config EfsLocationEc2ConfigOutput `pulumi:"ec2Config"`
    70  	// Amazon Resource Name (ARN) of EFS File System.
    71  	EfsFileSystemArn pulumi.StringOutput `pulumi:"efsFileSystemArn"`
    72  	// Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
    73  	FileSystemAccessRoleArn pulumi.StringPtrOutput `pulumi:"fileSystemAccessRoleArn"`
    74  	// Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are `NONE` and `TLS1_2`.
    75  	InTransitEncryption pulumi.StringPtrOutput `pulumi:"inTransitEncryption"`
    76  	// Subdirectory to perform actions as source or destination. Default `/`.
    77  	Subdirectory pulumi.StringPtrOutput `pulumi:"subdirectory"`
    78  	// 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.
    79  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    80  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    81  	//
    82  	// Deprecated: Please use `tags` instead.
    83  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    84  	Uri     pulumi.StringOutput    `pulumi:"uri"`
    85  }
    86  
    87  // NewEfsLocation registers a new resource with the given unique name, arguments, and options.
    88  func NewEfsLocation(ctx *pulumi.Context,
    89  	name string, args *EfsLocationArgs, opts ...pulumi.ResourceOption) (*EfsLocation, error) {
    90  	if args == nil {
    91  		return nil, errors.New("missing one or more required arguments")
    92  	}
    93  
    94  	if args.Ec2Config == nil {
    95  		return nil, errors.New("invalid value for required argument 'Ec2Config'")
    96  	}
    97  	if args.EfsFileSystemArn == nil {
    98  		return nil, errors.New("invalid value for required argument 'EfsFileSystemArn'")
    99  	}
   100  	opts = internal.PkgResourceDefaultOpts(opts)
   101  	var resource EfsLocation
   102  	err := ctx.RegisterResource("aws:datasync/efsLocation:EfsLocation", name, args, &resource, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return &resource, nil
   107  }
   108  
   109  // GetEfsLocation gets an existing EfsLocation resource's state with the given name, ID, and optional
   110  // state properties that are used to uniquely qualify the lookup (nil if not required).
   111  func GetEfsLocation(ctx *pulumi.Context,
   112  	name string, id pulumi.IDInput, state *EfsLocationState, opts ...pulumi.ResourceOption) (*EfsLocation, error) {
   113  	var resource EfsLocation
   114  	err := ctx.ReadResource("aws:datasync/efsLocation:EfsLocation", name, id, state, &resource, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	return &resource, nil
   119  }
   120  
   121  // Input properties used for looking up and filtering EfsLocation resources.
   122  type efsLocationState struct {
   123  	// Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
   124  	AccessPointArn *string `pulumi:"accessPointArn"`
   125  	// Amazon Resource Name (ARN) of the DataSync Location.
   126  	Arn *string `pulumi:"arn"`
   127  	// Configuration block containing EC2 configurations for connecting to the EFS File System.
   128  	Ec2Config *EfsLocationEc2Config `pulumi:"ec2Config"`
   129  	// Amazon Resource Name (ARN) of EFS File System.
   130  	EfsFileSystemArn *string `pulumi:"efsFileSystemArn"`
   131  	// Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
   132  	FileSystemAccessRoleArn *string `pulumi:"fileSystemAccessRoleArn"`
   133  	// Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are `NONE` and `TLS1_2`.
   134  	InTransitEncryption *string `pulumi:"inTransitEncryption"`
   135  	// Subdirectory to perform actions as source or destination. Default `/`.
   136  	Subdirectory *string `pulumi:"subdirectory"`
   137  	// 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.
   138  	Tags map[string]string `pulumi:"tags"`
   139  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   140  	//
   141  	// Deprecated: Please use `tags` instead.
   142  	TagsAll map[string]string `pulumi:"tagsAll"`
   143  	Uri     *string           `pulumi:"uri"`
   144  }
   145  
   146  type EfsLocationState struct {
   147  	// Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
   148  	AccessPointArn pulumi.StringPtrInput
   149  	// Amazon Resource Name (ARN) of the DataSync Location.
   150  	Arn pulumi.StringPtrInput
   151  	// Configuration block containing EC2 configurations for connecting to the EFS File System.
   152  	Ec2Config EfsLocationEc2ConfigPtrInput
   153  	// Amazon Resource Name (ARN) of EFS File System.
   154  	EfsFileSystemArn pulumi.StringPtrInput
   155  	// Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
   156  	FileSystemAccessRoleArn pulumi.StringPtrInput
   157  	// Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are `NONE` and `TLS1_2`.
   158  	InTransitEncryption pulumi.StringPtrInput
   159  	// Subdirectory to perform actions as source or destination. Default `/`.
   160  	Subdirectory pulumi.StringPtrInput
   161  	// 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.
   162  	Tags pulumi.StringMapInput
   163  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   164  	//
   165  	// Deprecated: Please use `tags` instead.
   166  	TagsAll pulumi.StringMapInput
   167  	Uri     pulumi.StringPtrInput
   168  }
   169  
   170  func (EfsLocationState) ElementType() reflect.Type {
   171  	return reflect.TypeOf((*efsLocationState)(nil)).Elem()
   172  }
   173  
   174  type efsLocationArgs struct {
   175  	// Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
   176  	AccessPointArn *string `pulumi:"accessPointArn"`
   177  	// Configuration block containing EC2 configurations for connecting to the EFS File System.
   178  	Ec2Config EfsLocationEc2Config `pulumi:"ec2Config"`
   179  	// Amazon Resource Name (ARN) of EFS File System.
   180  	EfsFileSystemArn string `pulumi:"efsFileSystemArn"`
   181  	// Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
   182  	FileSystemAccessRoleArn *string `pulumi:"fileSystemAccessRoleArn"`
   183  	// Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are `NONE` and `TLS1_2`.
   184  	InTransitEncryption *string `pulumi:"inTransitEncryption"`
   185  	// Subdirectory to perform actions as source or destination. Default `/`.
   186  	Subdirectory *string `pulumi:"subdirectory"`
   187  	// 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.
   188  	Tags map[string]string `pulumi:"tags"`
   189  }
   190  
   191  // The set of arguments for constructing a EfsLocation resource.
   192  type EfsLocationArgs struct {
   193  	// Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
   194  	AccessPointArn pulumi.StringPtrInput
   195  	// Configuration block containing EC2 configurations for connecting to the EFS File System.
   196  	Ec2Config EfsLocationEc2ConfigInput
   197  	// Amazon Resource Name (ARN) of EFS File System.
   198  	EfsFileSystemArn pulumi.StringInput
   199  	// Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
   200  	FileSystemAccessRoleArn pulumi.StringPtrInput
   201  	// Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are `NONE` and `TLS1_2`.
   202  	InTransitEncryption pulumi.StringPtrInput
   203  	// Subdirectory to perform actions as source or destination. Default `/`.
   204  	Subdirectory pulumi.StringPtrInput
   205  	// 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.
   206  	Tags pulumi.StringMapInput
   207  }
   208  
   209  func (EfsLocationArgs) ElementType() reflect.Type {
   210  	return reflect.TypeOf((*efsLocationArgs)(nil)).Elem()
   211  }
   212  
   213  type EfsLocationInput interface {
   214  	pulumi.Input
   215  
   216  	ToEfsLocationOutput() EfsLocationOutput
   217  	ToEfsLocationOutputWithContext(ctx context.Context) EfsLocationOutput
   218  }
   219  
   220  func (*EfsLocation) ElementType() reflect.Type {
   221  	return reflect.TypeOf((**EfsLocation)(nil)).Elem()
   222  }
   223  
   224  func (i *EfsLocation) ToEfsLocationOutput() EfsLocationOutput {
   225  	return i.ToEfsLocationOutputWithContext(context.Background())
   226  }
   227  
   228  func (i *EfsLocation) ToEfsLocationOutputWithContext(ctx context.Context) EfsLocationOutput {
   229  	return pulumi.ToOutputWithContext(ctx, i).(EfsLocationOutput)
   230  }
   231  
   232  // EfsLocationArrayInput is an input type that accepts EfsLocationArray and EfsLocationArrayOutput values.
   233  // You can construct a concrete instance of `EfsLocationArrayInput` via:
   234  //
   235  //	EfsLocationArray{ EfsLocationArgs{...} }
   236  type EfsLocationArrayInput interface {
   237  	pulumi.Input
   238  
   239  	ToEfsLocationArrayOutput() EfsLocationArrayOutput
   240  	ToEfsLocationArrayOutputWithContext(context.Context) EfsLocationArrayOutput
   241  }
   242  
   243  type EfsLocationArray []EfsLocationInput
   244  
   245  func (EfsLocationArray) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*[]*EfsLocation)(nil)).Elem()
   247  }
   248  
   249  func (i EfsLocationArray) ToEfsLocationArrayOutput() EfsLocationArrayOutput {
   250  	return i.ToEfsLocationArrayOutputWithContext(context.Background())
   251  }
   252  
   253  func (i EfsLocationArray) ToEfsLocationArrayOutputWithContext(ctx context.Context) EfsLocationArrayOutput {
   254  	return pulumi.ToOutputWithContext(ctx, i).(EfsLocationArrayOutput)
   255  }
   256  
   257  // EfsLocationMapInput is an input type that accepts EfsLocationMap and EfsLocationMapOutput values.
   258  // You can construct a concrete instance of `EfsLocationMapInput` via:
   259  //
   260  //	EfsLocationMap{ "key": EfsLocationArgs{...} }
   261  type EfsLocationMapInput interface {
   262  	pulumi.Input
   263  
   264  	ToEfsLocationMapOutput() EfsLocationMapOutput
   265  	ToEfsLocationMapOutputWithContext(context.Context) EfsLocationMapOutput
   266  }
   267  
   268  type EfsLocationMap map[string]EfsLocationInput
   269  
   270  func (EfsLocationMap) ElementType() reflect.Type {
   271  	return reflect.TypeOf((*map[string]*EfsLocation)(nil)).Elem()
   272  }
   273  
   274  func (i EfsLocationMap) ToEfsLocationMapOutput() EfsLocationMapOutput {
   275  	return i.ToEfsLocationMapOutputWithContext(context.Background())
   276  }
   277  
   278  func (i EfsLocationMap) ToEfsLocationMapOutputWithContext(ctx context.Context) EfsLocationMapOutput {
   279  	return pulumi.ToOutputWithContext(ctx, i).(EfsLocationMapOutput)
   280  }
   281  
   282  type EfsLocationOutput struct{ *pulumi.OutputState }
   283  
   284  func (EfsLocationOutput) ElementType() reflect.Type {
   285  	return reflect.TypeOf((**EfsLocation)(nil)).Elem()
   286  }
   287  
   288  func (o EfsLocationOutput) ToEfsLocationOutput() EfsLocationOutput {
   289  	return o
   290  }
   291  
   292  func (o EfsLocationOutput) ToEfsLocationOutputWithContext(ctx context.Context) EfsLocationOutput {
   293  	return o
   294  }
   295  
   296  // Specifies the Amazon Resource Name (ARN) of the access point that DataSync uses to access the Amazon EFS file system.
   297  func (o EfsLocationOutput) AccessPointArn() pulumi.StringPtrOutput {
   298  	return o.ApplyT(func(v *EfsLocation) pulumi.StringPtrOutput { return v.AccessPointArn }).(pulumi.StringPtrOutput)
   299  }
   300  
   301  // Amazon Resource Name (ARN) of the DataSync Location.
   302  func (o EfsLocationOutput) Arn() pulumi.StringOutput {
   303  	return o.ApplyT(func(v *EfsLocation) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   304  }
   305  
   306  // Configuration block containing EC2 configurations for connecting to the EFS File System.
   307  func (o EfsLocationOutput) Ec2Config() EfsLocationEc2ConfigOutput {
   308  	return o.ApplyT(func(v *EfsLocation) EfsLocationEc2ConfigOutput { return v.Ec2Config }).(EfsLocationEc2ConfigOutput)
   309  }
   310  
   311  // Amazon Resource Name (ARN) of EFS File System.
   312  func (o EfsLocationOutput) EfsFileSystemArn() pulumi.StringOutput {
   313  	return o.ApplyT(func(v *EfsLocation) pulumi.StringOutput { return v.EfsFileSystemArn }).(pulumi.StringOutput)
   314  }
   315  
   316  // Specifies an Identity and Access Management (IAM) role that DataSync assumes when mounting the Amazon EFS file system.
   317  func (o EfsLocationOutput) FileSystemAccessRoleArn() pulumi.StringPtrOutput {
   318  	return o.ApplyT(func(v *EfsLocation) pulumi.StringPtrOutput { return v.FileSystemAccessRoleArn }).(pulumi.StringPtrOutput)
   319  }
   320  
   321  // Specifies whether you want DataSync to use TLS encryption when transferring data to or from your Amazon EFS file system. Valid values are `NONE` and `TLS1_2`.
   322  func (o EfsLocationOutput) InTransitEncryption() pulumi.StringPtrOutput {
   323  	return o.ApplyT(func(v *EfsLocation) pulumi.StringPtrOutput { return v.InTransitEncryption }).(pulumi.StringPtrOutput)
   324  }
   325  
   326  // Subdirectory to perform actions as source or destination. Default `/`.
   327  func (o EfsLocationOutput) Subdirectory() pulumi.StringPtrOutput {
   328  	return o.ApplyT(func(v *EfsLocation) pulumi.StringPtrOutput { return v.Subdirectory }).(pulumi.StringPtrOutput)
   329  }
   330  
   331  // 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.
   332  func (o EfsLocationOutput) Tags() pulumi.StringMapOutput {
   333  	return o.ApplyT(func(v *EfsLocation) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   334  }
   335  
   336  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   337  //
   338  // Deprecated: Please use `tags` instead.
   339  func (o EfsLocationOutput) TagsAll() pulumi.StringMapOutput {
   340  	return o.ApplyT(func(v *EfsLocation) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   341  }
   342  
   343  func (o EfsLocationOutput) Uri() pulumi.StringOutput {
   344  	return o.ApplyT(func(v *EfsLocation) pulumi.StringOutput { return v.Uri }).(pulumi.StringOutput)
   345  }
   346  
   347  type EfsLocationArrayOutput struct{ *pulumi.OutputState }
   348  
   349  func (EfsLocationArrayOutput) ElementType() reflect.Type {
   350  	return reflect.TypeOf((*[]*EfsLocation)(nil)).Elem()
   351  }
   352  
   353  func (o EfsLocationArrayOutput) ToEfsLocationArrayOutput() EfsLocationArrayOutput {
   354  	return o
   355  }
   356  
   357  func (o EfsLocationArrayOutput) ToEfsLocationArrayOutputWithContext(ctx context.Context) EfsLocationArrayOutput {
   358  	return o
   359  }
   360  
   361  func (o EfsLocationArrayOutput) Index(i pulumi.IntInput) EfsLocationOutput {
   362  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EfsLocation {
   363  		return vs[0].([]*EfsLocation)[vs[1].(int)]
   364  	}).(EfsLocationOutput)
   365  }
   366  
   367  type EfsLocationMapOutput struct{ *pulumi.OutputState }
   368  
   369  func (EfsLocationMapOutput) ElementType() reflect.Type {
   370  	return reflect.TypeOf((*map[string]*EfsLocation)(nil)).Elem()
   371  }
   372  
   373  func (o EfsLocationMapOutput) ToEfsLocationMapOutput() EfsLocationMapOutput {
   374  	return o
   375  }
   376  
   377  func (o EfsLocationMapOutput) ToEfsLocationMapOutputWithContext(ctx context.Context) EfsLocationMapOutput {
   378  	return o
   379  }
   380  
   381  func (o EfsLocationMapOutput) MapIndex(k pulumi.StringInput) EfsLocationOutput {
   382  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EfsLocation {
   383  		return vs[0].(map[string]*EfsLocation)[vs[1].(string)]
   384  	}).(EfsLocationOutput)
   385  }
   386  
   387  func init() {
   388  	pulumi.RegisterInputType(reflect.TypeOf((*EfsLocationInput)(nil)).Elem(), &EfsLocation{})
   389  	pulumi.RegisterInputType(reflect.TypeOf((*EfsLocationArrayInput)(nil)).Elem(), EfsLocationArray{})
   390  	pulumi.RegisterInputType(reflect.TypeOf((*EfsLocationMapInput)(nil)).Elem(), EfsLocationMap{})
   391  	pulumi.RegisterOutputType(EfsLocationOutput{})
   392  	pulumi.RegisterOutputType(EfsLocationArrayOutput{})
   393  	pulumi.RegisterOutputType(EfsLocationMapOutput{})
   394  }