github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lambda/getFunctions.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 lambda
     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  // Data resource to get a list of Lambda Functions.
    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/lambda"
    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 := lambda.GetFunctions(ctx, nil, nil)
    32  //			if err != nil {
    33  //				return err
    34  //			}
    35  //			return nil
    36  //		})
    37  //	}
    38  //
    39  // ```
    40  // <!--End PulumiCodeChooser -->
    41  func GetFunctions(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetFunctionsResult, error) {
    42  	opts = internal.PkgInvokeDefaultOpts(opts)
    43  	var rv GetFunctionsResult
    44  	err := ctx.Invoke("aws:lambda/getFunctions:getFunctions", nil, &rv, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return &rv, nil
    49  }
    50  
    51  // A collection of values returned by getFunctions.
    52  type GetFunctionsResult struct {
    53  	// A list of Lambda Function ARNs.
    54  	FunctionArns []string `pulumi:"functionArns"`
    55  	// A list of Lambda Function names.
    56  	FunctionNames []string `pulumi:"functionNames"`
    57  	// The provider-assigned unique ID for this managed resource.
    58  	Id string `pulumi:"id"`
    59  }
    60  
    61  func GetFunctionsOutput(ctx *pulumi.Context, opts ...pulumi.InvokeOption) GetFunctionsResultOutput {
    62  	return pulumi.ToOutput(0).ApplyT(func(int) (GetFunctionsResult, error) {
    63  		r, err := GetFunctions(ctx, opts...)
    64  		var s GetFunctionsResult
    65  		if r != nil {
    66  			s = *r
    67  		}
    68  		return s, err
    69  	}).(GetFunctionsResultOutput)
    70  }
    71  
    72  // A collection of values returned by getFunctions.
    73  type GetFunctionsResultOutput struct{ *pulumi.OutputState }
    74  
    75  func (GetFunctionsResultOutput) ElementType() reflect.Type {
    76  	return reflect.TypeOf((*GetFunctionsResult)(nil)).Elem()
    77  }
    78  
    79  func (o GetFunctionsResultOutput) ToGetFunctionsResultOutput() GetFunctionsResultOutput {
    80  	return o
    81  }
    82  
    83  func (o GetFunctionsResultOutput) ToGetFunctionsResultOutputWithContext(ctx context.Context) GetFunctionsResultOutput {
    84  	return o
    85  }
    86  
    87  // A list of Lambda Function ARNs.
    88  func (o GetFunctionsResultOutput) FunctionArns() pulumi.StringArrayOutput {
    89  	return o.ApplyT(func(v GetFunctionsResult) []string { return v.FunctionArns }).(pulumi.StringArrayOutput)
    90  }
    91  
    92  // A list of Lambda Function names.
    93  func (o GetFunctionsResultOutput) FunctionNames() pulumi.StringArrayOutput {
    94  	return o.ApplyT(func(v GetFunctionsResult) []string { return v.FunctionNames }).(pulumi.StringArrayOutput)
    95  }
    96  
    97  // The provider-assigned unique ID for this managed resource.
    98  func (o GetFunctionsResultOutput) Id() pulumi.StringOutput {
    99  	return o.ApplyT(func(v GetFunctionsResult) string { return v.Id }).(pulumi.StringOutput)
   100  }
   101  
   102  func init() {
   103  	pulumi.RegisterOutputType(GetFunctionsResultOutput{})
   104  }