github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/datasync/fsxOpenZfsFileSystem.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 FSx OpenZfs Location.
    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/datasync"
    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 := datasync.NewFsxOpenZfsFileSystem(ctx, "example", &datasync.FsxOpenZfsFileSystemArgs{
    33  //				FsxFilesystemArn: pulumi.Any(exampleAwsFsxOpenzfsFileSystem.Arn),
    34  //				SecurityGroupArns: pulumi.StringArray{
    35  //					exampleAwsSecurityGroup.Arn,
    36  //				},
    37  //				Protocol: &datasync.FsxOpenZfsFileSystemProtocolArgs{
    38  //					Nfs: &datasync.FsxOpenZfsFileSystemProtocolNfsArgs{
    39  //						MountOptions: &datasync.FsxOpenZfsFileSystemProtocolNfsMountOptionsArgs{
    40  //							Version: pulumi.String("AUTOMATIC"),
    41  //						},
    42  //					},
    43  //				},
    44  //			})
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ## Import
    56  //
    57  // Using `pulumi import`, import `aws_datasync_location_fsx_openzfs_file_system` using the `DataSync-ARN#FSx-openzfs-ARN`. For example:
    58  //
    59  // ```sh
    60  // $ pulumi import aws:datasync/fsxOpenZfsFileSystem:FsxOpenZfsFileSystem example arn:aws:datasync:us-west-2:123456789012:location/loc-12345678901234567#arn:aws:fsx:us-west-2:123456789012:file-system/fs-08e04cd442c1bb94a
    61  // ```
    62  type FsxOpenZfsFileSystem struct {
    63  	pulumi.CustomResourceState
    64  
    65  	// Amazon Resource Name (ARN) of the DataSync Location.
    66  	Arn pulumi.StringOutput `pulumi:"arn"`
    67  	// The time that the FSx for openzfs location was created.
    68  	CreationTime pulumi.StringOutput `pulumi:"creationTime"`
    69  	// The Amazon Resource Name (ARN) for the FSx for OpenZfs file system.
    70  	FsxFilesystemArn pulumi.StringOutput `pulumi:"fsxFilesystemArn"`
    71  	// The type of protocol that DataSync uses to access your file system. See below.
    72  	Protocol FsxOpenZfsFileSystemProtocolOutput `pulumi:"protocol"`
    73  	// The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for openzfs file system.
    74  	SecurityGroupArns pulumi.StringArrayOutput `pulumi:"securityGroupArns"`
    75  	// Subdirectory to perform actions as source or destination. Must start with `/fsx`.
    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  	// The URL of the FSx for openzfs location that was described.
    84  	Uri pulumi.StringOutput `pulumi:"uri"`
    85  }
    86  
    87  // NewFsxOpenZfsFileSystem registers a new resource with the given unique name, arguments, and options.
    88  func NewFsxOpenZfsFileSystem(ctx *pulumi.Context,
    89  	name string, args *FsxOpenZfsFileSystemArgs, opts ...pulumi.ResourceOption) (*FsxOpenZfsFileSystem, error) {
    90  	if args == nil {
    91  		return nil, errors.New("missing one or more required arguments")
    92  	}
    93  
    94  	if args.FsxFilesystemArn == nil {
    95  		return nil, errors.New("invalid value for required argument 'FsxFilesystemArn'")
    96  	}
    97  	if args.Protocol == nil {
    98  		return nil, errors.New("invalid value for required argument 'Protocol'")
    99  	}
   100  	if args.SecurityGroupArns == nil {
   101  		return nil, errors.New("invalid value for required argument 'SecurityGroupArns'")
   102  	}
   103  	opts = internal.PkgResourceDefaultOpts(opts)
   104  	var resource FsxOpenZfsFileSystem
   105  	err := ctx.RegisterResource("aws:datasync/fsxOpenZfsFileSystem:FsxOpenZfsFileSystem", name, args, &resource, opts...)
   106  	if err != nil {
   107  		return nil, err
   108  	}
   109  	return &resource, nil
   110  }
   111  
   112  // GetFsxOpenZfsFileSystem gets an existing FsxOpenZfsFileSystem resource's state with the given name, ID, and optional
   113  // state properties that are used to uniquely qualify the lookup (nil if not required).
   114  func GetFsxOpenZfsFileSystem(ctx *pulumi.Context,
   115  	name string, id pulumi.IDInput, state *FsxOpenZfsFileSystemState, opts ...pulumi.ResourceOption) (*FsxOpenZfsFileSystem, error) {
   116  	var resource FsxOpenZfsFileSystem
   117  	err := ctx.ReadResource("aws:datasync/fsxOpenZfsFileSystem:FsxOpenZfsFileSystem", name, id, state, &resource, opts...)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	return &resource, nil
   122  }
   123  
   124  // Input properties used for looking up and filtering FsxOpenZfsFileSystem resources.
   125  type fsxOpenZfsFileSystemState struct {
   126  	// Amazon Resource Name (ARN) of the DataSync Location.
   127  	Arn *string `pulumi:"arn"`
   128  	// The time that the FSx for openzfs location was created.
   129  	CreationTime *string `pulumi:"creationTime"`
   130  	// The Amazon Resource Name (ARN) for the FSx for OpenZfs file system.
   131  	FsxFilesystemArn *string `pulumi:"fsxFilesystemArn"`
   132  	// The type of protocol that DataSync uses to access your file system. See below.
   133  	Protocol *FsxOpenZfsFileSystemProtocol `pulumi:"protocol"`
   134  	// The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for openzfs file system.
   135  	SecurityGroupArns []string `pulumi:"securityGroupArns"`
   136  	// Subdirectory to perform actions as source or destination. Must start with `/fsx`.
   137  	Subdirectory *string `pulumi:"subdirectory"`
   138  	// 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.
   139  	Tags map[string]string `pulumi:"tags"`
   140  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   141  	//
   142  	// Deprecated: Please use `tags` instead.
   143  	TagsAll map[string]string `pulumi:"tagsAll"`
   144  	// The URL of the FSx for openzfs location that was described.
   145  	Uri *string `pulumi:"uri"`
   146  }
   147  
   148  type FsxOpenZfsFileSystemState struct {
   149  	// Amazon Resource Name (ARN) of the DataSync Location.
   150  	Arn pulumi.StringPtrInput
   151  	// The time that the FSx for openzfs location was created.
   152  	CreationTime pulumi.StringPtrInput
   153  	// The Amazon Resource Name (ARN) for the FSx for OpenZfs file system.
   154  	FsxFilesystemArn pulumi.StringPtrInput
   155  	// The type of protocol that DataSync uses to access your file system. See below.
   156  	Protocol FsxOpenZfsFileSystemProtocolPtrInput
   157  	// The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for openzfs file system.
   158  	SecurityGroupArns pulumi.StringArrayInput
   159  	// Subdirectory to perform actions as source or destination. Must start with `/fsx`.
   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  	// The URL of the FSx for openzfs location that was described.
   168  	Uri pulumi.StringPtrInput
   169  }
   170  
   171  func (FsxOpenZfsFileSystemState) ElementType() reflect.Type {
   172  	return reflect.TypeOf((*fsxOpenZfsFileSystemState)(nil)).Elem()
   173  }
   174  
   175  type fsxOpenZfsFileSystemArgs struct {
   176  	// The Amazon Resource Name (ARN) for the FSx for OpenZfs file system.
   177  	FsxFilesystemArn string `pulumi:"fsxFilesystemArn"`
   178  	// The type of protocol that DataSync uses to access your file system. See below.
   179  	Protocol FsxOpenZfsFileSystemProtocol `pulumi:"protocol"`
   180  	// The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for openzfs file system.
   181  	SecurityGroupArns []string `pulumi:"securityGroupArns"`
   182  	// Subdirectory to perform actions as source or destination. Must start with `/fsx`.
   183  	Subdirectory *string `pulumi:"subdirectory"`
   184  	// 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.
   185  	Tags map[string]string `pulumi:"tags"`
   186  }
   187  
   188  // The set of arguments for constructing a FsxOpenZfsFileSystem resource.
   189  type FsxOpenZfsFileSystemArgs struct {
   190  	// The Amazon Resource Name (ARN) for the FSx for OpenZfs file system.
   191  	FsxFilesystemArn pulumi.StringInput
   192  	// The type of protocol that DataSync uses to access your file system. See below.
   193  	Protocol FsxOpenZfsFileSystemProtocolInput
   194  	// The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for openzfs file system.
   195  	SecurityGroupArns pulumi.StringArrayInput
   196  	// Subdirectory to perform actions as source or destination. Must start with `/fsx`.
   197  	Subdirectory pulumi.StringPtrInput
   198  	// 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.
   199  	Tags pulumi.StringMapInput
   200  }
   201  
   202  func (FsxOpenZfsFileSystemArgs) ElementType() reflect.Type {
   203  	return reflect.TypeOf((*fsxOpenZfsFileSystemArgs)(nil)).Elem()
   204  }
   205  
   206  type FsxOpenZfsFileSystemInput interface {
   207  	pulumi.Input
   208  
   209  	ToFsxOpenZfsFileSystemOutput() FsxOpenZfsFileSystemOutput
   210  	ToFsxOpenZfsFileSystemOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemOutput
   211  }
   212  
   213  func (*FsxOpenZfsFileSystem) ElementType() reflect.Type {
   214  	return reflect.TypeOf((**FsxOpenZfsFileSystem)(nil)).Elem()
   215  }
   216  
   217  func (i *FsxOpenZfsFileSystem) ToFsxOpenZfsFileSystemOutput() FsxOpenZfsFileSystemOutput {
   218  	return i.ToFsxOpenZfsFileSystemOutputWithContext(context.Background())
   219  }
   220  
   221  func (i *FsxOpenZfsFileSystem) ToFsxOpenZfsFileSystemOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemOutput {
   222  	return pulumi.ToOutputWithContext(ctx, i).(FsxOpenZfsFileSystemOutput)
   223  }
   224  
   225  // FsxOpenZfsFileSystemArrayInput is an input type that accepts FsxOpenZfsFileSystemArray and FsxOpenZfsFileSystemArrayOutput values.
   226  // You can construct a concrete instance of `FsxOpenZfsFileSystemArrayInput` via:
   227  //
   228  //	FsxOpenZfsFileSystemArray{ FsxOpenZfsFileSystemArgs{...} }
   229  type FsxOpenZfsFileSystemArrayInput interface {
   230  	pulumi.Input
   231  
   232  	ToFsxOpenZfsFileSystemArrayOutput() FsxOpenZfsFileSystemArrayOutput
   233  	ToFsxOpenZfsFileSystemArrayOutputWithContext(context.Context) FsxOpenZfsFileSystemArrayOutput
   234  }
   235  
   236  type FsxOpenZfsFileSystemArray []FsxOpenZfsFileSystemInput
   237  
   238  func (FsxOpenZfsFileSystemArray) ElementType() reflect.Type {
   239  	return reflect.TypeOf((*[]*FsxOpenZfsFileSystem)(nil)).Elem()
   240  }
   241  
   242  func (i FsxOpenZfsFileSystemArray) ToFsxOpenZfsFileSystemArrayOutput() FsxOpenZfsFileSystemArrayOutput {
   243  	return i.ToFsxOpenZfsFileSystemArrayOutputWithContext(context.Background())
   244  }
   245  
   246  func (i FsxOpenZfsFileSystemArray) ToFsxOpenZfsFileSystemArrayOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemArrayOutput {
   247  	return pulumi.ToOutputWithContext(ctx, i).(FsxOpenZfsFileSystemArrayOutput)
   248  }
   249  
   250  // FsxOpenZfsFileSystemMapInput is an input type that accepts FsxOpenZfsFileSystemMap and FsxOpenZfsFileSystemMapOutput values.
   251  // You can construct a concrete instance of `FsxOpenZfsFileSystemMapInput` via:
   252  //
   253  //	FsxOpenZfsFileSystemMap{ "key": FsxOpenZfsFileSystemArgs{...} }
   254  type FsxOpenZfsFileSystemMapInput interface {
   255  	pulumi.Input
   256  
   257  	ToFsxOpenZfsFileSystemMapOutput() FsxOpenZfsFileSystemMapOutput
   258  	ToFsxOpenZfsFileSystemMapOutputWithContext(context.Context) FsxOpenZfsFileSystemMapOutput
   259  }
   260  
   261  type FsxOpenZfsFileSystemMap map[string]FsxOpenZfsFileSystemInput
   262  
   263  func (FsxOpenZfsFileSystemMap) ElementType() reflect.Type {
   264  	return reflect.TypeOf((*map[string]*FsxOpenZfsFileSystem)(nil)).Elem()
   265  }
   266  
   267  func (i FsxOpenZfsFileSystemMap) ToFsxOpenZfsFileSystemMapOutput() FsxOpenZfsFileSystemMapOutput {
   268  	return i.ToFsxOpenZfsFileSystemMapOutputWithContext(context.Background())
   269  }
   270  
   271  func (i FsxOpenZfsFileSystemMap) ToFsxOpenZfsFileSystemMapOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemMapOutput {
   272  	return pulumi.ToOutputWithContext(ctx, i).(FsxOpenZfsFileSystemMapOutput)
   273  }
   274  
   275  type FsxOpenZfsFileSystemOutput struct{ *pulumi.OutputState }
   276  
   277  func (FsxOpenZfsFileSystemOutput) ElementType() reflect.Type {
   278  	return reflect.TypeOf((**FsxOpenZfsFileSystem)(nil)).Elem()
   279  }
   280  
   281  func (o FsxOpenZfsFileSystemOutput) ToFsxOpenZfsFileSystemOutput() FsxOpenZfsFileSystemOutput {
   282  	return o
   283  }
   284  
   285  func (o FsxOpenZfsFileSystemOutput) ToFsxOpenZfsFileSystemOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemOutput {
   286  	return o
   287  }
   288  
   289  // Amazon Resource Name (ARN) of the DataSync Location.
   290  func (o FsxOpenZfsFileSystemOutput) Arn() pulumi.StringOutput {
   291  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   292  }
   293  
   294  // The time that the FSx for openzfs location was created.
   295  func (o FsxOpenZfsFileSystemOutput) CreationTime() pulumi.StringOutput {
   296  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringOutput { return v.CreationTime }).(pulumi.StringOutput)
   297  }
   298  
   299  // The Amazon Resource Name (ARN) for the FSx for OpenZfs file system.
   300  func (o FsxOpenZfsFileSystemOutput) FsxFilesystemArn() pulumi.StringOutput {
   301  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringOutput { return v.FsxFilesystemArn }).(pulumi.StringOutput)
   302  }
   303  
   304  // The type of protocol that DataSync uses to access your file system. See below.
   305  func (o FsxOpenZfsFileSystemOutput) Protocol() FsxOpenZfsFileSystemProtocolOutput {
   306  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) FsxOpenZfsFileSystemProtocolOutput { return v.Protocol }).(FsxOpenZfsFileSystemProtocolOutput)
   307  }
   308  
   309  // The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for openzfs file system.
   310  func (o FsxOpenZfsFileSystemOutput) SecurityGroupArns() pulumi.StringArrayOutput {
   311  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringArrayOutput { return v.SecurityGroupArns }).(pulumi.StringArrayOutput)
   312  }
   313  
   314  // Subdirectory to perform actions as source or destination. Must start with `/fsx`.
   315  func (o FsxOpenZfsFileSystemOutput) Subdirectory() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringOutput { return v.Subdirectory }).(pulumi.StringOutput)
   317  }
   318  
   319  // 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.
   320  func (o FsxOpenZfsFileSystemOutput) Tags() pulumi.StringMapOutput {
   321  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   322  }
   323  
   324  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   325  //
   326  // Deprecated: Please use `tags` instead.
   327  func (o FsxOpenZfsFileSystemOutput) TagsAll() pulumi.StringMapOutput {
   328  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   329  }
   330  
   331  // The URL of the FSx for openzfs location that was described.
   332  func (o FsxOpenZfsFileSystemOutput) Uri() pulumi.StringOutput {
   333  	return o.ApplyT(func(v *FsxOpenZfsFileSystem) pulumi.StringOutput { return v.Uri }).(pulumi.StringOutput)
   334  }
   335  
   336  type FsxOpenZfsFileSystemArrayOutput struct{ *pulumi.OutputState }
   337  
   338  func (FsxOpenZfsFileSystemArrayOutput) ElementType() reflect.Type {
   339  	return reflect.TypeOf((*[]*FsxOpenZfsFileSystem)(nil)).Elem()
   340  }
   341  
   342  func (o FsxOpenZfsFileSystemArrayOutput) ToFsxOpenZfsFileSystemArrayOutput() FsxOpenZfsFileSystemArrayOutput {
   343  	return o
   344  }
   345  
   346  func (o FsxOpenZfsFileSystemArrayOutput) ToFsxOpenZfsFileSystemArrayOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemArrayOutput {
   347  	return o
   348  }
   349  
   350  func (o FsxOpenZfsFileSystemArrayOutput) Index(i pulumi.IntInput) FsxOpenZfsFileSystemOutput {
   351  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FsxOpenZfsFileSystem {
   352  		return vs[0].([]*FsxOpenZfsFileSystem)[vs[1].(int)]
   353  	}).(FsxOpenZfsFileSystemOutput)
   354  }
   355  
   356  type FsxOpenZfsFileSystemMapOutput struct{ *pulumi.OutputState }
   357  
   358  func (FsxOpenZfsFileSystemMapOutput) ElementType() reflect.Type {
   359  	return reflect.TypeOf((*map[string]*FsxOpenZfsFileSystem)(nil)).Elem()
   360  }
   361  
   362  func (o FsxOpenZfsFileSystemMapOutput) ToFsxOpenZfsFileSystemMapOutput() FsxOpenZfsFileSystemMapOutput {
   363  	return o
   364  }
   365  
   366  func (o FsxOpenZfsFileSystemMapOutput) ToFsxOpenZfsFileSystemMapOutputWithContext(ctx context.Context) FsxOpenZfsFileSystemMapOutput {
   367  	return o
   368  }
   369  
   370  func (o FsxOpenZfsFileSystemMapOutput) MapIndex(k pulumi.StringInput) FsxOpenZfsFileSystemOutput {
   371  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FsxOpenZfsFileSystem {
   372  		return vs[0].(map[string]*FsxOpenZfsFileSystem)[vs[1].(string)]
   373  	}).(FsxOpenZfsFileSystemOutput)
   374  }
   375  
   376  func init() {
   377  	pulumi.RegisterInputType(reflect.TypeOf((*FsxOpenZfsFileSystemInput)(nil)).Elem(), &FsxOpenZfsFileSystem{})
   378  	pulumi.RegisterInputType(reflect.TypeOf((*FsxOpenZfsFileSystemArrayInput)(nil)).Elem(), FsxOpenZfsFileSystemArray{})
   379  	pulumi.RegisterInputType(reflect.TypeOf((*FsxOpenZfsFileSystemMapInput)(nil)).Elem(), FsxOpenZfsFileSystemMap{})
   380  	pulumi.RegisterOutputType(FsxOpenZfsFileSystemOutput{})
   381  	pulumi.RegisterOutputType(FsxOpenZfsFileSystemArrayOutput{})
   382  	pulumi.RegisterOutputType(FsxOpenZfsFileSystemMapOutput{})
   383  }