github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/backup/getPlan.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 plan.
    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.LookupPlan(ctx, &backup.LookupPlanArgs{
    32  //				PlanId: "my_example_backup_plan_id",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupPlan(ctx *pulumi.Context, args *LookupPlanArgs, opts ...pulumi.InvokeOption) (*LookupPlanResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupPlanResult
    46  	err := ctx.Invoke("aws:backup/getPlan:getPlan", 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 getPlan.
    54  type LookupPlanArgs struct {
    55  	// Backup plan ID.
    56  	PlanId string `pulumi:"planId"`
    57  	// Metadata that you can assign to help organize the plans you create.
    58  	Tags map[string]string `pulumi:"tags"`
    59  }
    60  
    61  // A collection of values returned by getPlan.
    62  type LookupPlanResult struct {
    63  	// ARN of the backup plan.
    64  	Arn string `pulumi:"arn"`
    65  	// The provider-assigned unique ID for this managed resource.
    66  	Id string `pulumi:"id"`
    67  	// Display name of a backup plan.
    68  	Name   string `pulumi:"name"`
    69  	PlanId string `pulumi:"planId"`
    70  	// Metadata that you can assign to help organize the plans you create.
    71  	Tags map[string]string `pulumi:"tags"`
    72  	// Unique, randomly generated, Unicode, UTF-8 encoded string that serves as the version ID of the backup plan.
    73  	Version string `pulumi:"version"`
    74  }
    75  
    76  func LookupPlanOutput(ctx *pulumi.Context, args LookupPlanOutputArgs, opts ...pulumi.InvokeOption) LookupPlanResultOutput {
    77  	return pulumi.ToOutputWithContext(context.Background(), args).
    78  		ApplyT(func(v interface{}) (LookupPlanResult, error) {
    79  			args := v.(LookupPlanArgs)
    80  			r, err := LookupPlan(ctx, &args, opts...)
    81  			var s LookupPlanResult
    82  			if r != nil {
    83  				s = *r
    84  			}
    85  			return s, err
    86  		}).(LookupPlanResultOutput)
    87  }
    88  
    89  // A collection of arguments for invoking getPlan.
    90  type LookupPlanOutputArgs struct {
    91  	// Backup plan ID.
    92  	PlanId pulumi.StringInput `pulumi:"planId"`
    93  	// Metadata that you can assign to help organize the plans you create.
    94  	Tags pulumi.StringMapInput `pulumi:"tags"`
    95  }
    96  
    97  func (LookupPlanOutputArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*LookupPlanArgs)(nil)).Elem()
    99  }
   100  
   101  // A collection of values returned by getPlan.
   102  type LookupPlanResultOutput struct{ *pulumi.OutputState }
   103  
   104  func (LookupPlanResultOutput) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupPlanResult)(nil)).Elem()
   106  }
   107  
   108  func (o LookupPlanResultOutput) ToLookupPlanResultOutput() LookupPlanResultOutput {
   109  	return o
   110  }
   111  
   112  func (o LookupPlanResultOutput) ToLookupPlanResultOutputWithContext(ctx context.Context) LookupPlanResultOutput {
   113  	return o
   114  }
   115  
   116  // ARN of the backup plan.
   117  func (o LookupPlanResultOutput) Arn() pulumi.StringOutput {
   118  	return o.ApplyT(func(v LookupPlanResult) string { return v.Arn }).(pulumi.StringOutput)
   119  }
   120  
   121  // The provider-assigned unique ID for this managed resource.
   122  func (o LookupPlanResultOutput) Id() pulumi.StringOutput {
   123  	return o.ApplyT(func(v LookupPlanResult) string { return v.Id }).(pulumi.StringOutput)
   124  }
   125  
   126  // Display name of a backup plan.
   127  func (o LookupPlanResultOutput) Name() pulumi.StringOutput {
   128  	return o.ApplyT(func(v LookupPlanResult) string { return v.Name }).(pulumi.StringOutput)
   129  }
   130  
   131  func (o LookupPlanResultOutput) PlanId() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupPlanResult) string { return v.PlanId }).(pulumi.StringOutput)
   133  }
   134  
   135  // Metadata that you can assign to help organize the plans you create.
   136  func (o LookupPlanResultOutput) Tags() pulumi.StringMapOutput {
   137  	return o.ApplyT(func(v LookupPlanResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   138  }
   139  
   140  // Unique, randomly generated, Unicode, UTF-8 encoded string that serves as the version ID of the backup plan.
   141  func (o LookupPlanResultOutput) Version() pulumi.StringOutput {
   142  	return o.ApplyT(func(v LookupPlanResult) string { return v.Version }).(pulumi.StringOutput)
   143  }
   144  
   145  func init() {
   146  	pulumi.RegisterOutputType(LookupPlanResultOutput{})
   147  }