github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/backup/getVault.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  // Use this data source to get information on an existing backup vault.
    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.LookupVault(ctx, &backup.LookupVaultArgs{
    32  //				Name: "example_backup_vault",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupVault(ctx *pulumi.Context, args *LookupVaultArgs, opts ...pulumi.InvokeOption) (*LookupVaultResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupVaultResult
    46  	err := ctx.Invoke("aws:backup/getVault:getVault", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getVault.
    54  type LookupVaultArgs struct {
    55  	// Name of the backup vault.
    56  	Name string `pulumi:"name"`
    57  	// Metadata that you can assign to help organize the resources that you create.
    58  	Tags map[string]string `pulumi:"tags"`
    59  }
    60  
    61  // A collection of values returned by getVault.
    62  type LookupVaultResult struct {
    63  	// ARN of the vault.
    64  	Arn string `pulumi:"arn"`
    65  	// The provider-assigned unique ID for this managed resource.
    66  	Id string `pulumi:"id"`
    67  	// Server-side encryption key that is used to protect your backups.
    68  	KmsKeyArn string `pulumi:"kmsKeyArn"`
    69  	Name      string `pulumi:"name"`
    70  	// Number of recovery points that are stored in a backup vault.
    71  	RecoveryPoints int `pulumi:"recoveryPoints"`
    72  	// Metadata that you can assign to help organize the resources that you create.
    73  	Tags map[string]string `pulumi:"tags"`
    74  }
    75  
    76  func LookupVaultOutput(ctx *pulumi.Context, args LookupVaultOutputArgs, opts ...pulumi.InvokeOption) LookupVaultResultOutput {
    77  	return pulumi.ToOutputWithContext(context.Background(), args).
    78  		ApplyT(func(v interface{}) (LookupVaultResult, error) {
    79  			args := v.(LookupVaultArgs)
    80  			r, err := LookupVault(ctx, &args, opts...)
    81  			var s LookupVaultResult
    82  			if r != nil {
    83  				s = *r
    84  			}
    85  			return s, err
    86  		}).(LookupVaultResultOutput)
    87  }
    88  
    89  // A collection of arguments for invoking getVault.
    90  type LookupVaultOutputArgs struct {
    91  	// Name of the backup vault.
    92  	Name pulumi.StringInput `pulumi:"name"`
    93  	// Metadata that you can assign to help organize the resources that you create.
    94  	Tags pulumi.StringMapInput `pulumi:"tags"`
    95  }
    96  
    97  func (LookupVaultOutputArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*LookupVaultArgs)(nil)).Elem()
    99  }
   100  
   101  // A collection of values returned by getVault.
   102  type LookupVaultResultOutput struct{ *pulumi.OutputState }
   103  
   104  func (LookupVaultResultOutput) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupVaultResult)(nil)).Elem()
   106  }
   107  
   108  func (o LookupVaultResultOutput) ToLookupVaultResultOutput() LookupVaultResultOutput {
   109  	return o
   110  }
   111  
   112  func (o LookupVaultResultOutput) ToLookupVaultResultOutputWithContext(ctx context.Context) LookupVaultResultOutput {
   113  	return o
   114  }
   115  
   116  // ARN of the vault.
   117  func (o LookupVaultResultOutput) Arn() pulumi.StringOutput {
   118  	return o.ApplyT(func(v LookupVaultResult) string { return v.Arn }).(pulumi.StringOutput)
   119  }
   120  
   121  // The provider-assigned unique ID for this managed resource.
   122  func (o LookupVaultResultOutput) Id() pulumi.StringOutput {
   123  	return o.ApplyT(func(v LookupVaultResult) string { return v.Id }).(pulumi.StringOutput)
   124  }
   125  
   126  // Server-side encryption key that is used to protect your backups.
   127  func (o LookupVaultResultOutput) KmsKeyArn() pulumi.StringOutput {
   128  	return o.ApplyT(func(v LookupVaultResult) string { return v.KmsKeyArn }).(pulumi.StringOutput)
   129  }
   130  
   131  func (o LookupVaultResultOutput) Name() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupVaultResult) string { return v.Name }).(pulumi.StringOutput)
   133  }
   134  
   135  // Number of recovery points that are stored in a backup vault.
   136  func (o LookupVaultResultOutput) RecoveryPoints() pulumi.IntOutput {
   137  	return o.ApplyT(func(v LookupVaultResult) int { return v.RecoveryPoints }).(pulumi.IntOutput)
   138  }
   139  
   140  // Metadata that you can assign to help organize the resources that you create.
   141  func (o LookupVaultResultOutput) Tags() pulumi.StringMapOutput {
   142  	return o.ApplyT(func(v LookupVaultResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   143  }
   144  
   145  func init() {
   146  	pulumi.RegisterOutputType(LookupVaultResultOutput{})
   147  }