github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/fsx/openZfsSnapshot.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 fsx
     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 Amazon FSx for OpenZFS volume.
    16  // See the [FSx OpenZFS User Guide](https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/what-is-fsx.html) for more information.
    17  //
    18  // ## Example Usage
    19  //
    20  // ### Root volume Example
    21  //
    22  // <!--Start PulumiCodeChooser -->
    23  // ```go
    24  // package main
    25  //
    26  // import (
    27  //
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/fsx"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			exampleOpenZfsFileSystem, err := fsx.NewOpenZfsFileSystem(ctx, "example", &fsx.OpenZfsFileSystemArgs{
    36  //				StorageCapacity:    pulumi.Int(64),
    37  //				SubnetIds:          pulumi.Any(exampleAwsSubnet.Id),
    38  //				DeploymentType:     pulumi.String("SINGLE_AZ_1"),
    39  //				ThroughputCapacity: pulumi.Int(64),
    40  //			})
    41  //			if err != nil {
    42  //				return err
    43  //			}
    44  //			_, err = fsx.NewOpenZfsSnapshot(ctx, "example", &fsx.OpenZfsSnapshotArgs{
    45  //				Name:     pulumi.String("example"),
    46  //				VolumeId: exampleOpenZfsFileSystem.RootVolumeId,
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			return nil
    52  //		})
    53  //	}
    54  //
    55  // ```
    56  // <!--End PulumiCodeChooser -->
    57  //
    58  // ### Child volume Example
    59  //
    60  // <!--Start PulumiCodeChooser -->
    61  // ```go
    62  // package main
    63  //
    64  // import (
    65  //
    66  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/fsx"
    67  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    68  //
    69  // )
    70  //
    71  //	func main() {
    72  //		pulumi.Run(func(ctx *pulumi.Context) error {
    73  //			exampleOpenZfsFileSystem, err := fsx.NewOpenZfsFileSystem(ctx, "example", &fsx.OpenZfsFileSystemArgs{
    74  //				StorageCapacity:    pulumi.Int(64),
    75  //				SubnetIds:          pulumi.Any(exampleAwsSubnet.Id),
    76  //				DeploymentType:     pulumi.String("SINGLE_AZ_1"),
    77  //				ThroughputCapacity: pulumi.Int(64),
    78  //			})
    79  //			if err != nil {
    80  //				return err
    81  //			}
    82  //			exampleOpenZfsVolume, err := fsx.NewOpenZfsVolume(ctx, "example", &fsx.OpenZfsVolumeArgs{
    83  //				Name:           pulumi.String("example"),
    84  //				ParentVolumeId: exampleOpenZfsFileSystem.RootVolumeId,
    85  //			})
    86  //			if err != nil {
    87  //				return err
    88  //			}
    89  //			_, err = fsx.NewOpenZfsSnapshot(ctx, "example", &fsx.OpenZfsSnapshotArgs{
    90  //				Name:     pulumi.String("example"),
    91  //				VolumeId: exampleOpenZfsVolume.ID(),
    92  //			})
    93  //			if err != nil {
    94  //				return err
    95  //			}
    96  //			return nil
    97  //		})
    98  //	}
    99  //
   100  // ```
   101  // <!--End PulumiCodeChooser -->
   102  //
   103  // ## Import
   104  //
   105  // Using `pulumi import`, import FSx OpenZFS snapshot using the `id`. For example:
   106  //
   107  // ```sh
   108  // $ pulumi import aws:fsx/openZfsSnapshot:OpenZfsSnapshot example fs-543ab12b1ca672f33
   109  // ```
   110  type OpenZfsSnapshot struct {
   111  	pulumi.CustomResourceState
   112  
   113  	// Amazon Resource Name of the snapshot.
   114  	Arn          pulumi.StringOutput `pulumi:"arn"`
   115  	CreationTime pulumi.StringOutput `pulumi:"creationTime"`
   116  	// The name of the Snapshot. You can use a maximum of 203 alphanumeric characters plus either _ or -  or : or . for the name.
   117  	Name pulumi.StringOutput `pulumi:"name"`
   118  	// A map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
   119  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   120  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   121  	//
   122  	// Deprecated: Please use `tags` instead.
   123  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   124  	// The ID of the volume to snapshot. This can be the root volume or a child volume.
   125  	VolumeId pulumi.StringOutput `pulumi:"volumeId"`
   126  }
   127  
   128  // NewOpenZfsSnapshot registers a new resource with the given unique name, arguments, and options.
   129  func NewOpenZfsSnapshot(ctx *pulumi.Context,
   130  	name string, args *OpenZfsSnapshotArgs, opts ...pulumi.ResourceOption) (*OpenZfsSnapshot, error) {
   131  	if args == nil {
   132  		return nil, errors.New("missing one or more required arguments")
   133  	}
   134  
   135  	if args.VolumeId == nil {
   136  		return nil, errors.New("invalid value for required argument 'VolumeId'")
   137  	}
   138  	opts = internal.PkgResourceDefaultOpts(opts)
   139  	var resource OpenZfsSnapshot
   140  	err := ctx.RegisterResource("aws:fsx/openZfsSnapshot:OpenZfsSnapshot", name, args, &resource, opts...)
   141  	if err != nil {
   142  		return nil, err
   143  	}
   144  	return &resource, nil
   145  }
   146  
   147  // GetOpenZfsSnapshot gets an existing OpenZfsSnapshot resource's state with the given name, ID, and optional
   148  // state properties that are used to uniquely qualify the lookup (nil if not required).
   149  func GetOpenZfsSnapshot(ctx *pulumi.Context,
   150  	name string, id pulumi.IDInput, state *OpenZfsSnapshotState, opts ...pulumi.ResourceOption) (*OpenZfsSnapshot, error) {
   151  	var resource OpenZfsSnapshot
   152  	err := ctx.ReadResource("aws:fsx/openZfsSnapshot:OpenZfsSnapshot", name, id, state, &resource, opts...)
   153  	if err != nil {
   154  		return nil, err
   155  	}
   156  	return &resource, nil
   157  }
   158  
   159  // Input properties used for looking up and filtering OpenZfsSnapshot resources.
   160  type openZfsSnapshotState struct {
   161  	// Amazon Resource Name of the snapshot.
   162  	Arn          *string `pulumi:"arn"`
   163  	CreationTime *string `pulumi:"creationTime"`
   164  	// The name of the Snapshot. You can use a maximum of 203 alphanumeric characters plus either _ or -  or : or . for the name.
   165  	Name *string `pulumi:"name"`
   166  	// A map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
   167  	Tags map[string]string `pulumi:"tags"`
   168  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   169  	//
   170  	// Deprecated: Please use `tags` instead.
   171  	TagsAll map[string]string `pulumi:"tagsAll"`
   172  	// The ID of the volume to snapshot. This can be the root volume or a child volume.
   173  	VolumeId *string `pulumi:"volumeId"`
   174  }
   175  
   176  type OpenZfsSnapshotState struct {
   177  	// Amazon Resource Name of the snapshot.
   178  	Arn          pulumi.StringPtrInput
   179  	CreationTime pulumi.StringPtrInput
   180  	// The name of the Snapshot. You can use a maximum of 203 alphanumeric characters plus either _ or -  or : or . for the name.
   181  	Name pulumi.StringPtrInput
   182  	// A map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
   183  	Tags pulumi.StringMapInput
   184  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   185  	//
   186  	// Deprecated: Please use `tags` instead.
   187  	TagsAll pulumi.StringMapInput
   188  	// The ID of the volume to snapshot. This can be the root volume or a child volume.
   189  	VolumeId pulumi.StringPtrInput
   190  }
   191  
   192  func (OpenZfsSnapshotState) ElementType() reflect.Type {
   193  	return reflect.TypeOf((*openZfsSnapshotState)(nil)).Elem()
   194  }
   195  
   196  type openZfsSnapshotArgs struct {
   197  	// The name of the Snapshot. You can use a maximum of 203 alphanumeric characters plus either _ or -  or : or . for the name.
   198  	Name *string `pulumi:"name"`
   199  	// A map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
   200  	Tags map[string]string `pulumi:"tags"`
   201  	// The ID of the volume to snapshot. This can be the root volume or a child volume.
   202  	VolumeId string `pulumi:"volumeId"`
   203  }
   204  
   205  // The set of arguments for constructing a OpenZfsSnapshot resource.
   206  type OpenZfsSnapshotArgs struct {
   207  	// The name of the Snapshot. You can use a maximum of 203 alphanumeric characters plus either _ or -  or : or . for the name.
   208  	Name pulumi.StringPtrInput
   209  	// A map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
   210  	Tags pulumi.StringMapInput
   211  	// The ID of the volume to snapshot. This can be the root volume or a child volume.
   212  	VolumeId pulumi.StringInput
   213  }
   214  
   215  func (OpenZfsSnapshotArgs) ElementType() reflect.Type {
   216  	return reflect.TypeOf((*openZfsSnapshotArgs)(nil)).Elem()
   217  }
   218  
   219  type OpenZfsSnapshotInput interface {
   220  	pulumi.Input
   221  
   222  	ToOpenZfsSnapshotOutput() OpenZfsSnapshotOutput
   223  	ToOpenZfsSnapshotOutputWithContext(ctx context.Context) OpenZfsSnapshotOutput
   224  }
   225  
   226  func (*OpenZfsSnapshot) ElementType() reflect.Type {
   227  	return reflect.TypeOf((**OpenZfsSnapshot)(nil)).Elem()
   228  }
   229  
   230  func (i *OpenZfsSnapshot) ToOpenZfsSnapshotOutput() OpenZfsSnapshotOutput {
   231  	return i.ToOpenZfsSnapshotOutputWithContext(context.Background())
   232  }
   233  
   234  func (i *OpenZfsSnapshot) ToOpenZfsSnapshotOutputWithContext(ctx context.Context) OpenZfsSnapshotOutput {
   235  	return pulumi.ToOutputWithContext(ctx, i).(OpenZfsSnapshotOutput)
   236  }
   237  
   238  // OpenZfsSnapshotArrayInput is an input type that accepts OpenZfsSnapshotArray and OpenZfsSnapshotArrayOutput values.
   239  // You can construct a concrete instance of `OpenZfsSnapshotArrayInput` via:
   240  //
   241  //	OpenZfsSnapshotArray{ OpenZfsSnapshotArgs{...} }
   242  type OpenZfsSnapshotArrayInput interface {
   243  	pulumi.Input
   244  
   245  	ToOpenZfsSnapshotArrayOutput() OpenZfsSnapshotArrayOutput
   246  	ToOpenZfsSnapshotArrayOutputWithContext(context.Context) OpenZfsSnapshotArrayOutput
   247  }
   248  
   249  type OpenZfsSnapshotArray []OpenZfsSnapshotInput
   250  
   251  func (OpenZfsSnapshotArray) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*[]*OpenZfsSnapshot)(nil)).Elem()
   253  }
   254  
   255  func (i OpenZfsSnapshotArray) ToOpenZfsSnapshotArrayOutput() OpenZfsSnapshotArrayOutput {
   256  	return i.ToOpenZfsSnapshotArrayOutputWithContext(context.Background())
   257  }
   258  
   259  func (i OpenZfsSnapshotArray) ToOpenZfsSnapshotArrayOutputWithContext(ctx context.Context) OpenZfsSnapshotArrayOutput {
   260  	return pulumi.ToOutputWithContext(ctx, i).(OpenZfsSnapshotArrayOutput)
   261  }
   262  
   263  // OpenZfsSnapshotMapInput is an input type that accepts OpenZfsSnapshotMap and OpenZfsSnapshotMapOutput values.
   264  // You can construct a concrete instance of `OpenZfsSnapshotMapInput` via:
   265  //
   266  //	OpenZfsSnapshotMap{ "key": OpenZfsSnapshotArgs{...} }
   267  type OpenZfsSnapshotMapInput interface {
   268  	pulumi.Input
   269  
   270  	ToOpenZfsSnapshotMapOutput() OpenZfsSnapshotMapOutput
   271  	ToOpenZfsSnapshotMapOutputWithContext(context.Context) OpenZfsSnapshotMapOutput
   272  }
   273  
   274  type OpenZfsSnapshotMap map[string]OpenZfsSnapshotInput
   275  
   276  func (OpenZfsSnapshotMap) ElementType() reflect.Type {
   277  	return reflect.TypeOf((*map[string]*OpenZfsSnapshot)(nil)).Elem()
   278  }
   279  
   280  func (i OpenZfsSnapshotMap) ToOpenZfsSnapshotMapOutput() OpenZfsSnapshotMapOutput {
   281  	return i.ToOpenZfsSnapshotMapOutputWithContext(context.Background())
   282  }
   283  
   284  func (i OpenZfsSnapshotMap) ToOpenZfsSnapshotMapOutputWithContext(ctx context.Context) OpenZfsSnapshotMapOutput {
   285  	return pulumi.ToOutputWithContext(ctx, i).(OpenZfsSnapshotMapOutput)
   286  }
   287  
   288  type OpenZfsSnapshotOutput struct{ *pulumi.OutputState }
   289  
   290  func (OpenZfsSnapshotOutput) ElementType() reflect.Type {
   291  	return reflect.TypeOf((**OpenZfsSnapshot)(nil)).Elem()
   292  }
   293  
   294  func (o OpenZfsSnapshotOutput) ToOpenZfsSnapshotOutput() OpenZfsSnapshotOutput {
   295  	return o
   296  }
   297  
   298  func (o OpenZfsSnapshotOutput) ToOpenZfsSnapshotOutputWithContext(ctx context.Context) OpenZfsSnapshotOutput {
   299  	return o
   300  }
   301  
   302  // Amazon Resource Name of the snapshot.
   303  func (o OpenZfsSnapshotOutput) Arn() pulumi.StringOutput {
   304  	return o.ApplyT(func(v *OpenZfsSnapshot) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   305  }
   306  
   307  func (o OpenZfsSnapshotOutput) CreationTime() pulumi.StringOutput {
   308  	return o.ApplyT(func(v *OpenZfsSnapshot) pulumi.StringOutput { return v.CreationTime }).(pulumi.StringOutput)
   309  }
   310  
   311  // The name of the Snapshot. You can use a maximum of 203 alphanumeric characters plus either _ or -  or : or . for the name.
   312  func (o OpenZfsSnapshotOutput) Name() pulumi.StringOutput {
   313  	return o.ApplyT(func(v *OpenZfsSnapshot) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   314  }
   315  
   316  // A map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
   317  func (o OpenZfsSnapshotOutput) Tags() pulumi.StringMapOutput {
   318  	return o.ApplyT(func(v *OpenZfsSnapshot) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   319  }
   320  
   321  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   322  //
   323  // Deprecated: Please use `tags` instead.
   324  func (o OpenZfsSnapshotOutput) TagsAll() pulumi.StringMapOutput {
   325  	return o.ApplyT(func(v *OpenZfsSnapshot) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   326  }
   327  
   328  // The ID of the volume to snapshot. This can be the root volume or a child volume.
   329  func (o OpenZfsSnapshotOutput) VolumeId() pulumi.StringOutput {
   330  	return o.ApplyT(func(v *OpenZfsSnapshot) pulumi.StringOutput { return v.VolumeId }).(pulumi.StringOutput)
   331  }
   332  
   333  type OpenZfsSnapshotArrayOutput struct{ *pulumi.OutputState }
   334  
   335  func (OpenZfsSnapshotArrayOutput) ElementType() reflect.Type {
   336  	return reflect.TypeOf((*[]*OpenZfsSnapshot)(nil)).Elem()
   337  }
   338  
   339  func (o OpenZfsSnapshotArrayOutput) ToOpenZfsSnapshotArrayOutput() OpenZfsSnapshotArrayOutput {
   340  	return o
   341  }
   342  
   343  func (o OpenZfsSnapshotArrayOutput) ToOpenZfsSnapshotArrayOutputWithContext(ctx context.Context) OpenZfsSnapshotArrayOutput {
   344  	return o
   345  }
   346  
   347  func (o OpenZfsSnapshotArrayOutput) Index(i pulumi.IntInput) OpenZfsSnapshotOutput {
   348  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OpenZfsSnapshot {
   349  		return vs[0].([]*OpenZfsSnapshot)[vs[1].(int)]
   350  	}).(OpenZfsSnapshotOutput)
   351  }
   352  
   353  type OpenZfsSnapshotMapOutput struct{ *pulumi.OutputState }
   354  
   355  func (OpenZfsSnapshotMapOutput) ElementType() reflect.Type {
   356  	return reflect.TypeOf((*map[string]*OpenZfsSnapshot)(nil)).Elem()
   357  }
   358  
   359  func (o OpenZfsSnapshotMapOutput) ToOpenZfsSnapshotMapOutput() OpenZfsSnapshotMapOutput {
   360  	return o
   361  }
   362  
   363  func (o OpenZfsSnapshotMapOutput) ToOpenZfsSnapshotMapOutputWithContext(ctx context.Context) OpenZfsSnapshotMapOutput {
   364  	return o
   365  }
   366  
   367  func (o OpenZfsSnapshotMapOutput) MapIndex(k pulumi.StringInput) OpenZfsSnapshotOutput {
   368  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OpenZfsSnapshot {
   369  		return vs[0].(map[string]*OpenZfsSnapshot)[vs[1].(string)]
   370  	}).(OpenZfsSnapshotOutput)
   371  }
   372  
   373  func init() {
   374  	pulumi.RegisterInputType(reflect.TypeOf((*OpenZfsSnapshotInput)(nil)).Elem(), &OpenZfsSnapshot{})
   375  	pulumi.RegisterInputType(reflect.TypeOf((*OpenZfsSnapshotArrayInput)(nil)).Elem(), OpenZfsSnapshotArray{})
   376  	pulumi.RegisterInputType(reflect.TypeOf((*OpenZfsSnapshotMapInput)(nil)).Elem(), OpenZfsSnapshotMap{})
   377  	pulumi.RegisterOutputType(OpenZfsSnapshotOutput{})
   378  	pulumi.RegisterOutputType(OpenZfsSnapshotArrayOutput{})
   379  	pulumi.RegisterOutputType(OpenZfsSnapshotMapOutput{})
   380  }