github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/storagegateway/tapePool.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 storagegateway
     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 Storage Gateway Tape Pool.
    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/storagegateway"
    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 := storagegateway.NewTapePool(ctx, "example", &storagegateway.TapePoolArgs{
    33  //				PoolName:     pulumi.String("example"),
    34  //				StorageClass: pulumi.String("GLACIER"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import `aws_storagegateway_tape_pool` using the volume Amazon Resource Name (ARN). For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:storagegateway/tapePool:TapePool example arn:aws:storagegateway:us-east-1:123456789012:tapepool/pool-12345678
    52  // ```
    53  type TapePool struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// Volume Amazon Resource Name (ARN), e.g., `aws_storagegateway_tape_pool.example arn:aws:storagegateway:us-east-1:123456789012:tapepool/pool-12345678`.
    57  	Arn pulumi.StringOutput `pulumi:"arn"`
    58  	// The name of the new custom tape pool.
    59  	PoolName pulumi.StringOutput `pulumi:"poolName"`
    60  	// Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
    61  	RetentionLockTimeInDays pulumi.IntPtrOutput `pulumi:"retentionLockTimeInDays"`
    62  	// Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
    63  	RetentionLockType pulumi.StringPtrOutput `pulumi:"retentionLockType"`
    64  	// The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
    65  	StorageClass pulumi.StringOutput `pulumi:"storageClass"`
    66  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    67  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    68  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    69  	//
    70  	// Deprecated: Please use `tags` instead.
    71  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    72  }
    73  
    74  // NewTapePool registers a new resource with the given unique name, arguments, and options.
    75  func NewTapePool(ctx *pulumi.Context,
    76  	name string, args *TapePoolArgs, opts ...pulumi.ResourceOption) (*TapePool, error) {
    77  	if args == nil {
    78  		return nil, errors.New("missing one or more required arguments")
    79  	}
    80  
    81  	if args.PoolName == nil {
    82  		return nil, errors.New("invalid value for required argument 'PoolName'")
    83  	}
    84  	if args.StorageClass == nil {
    85  		return nil, errors.New("invalid value for required argument 'StorageClass'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource TapePool
    89  	err := ctx.RegisterResource("aws:storagegateway/tapePool:TapePool", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetTapePool gets an existing TapePool resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetTapePool(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *TapePoolState, opts ...pulumi.ResourceOption) (*TapePool, error) {
   100  	var resource TapePool
   101  	err := ctx.ReadResource("aws:storagegateway/tapePool:TapePool", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering TapePool resources.
   109  type tapePoolState struct {
   110  	// Volume Amazon Resource Name (ARN), e.g., `aws_storagegateway_tape_pool.example arn:aws:storagegateway:us-east-1:123456789012:tapepool/pool-12345678`.
   111  	Arn *string `pulumi:"arn"`
   112  	// The name of the new custom tape pool.
   113  	PoolName *string `pulumi:"poolName"`
   114  	// Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
   115  	RetentionLockTimeInDays *int `pulumi:"retentionLockTimeInDays"`
   116  	// Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
   117  	RetentionLockType *string `pulumi:"retentionLockType"`
   118  	// The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
   119  	StorageClass *string `pulumi:"storageClass"`
   120  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   121  	Tags map[string]string `pulumi:"tags"`
   122  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   123  	//
   124  	// Deprecated: Please use `tags` instead.
   125  	TagsAll map[string]string `pulumi:"tagsAll"`
   126  }
   127  
   128  type TapePoolState struct {
   129  	// Volume Amazon Resource Name (ARN), e.g., `aws_storagegateway_tape_pool.example arn:aws:storagegateway:us-east-1:123456789012:tapepool/pool-12345678`.
   130  	Arn pulumi.StringPtrInput
   131  	// The name of the new custom tape pool.
   132  	PoolName pulumi.StringPtrInput
   133  	// Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
   134  	RetentionLockTimeInDays pulumi.IntPtrInput
   135  	// Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
   136  	RetentionLockType pulumi.StringPtrInput
   137  	// The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
   138  	StorageClass pulumi.StringPtrInput
   139  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   140  	Tags pulumi.StringMapInput
   141  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   142  	//
   143  	// Deprecated: Please use `tags` instead.
   144  	TagsAll pulumi.StringMapInput
   145  }
   146  
   147  func (TapePoolState) ElementType() reflect.Type {
   148  	return reflect.TypeOf((*tapePoolState)(nil)).Elem()
   149  }
   150  
   151  type tapePoolArgs struct {
   152  	// The name of the new custom tape pool.
   153  	PoolName string `pulumi:"poolName"`
   154  	// Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
   155  	RetentionLockTimeInDays *int `pulumi:"retentionLockTimeInDays"`
   156  	// Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
   157  	RetentionLockType *string `pulumi:"retentionLockType"`
   158  	// The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
   159  	StorageClass string `pulumi:"storageClass"`
   160  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   161  	Tags map[string]string `pulumi:"tags"`
   162  }
   163  
   164  // The set of arguments for constructing a TapePool resource.
   165  type TapePoolArgs struct {
   166  	// The name of the new custom tape pool.
   167  	PoolName pulumi.StringInput
   168  	// Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
   169  	RetentionLockTimeInDays pulumi.IntPtrInput
   170  	// Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
   171  	RetentionLockType pulumi.StringPtrInput
   172  	// The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
   173  	StorageClass pulumi.StringInput
   174  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   175  	Tags pulumi.StringMapInput
   176  }
   177  
   178  func (TapePoolArgs) ElementType() reflect.Type {
   179  	return reflect.TypeOf((*tapePoolArgs)(nil)).Elem()
   180  }
   181  
   182  type TapePoolInput interface {
   183  	pulumi.Input
   184  
   185  	ToTapePoolOutput() TapePoolOutput
   186  	ToTapePoolOutputWithContext(ctx context.Context) TapePoolOutput
   187  }
   188  
   189  func (*TapePool) ElementType() reflect.Type {
   190  	return reflect.TypeOf((**TapePool)(nil)).Elem()
   191  }
   192  
   193  func (i *TapePool) ToTapePoolOutput() TapePoolOutput {
   194  	return i.ToTapePoolOutputWithContext(context.Background())
   195  }
   196  
   197  func (i *TapePool) ToTapePoolOutputWithContext(ctx context.Context) TapePoolOutput {
   198  	return pulumi.ToOutputWithContext(ctx, i).(TapePoolOutput)
   199  }
   200  
   201  // TapePoolArrayInput is an input type that accepts TapePoolArray and TapePoolArrayOutput values.
   202  // You can construct a concrete instance of `TapePoolArrayInput` via:
   203  //
   204  //	TapePoolArray{ TapePoolArgs{...} }
   205  type TapePoolArrayInput interface {
   206  	pulumi.Input
   207  
   208  	ToTapePoolArrayOutput() TapePoolArrayOutput
   209  	ToTapePoolArrayOutputWithContext(context.Context) TapePoolArrayOutput
   210  }
   211  
   212  type TapePoolArray []TapePoolInput
   213  
   214  func (TapePoolArray) ElementType() reflect.Type {
   215  	return reflect.TypeOf((*[]*TapePool)(nil)).Elem()
   216  }
   217  
   218  func (i TapePoolArray) ToTapePoolArrayOutput() TapePoolArrayOutput {
   219  	return i.ToTapePoolArrayOutputWithContext(context.Background())
   220  }
   221  
   222  func (i TapePoolArray) ToTapePoolArrayOutputWithContext(ctx context.Context) TapePoolArrayOutput {
   223  	return pulumi.ToOutputWithContext(ctx, i).(TapePoolArrayOutput)
   224  }
   225  
   226  // TapePoolMapInput is an input type that accepts TapePoolMap and TapePoolMapOutput values.
   227  // You can construct a concrete instance of `TapePoolMapInput` via:
   228  //
   229  //	TapePoolMap{ "key": TapePoolArgs{...} }
   230  type TapePoolMapInput interface {
   231  	pulumi.Input
   232  
   233  	ToTapePoolMapOutput() TapePoolMapOutput
   234  	ToTapePoolMapOutputWithContext(context.Context) TapePoolMapOutput
   235  }
   236  
   237  type TapePoolMap map[string]TapePoolInput
   238  
   239  func (TapePoolMap) ElementType() reflect.Type {
   240  	return reflect.TypeOf((*map[string]*TapePool)(nil)).Elem()
   241  }
   242  
   243  func (i TapePoolMap) ToTapePoolMapOutput() TapePoolMapOutput {
   244  	return i.ToTapePoolMapOutputWithContext(context.Background())
   245  }
   246  
   247  func (i TapePoolMap) ToTapePoolMapOutputWithContext(ctx context.Context) TapePoolMapOutput {
   248  	return pulumi.ToOutputWithContext(ctx, i).(TapePoolMapOutput)
   249  }
   250  
   251  type TapePoolOutput struct{ *pulumi.OutputState }
   252  
   253  func (TapePoolOutput) ElementType() reflect.Type {
   254  	return reflect.TypeOf((**TapePool)(nil)).Elem()
   255  }
   256  
   257  func (o TapePoolOutput) ToTapePoolOutput() TapePoolOutput {
   258  	return o
   259  }
   260  
   261  func (o TapePoolOutput) ToTapePoolOutputWithContext(ctx context.Context) TapePoolOutput {
   262  	return o
   263  }
   264  
   265  // Volume Amazon Resource Name (ARN), e.g., `aws_storagegateway_tape_pool.example arn:aws:storagegateway:us-east-1:123456789012:tapepool/pool-12345678`.
   266  func (o TapePoolOutput) Arn() pulumi.StringOutput {
   267  	return o.ApplyT(func(v *TapePool) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   268  }
   269  
   270  // The name of the new custom tape pool.
   271  func (o TapePoolOutput) PoolName() pulumi.StringOutput {
   272  	return o.ApplyT(func(v *TapePool) pulumi.StringOutput { return v.PoolName }).(pulumi.StringOutput)
   273  }
   274  
   275  // Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
   276  func (o TapePoolOutput) RetentionLockTimeInDays() pulumi.IntPtrOutput {
   277  	return o.ApplyT(func(v *TapePool) pulumi.IntPtrOutput { return v.RetentionLockTimeInDays }).(pulumi.IntPtrOutput)
   278  }
   279  
   280  // Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
   281  func (o TapePoolOutput) RetentionLockType() pulumi.StringPtrOutput {
   282  	return o.ApplyT(func(v *TapePool) pulumi.StringPtrOutput { return v.RetentionLockType }).(pulumi.StringPtrOutput)
   283  }
   284  
   285  // The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
   286  func (o TapePoolOutput) StorageClass() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *TapePool) pulumi.StringOutput { return v.StorageClass }).(pulumi.StringOutput)
   288  }
   289  
   290  // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   291  func (o TapePoolOutput) Tags() pulumi.StringMapOutput {
   292  	return o.ApplyT(func(v *TapePool) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   293  }
   294  
   295  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   296  //
   297  // Deprecated: Please use `tags` instead.
   298  func (o TapePoolOutput) TagsAll() pulumi.StringMapOutput {
   299  	return o.ApplyT(func(v *TapePool) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   300  }
   301  
   302  type TapePoolArrayOutput struct{ *pulumi.OutputState }
   303  
   304  func (TapePoolArrayOutput) ElementType() reflect.Type {
   305  	return reflect.TypeOf((*[]*TapePool)(nil)).Elem()
   306  }
   307  
   308  func (o TapePoolArrayOutput) ToTapePoolArrayOutput() TapePoolArrayOutput {
   309  	return o
   310  }
   311  
   312  func (o TapePoolArrayOutput) ToTapePoolArrayOutputWithContext(ctx context.Context) TapePoolArrayOutput {
   313  	return o
   314  }
   315  
   316  func (o TapePoolArrayOutput) Index(i pulumi.IntInput) TapePoolOutput {
   317  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TapePool {
   318  		return vs[0].([]*TapePool)[vs[1].(int)]
   319  	}).(TapePoolOutput)
   320  }
   321  
   322  type TapePoolMapOutput struct{ *pulumi.OutputState }
   323  
   324  func (TapePoolMapOutput) ElementType() reflect.Type {
   325  	return reflect.TypeOf((*map[string]*TapePool)(nil)).Elem()
   326  }
   327  
   328  func (o TapePoolMapOutput) ToTapePoolMapOutput() TapePoolMapOutput {
   329  	return o
   330  }
   331  
   332  func (o TapePoolMapOutput) ToTapePoolMapOutputWithContext(ctx context.Context) TapePoolMapOutput {
   333  	return o
   334  }
   335  
   336  func (o TapePoolMapOutput) MapIndex(k pulumi.StringInput) TapePoolOutput {
   337  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TapePool {
   338  		return vs[0].(map[string]*TapePool)[vs[1].(string)]
   339  	}).(TapePoolOutput)
   340  }
   341  
   342  func init() {
   343  	pulumi.RegisterInputType(reflect.TypeOf((*TapePoolInput)(nil)).Elem(), &TapePool{})
   344  	pulumi.RegisterInputType(reflect.TypeOf((*TapePoolArrayInput)(nil)).Elem(), TapePoolArray{})
   345  	pulumi.RegisterInputType(reflect.TypeOf((*TapePoolMapInput)(nil)).Elem(), TapePoolMap{})
   346  	pulumi.RegisterOutputType(TapePoolOutput{})
   347  	pulumi.RegisterOutputType(TapePoolArrayOutput{})
   348  	pulumi.RegisterOutputType(TapePoolMapOutput{})
   349  }