github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/backup/vault.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 backup
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides an AWS Backup vault resource.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/backup"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := backup.NewVault(ctx, "example", &backup.VaultArgs{
    32  //				Name:      pulumi.String("example_backup_vault"),
    33  //				KmsKeyArn: pulumi.Any(exampleAwsKmsKey.Arn),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import Backup vault using the `name`. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:backup/vault:Vault test-vault TestVault
    51  // ```
    52  type Vault struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// The ARN of the vault.
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// A boolean that indicates that all recovery points stored in the vault are deleted so that the vault can be destroyed without error.
    58  	ForceDestroy pulumi.BoolPtrOutput `pulumi:"forceDestroy"`
    59  	// The server-side encryption key that is used to protect your backups.
    60  	KmsKeyArn pulumi.StringOutput `pulumi:"kmsKeyArn"`
    61  	// Name of the backup vault to create.
    62  	Name pulumi.StringOutput `pulumi:"name"`
    63  	// The number of recovery points that are stored in a backup vault.
    64  	RecoveryPoints pulumi.IntOutput `pulumi:"recoveryPoints"`
    65  	// Metadata that you can assign to help organize the resources that you create. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    66  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    67  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    68  	//
    69  	// Deprecated: Please use `tags` instead.
    70  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    71  }
    72  
    73  // NewVault registers a new resource with the given unique name, arguments, and options.
    74  func NewVault(ctx *pulumi.Context,
    75  	name string, args *VaultArgs, opts ...pulumi.ResourceOption) (*Vault, error) {
    76  	if args == nil {
    77  		args = &VaultArgs{}
    78  	}
    79  
    80  	opts = internal.PkgResourceDefaultOpts(opts)
    81  	var resource Vault
    82  	err := ctx.RegisterResource("aws:backup/vault:Vault", name, args, &resource, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return &resource, nil
    87  }
    88  
    89  // GetVault gets an existing Vault resource's state with the given name, ID, and optional
    90  // state properties that are used to uniquely qualify the lookup (nil if not required).
    91  func GetVault(ctx *pulumi.Context,
    92  	name string, id pulumi.IDInput, state *VaultState, opts ...pulumi.ResourceOption) (*Vault, error) {
    93  	var resource Vault
    94  	err := ctx.ReadResource("aws:backup/vault:Vault", name, id, state, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // Input properties used for looking up and filtering Vault resources.
   102  type vaultState struct {
   103  	// The ARN of the vault.
   104  	Arn *string `pulumi:"arn"`
   105  	// A boolean that indicates that all recovery points stored in the vault are deleted so that the vault can be destroyed without error.
   106  	ForceDestroy *bool `pulumi:"forceDestroy"`
   107  	// The server-side encryption key that is used to protect your backups.
   108  	KmsKeyArn *string `pulumi:"kmsKeyArn"`
   109  	// Name of the backup vault to create.
   110  	Name *string `pulumi:"name"`
   111  	// The number of recovery points that are stored in a backup vault.
   112  	RecoveryPoints *int `pulumi:"recoveryPoints"`
   113  	// Metadata that you can assign to help organize the resources that you create. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   114  	Tags map[string]string `pulumi:"tags"`
   115  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   116  	//
   117  	// Deprecated: Please use `tags` instead.
   118  	TagsAll map[string]string `pulumi:"tagsAll"`
   119  }
   120  
   121  type VaultState struct {
   122  	// The ARN of the vault.
   123  	Arn pulumi.StringPtrInput
   124  	// A boolean that indicates that all recovery points stored in the vault are deleted so that the vault can be destroyed without error.
   125  	ForceDestroy pulumi.BoolPtrInput
   126  	// The server-side encryption key that is used to protect your backups.
   127  	KmsKeyArn pulumi.StringPtrInput
   128  	// Name of the backup vault to create.
   129  	Name pulumi.StringPtrInput
   130  	// The number of recovery points that are stored in a backup vault.
   131  	RecoveryPoints pulumi.IntPtrInput
   132  	// Metadata that you can assign to help organize the resources that you create. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   133  	Tags pulumi.StringMapInput
   134  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   135  	//
   136  	// Deprecated: Please use `tags` instead.
   137  	TagsAll pulumi.StringMapInput
   138  }
   139  
   140  func (VaultState) ElementType() reflect.Type {
   141  	return reflect.TypeOf((*vaultState)(nil)).Elem()
   142  }
   143  
   144  type vaultArgs struct {
   145  	// A boolean that indicates that all recovery points stored in the vault are deleted so that the vault can be destroyed without error.
   146  	ForceDestroy *bool `pulumi:"forceDestroy"`
   147  	// The server-side encryption key that is used to protect your backups.
   148  	KmsKeyArn *string `pulumi:"kmsKeyArn"`
   149  	// Name of the backup vault to create.
   150  	Name *string `pulumi:"name"`
   151  	// Metadata that you can assign to help organize the resources that you create. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   152  	Tags map[string]string `pulumi:"tags"`
   153  }
   154  
   155  // The set of arguments for constructing a Vault resource.
   156  type VaultArgs struct {
   157  	// A boolean that indicates that all recovery points stored in the vault are deleted so that the vault can be destroyed without error.
   158  	ForceDestroy pulumi.BoolPtrInput
   159  	// The server-side encryption key that is used to protect your backups.
   160  	KmsKeyArn pulumi.StringPtrInput
   161  	// Name of the backup vault to create.
   162  	Name pulumi.StringPtrInput
   163  	// Metadata that you can assign to help organize the resources that you create. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   164  	Tags pulumi.StringMapInput
   165  }
   166  
   167  func (VaultArgs) ElementType() reflect.Type {
   168  	return reflect.TypeOf((*vaultArgs)(nil)).Elem()
   169  }
   170  
   171  type VaultInput interface {
   172  	pulumi.Input
   173  
   174  	ToVaultOutput() VaultOutput
   175  	ToVaultOutputWithContext(ctx context.Context) VaultOutput
   176  }
   177  
   178  func (*Vault) ElementType() reflect.Type {
   179  	return reflect.TypeOf((**Vault)(nil)).Elem()
   180  }
   181  
   182  func (i *Vault) ToVaultOutput() VaultOutput {
   183  	return i.ToVaultOutputWithContext(context.Background())
   184  }
   185  
   186  func (i *Vault) ToVaultOutputWithContext(ctx context.Context) VaultOutput {
   187  	return pulumi.ToOutputWithContext(ctx, i).(VaultOutput)
   188  }
   189  
   190  // VaultArrayInput is an input type that accepts VaultArray and VaultArrayOutput values.
   191  // You can construct a concrete instance of `VaultArrayInput` via:
   192  //
   193  //	VaultArray{ VaultArgs{...} }
   194  type VaultArrayInput interface {
   195  	pulumi.Input
   196  
   197  	ToVaultArrayOutput() VaultArrayOutput
   198  	ToVaultArrayOutputWithContext(context.Context) VaultArrayOutput
   199  }
   200  
   201  type VaultArray []VaultInput
   202  
   203  func (VaultArray) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*[]*Vault)(nil)).Elem()
   205  }
   206  
   207  func (i VaultArray) ToVaultArrayOutput() VaultArrayOutput {
   208  	return i.ToVaultArrayOutputWithContext(context.Background())
   209  }
   210  
   211  func (i VaultArray) ToVaultArrayOutputWithContext(ctx context.Context) VaultArrayOutput {
   212  	return pulumi.ToOutputWithContext(ctx, i).(VaultArrayOutput)
   213  }
   214  
   215  // VaultMapInput is an input type that accepts VaultMap and VaultMapOutput values.
   216  // You can construct a concrete instance of `VaultMapInput` via:
   217  //
   218  //	VaultMap{ "key": VaultArgs{...} }
   219  type VaultMapInput interface {
   220  	pulumi.Input
   221  
   222  	ToVaultMapOutput() VaultMapOutput
   223  	ToVaultMapOutputWithContext(context.Context) VaultMapOutput
   224  }
   225  
   226  type VaultMap map[string]VaultInput
   227  
   228  func (VaultMap) ElementType() reflect.Type {
   229  	return reflect.TypeOf((*map[string]*Vault)(nil)).Elem()
   230  }
   231  
   232  func (i VaultMap) ToVaultMapOutput() VaultMapOutput {
   233  	return i.ToVaultMapOutputWithContext(context.Background())
   234  }
   235  
   236  func (i VaultMap) ToVaultMapOutputWithContext(ctx context.Context) VaultMapOutput {
   237  	return pulumi.ToOutputWithContext(ctx, i).(VaultMapOutput)
   238  }
   239  
   240  type VaultOutput struct{ *pulumi.OutputState }
   241  
   242  func (VaultOutput) ElementType() reflect.Type {
   243  	return reflect.TypeOf((**Vault)(nil)).Elem()
   244  }
   245  
   246  func (o VaultOutput) ToVaultOutput() VaultOutput {
   247  	return o
   248  }
   249  
   250  func (o VaultOutput) ToVaultOutputWithContext(ctx context.Context) VaultOutput {
   251  	return o
   252  }
   253  
   254  // The ARN of the vault.
   255  func (o VaultOutput) Arn() pulumi.StringOutput {
   256  	return o.ApplyT(func(v *Vault) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   257  }
   258  
   259  // A boolean that indicates that all recovery points stored in the vault are deleted so that the vault can be destroyed without error.
   260  func (o VaultOutput) ForceDestroy() pulumi.BoolPtrOutput {
   261  	return o.ApplyT(func(v *Vault) pulumi.BoolPtrOutput { return v.ForceDestroy }).(pulumi.BoolPtrOutput)
   262  }
   263  
   264  // The server-side encryption key that is used to protect your backups.
   265  func (o VaultOutput) KmsKeyArn() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *Vault) pulumi.StringOutput { return v.KmsKeyArn }).(pulumi.StringOutput)
   267  }
   268  
   269  // Name of the backup vault to create.
   270  func (o VaultOutput) Name() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *Vault) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   272  }
   273  
   274  // The number of recovery points that are stored in a backup vault.
   275  func (o VaultOutput) RecoveryPoints() pulumi.IntOutput {
   276  	return o.ApplyT(func(v *Vault) pulumi.IntOutput { return v.RecoveryPoints }).(pulumi.IntOutput)
   277  }
   278  
   279  // Metadata that you can assign to help organize the resources that you create. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   280  func (o VaultOutput) Tags() pulumi.StringMapOutput {
   281  	return o.ApplyT(func(v *Vault) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   282  }
   283  
   284  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   285  //
   286  // Deprecated: Please use `tags` instead.
   287  func (o VaultOutput) TagsAll() pulumi.StringMapOutput {
   288  	return o.ApplyT(func(v *Vault) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   289  }
   290  
   291  type VaultArrayOutput struct{ *pulumi.OutputState }
   292  
   293  func (VaultArrayOutput) ElementType() reflect.Type {
   294  	return reflect.TypeOf((*[]*Vault)(nil)).Elem()
   295  }
   296  
   297  func (o VaultArrayOutput) ToVaultArrayOutput() VaultArrayOutput {
   298  	return o
   299  }
   300  
   301  func (o VaultArrayOutput) ToVaultArrayOutputWithContext(ctx context.Context) VaultArrayOutput {
   302  	return o
   303  }
   304  
   305  func (o VaultArrayOutput) Index(i pulumi.IntInput) VaultOutput {
   306  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Vault {
   307  		return vs[0].([]*Vault)[vs[1].(int)]
   308  	}).(VaultOutput)
   309  }
   310  
   311  type VaultMapOutput struct{ *pulumi.OutputState }
   312  
   313  func (VaultMapOutput) ElementType() reflect.Type {
   314  	return reflect.TypeOf((*map[string]*Vault)(nil)).Elem()
   315  }
   316  
   317  func (o VaultMapOutput) ToVaultMapOutput() VaultMapOutput {
   318  	return o
   319  }
   320  
   321  func (o VaultMapOutput) ToVaultMapOutputWithContext(ctx context.Context) VaultMapOutput {
   322  	return o
   323  }
   324  
   325  func (o VaultMapOutput) MapIndex(k pulumi.StringInput) VaultOutput {
   326  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Vault {
   327  		return vs[0].(map[string]*Vault)[vs[1].(string)]
   328  	}).(VaultOutput)
   329  }
   330  
   331  func init() {
   332  	pulumi.RegisterInputType(reflect.TypeOf((*VaultInput)(nil)).Elem(), &Vault{})
   333  	pulumi.RegisterInputType(reflect.TypeOf((*VaultArrayInput)(nil)).Elem(), VaultArray{})
   334  	pulumi.RegisterInputType(reflect.TypeOf((*VaultMapInput)(nil)).Elem(), VaultMap{})
   335  	pulumi.RegisterOutputType(VaultOutput{})
   336  	pulumi.RegisterOutputType(VaultArrayOutput{})
   337  	pulumi.RegisterOutputType(VaultMapOutput{})
   338  }