github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ebs/getEbsVolumes.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 ebs
     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  // `ebs.getEbsVolumes` provides identifying information for EBS volumes matching given criteria.
    15  //
    16  // This data source can be useful for getting a list of volume IDs with (for example) matching tags.
    17  func GetEbsVolumes(ctx *pulumi.Context, args *GetEbsVolumesArgs, opts ...pulumi.InvokeOption) (*GetEbsVolumesResult, error) {
    18  	opts = internal.PkgInvokeDefaultOpts(opts)
    19  	var rv GetEbsVolumesResult
    20  	err := ctx.Invoke("aws:ebs/getEbsVolumes:getEbsVolumes", args, &rv, opts...)
    21  	if err != nil {
    22  		return nil, err
    23  	}
    24  	return &rv, nil
    25  }
    26  
    27  // A collection of arguments for invoking getEbsVolumes.
    28  type GetEbsVolumesArgs struct {
    29  	// Custom filter block as described below.
    30  	Filters []GetEbsVolumesFilter `pulumi:"filters"`
    31  	// Map of tags, each pair of which must exactly match
    32  	// a pair on the desired volumes.
    33  	//
    34  	// More complex filters can be expressed using one or more `filter` sub-blocks,
    35  	// which take the following arguments:
    36  	Tags map[string]string `pulumi:"tags"`
    37  }
    38  
    39  // A collection of values returned by getEbsVolumes.
    40  type GetEbsVolumesResult struct {
    41  	Filters []GetEbsVolumesFilter `pulumi:"filters"`
    42  	// The provider-assigned unique ID for this managed resource.
    43  	Id string `pulumi:"id"`
    44  	// Set of all the EBS Volume IDs found. This data source will fail if
    45  	// no volumes match the provided criteria.
    46  	Ids  []string          `pulumi:"ids"`
    47  	Tags map[string]string `pulumi:"tags"`
    48  }
    49  
    50  func GetEbsVolumesOutput(ctx *pulumi.Context, args GetEbsVolumesOutputArgs, opts ...pulumi.InvokeOption) GetEbsVolumesResultOutput {
    51  	return pulumi.ToOutputWithContext(context.Background(), args).
    52  		ApplyT(func(v interface{}) (GetEbsVolumesResult, error) {
    53  			args := v.(GetEbsVolumesArgs)
    54  			r, err := GetEbsVolumes(ctx, &args, opts...)
    55  			var s GetEbsVolumesResult
    56  			if r != nil {
    57  				s = *r
    58  			}
    59  			return s, err
    60  		}).(GetEbsVolumesResultOutput)
    61  }
    62  
    63  // A collection of arguments for invoking getEbsVolumes.
    64  type GetEbsVolumesOutputArgs struct {
    65  	// Custom filter block as described below.
    66  	Filters GetEbsVolumesFilterArrayInput `pulumi:"filters"`
    67  	// Map of tags, each pair of which must exactly match
    68  	// a pair on the desired volumes.
    69  	//
    70  	// More complex filters can be expressed using one or more `filter` sub-blocks,
    71  	// which take the following arguments:
    72  	Tags pulumi.StringMapInput `pulumi:"tags"`
    73  }
    74  
    75  func (GetEbsVolumesOutputArgs) ElementType() reflect.Type {
    76  	return reflect.TypeOf((*GetEbsVolumesArgs)(nil)).Elem()
    77  }
    78  
    79  // A collection of values returned by getEbsVolumes.
    80  type GetEbsVolumesResultOutput struct{ *pulumi.OutputState }
    81  
    82  func (GetEbsVolumesResultOutput) ElementType() reflect.Type {
    83  	return reflect.TypeOf((*GetEbsVolumesResult)(nil)).Elem()
    84  }
    85  
    86  func (o GetEbsVolumesResultOutput) ToGetEbsVolumesResultOutput() GetEbsVolumesResultOutput {
    87  	return o
    88  }
    89  
    90  func (o GetEbsVolumesResultOutput) ToGetEbsVolumesResultOutputWithContext(ctx context.Context) GetEbsVolumesResultOutput {
    91  	return o
    92  }
    93  
    94  func (o GetEbsVolumesResultOutput) Filters() GetEbsVolumesFilterArrayOutput {
    95  	return o.ApplyT(func(v GetEbsVolumesResult) []GetEbsVolumesFilter { return v.Filters }).(GetEbsVolumesFilterArrayOutput)
    96  }
    97  
    98  // The provider-assigned unique ID for this managed resource.
    99  func (o GetEbsVolumesResultOutput) Id() pulumi.StringOutput {
   100  	return o.ApplyT(func(v GetEbsVolumesResult) string { return v.Id }).(pulumi.StringOutput)
   101  }
   102  
   103  // Set of all the EBS Volume IDs found. This data source will fail if
   104  // no volumes match the provided criteria.
   105  func (o GetEbsVolumesResultOutput) Ids() pulumi.StringArrayOutput {
   106  	return o.ApplyT(func(v GetEbsVolumesResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
   107  }
   108  
   109  func (o GetEbsVolumesResultOutput) Tags() pulumi.StringMapOutput {
   110  	return o.ApplyT(func(v GetEbsVolumesResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   111  }
   112  
   113  func init() {
   114  	pulumi.RegisterOutputType(GetEbsVolumesResultOutput{})
   115  }