github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lambda/getAlias.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 // Provides information about a Lambda Alias. 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.LookupAlias(ctx, &lambda.LookupAliasArgs{ 32 // FunctionName: "my-lambda-func", 33 // Name: "production", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupAlias(ctx *pulumi.Context, args *LookupAliasArgs, opts ...pulumi.InvokeOption) (*LookupAliasResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupAliasResult 47 err := ctx.Invoke("aws:lambda/getAlias:getAlias", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getAlias. 55 type LookupAliasArgs struct { 56 // Name of the aliased Lambda function. 57 FunctionName string `pulumi:"functionName"` 58 // Name of the Lambda alias. 59 Name string `pulumi:"name"` 60 } 61 62 // A collection of values returned by getAlias. 63 type LookupAliasResult struct { 64 // ARN identifying the Lambda function alias. 65 Arn string `pulumi:"arn"` 66 // Description of alias. 67 Description string `pulumi:"description"` 68 FunctionName string `pulumi:"functionName"` 69 // Lambda function version which the alias uses. 70 FunctionVersion string `pulumi:"functionVersion"` 71 // The provider-assigned unique ID for this managed resource. 72 Id string `pulumi:"id"` 73 // ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration's `uri`. 74 InvokeArn string `pulumi:"invokeArn"` 75 Name string `pulumi:"name"` 76 } 77 78 func LookupAliasOutput(ctx *pulumi.Context, args LookupAliasOutputArgs, opts ...pulumi.InvokeOption) LookupAliasResultOutput { 79 return pulumi.ToOutputWithContext(context.Background(), args). 80 ApplyT(func(v interface{}) (LookupAliasResult, error) { 81 args := v.(LookupAliasArgs) 82 r, err := LookupAlias(ctx, &args, opts...) 83 var s LookupAliasResult 84 if r != nil { 85 s = *r 86 } 87 return s, err 88 }).(LookupAliasResultOutput) 89 } 90 91 // A collection of arguments for invoking getAlias. 92 type LookupAliasOutputArgs struct { 93 // Name of the aliased Lambda function. 94 FunctionName pulumi.StringInput `pulumi:"functionName"` 95 // Name of the Lambda alias. 96 Name pulumi.StringInput `pulumi:"name"` 97 } 98 99 func (LookupAliasOutputArgs) ElementType() reflect.Type { 100 return reflect.TypeOf((*LookupAliasArgs)(nil)).Elem() 101 } 102 103 // A collection of values returned by getAlias. 104 type LookupAliasResultOutput struct{ *pulumi.OutputState } 105 106 func (LookupAliasResultOutput) ElementType() reflect.Type { 107 return reflect.TypeOf((*LookupAliasResult)(nil)).Elem() 108 } 109 110 func (o LookupAliasResultOutput) ToLookupAliasResultOutput() LookupAliasResultOutput { 111 return o 112 } 113 114 func (o LookupAliasResultOutput) ToLookupAliasResultOutputWithContext(ctx context.Context) LookupAliasResultOutput { 115 return o 116 } 117 118 // ARN identifying the Lambda function alias. 119 func (o LookupAliasResultOutput) Arn() pulumi.StringOutput { 120 return o.ApplyT(func(v LookupAliasResult) string { return v.Arn }).(pulumi.StringOutput) 121 } 122 123 // Description of alias. 124 func (o LookupAliasResultOutput) Description() pulumi.StringOutput { 125 return o.ApplyT(func(v LookupAliasResult) string { return v.Description }).(pulumi.StringOutput) 126 } 127 128 func (o LookupAliasResultOutput) FunctionName() pulumi.StringOutput { 129 return o.ApplyT(func(v LookupAliasResult) string { return v.FunctionName }).(pulumi.StringOutput) 130 } 131 132 // Lambda function version which the alias uses. 133 func (o LookupAliasResultOutput) FunctionVersion() pulumi.StringOutput { 134 return o.ApplyT(func(v LookupAliasResult) string { return v.FunctionVersion }).(pulumi.StringOutput) 135 } 136 137 // The provider-assigned unique ID for this managed resource. 138 func (o LookupAliasResultOutput) Id() pulumi.StringOutput { 139 return o.ApplyT(func(v LookupAliasResult) string { return v.Id }).(pulumi.StringOutput) 140 } 141 142 // ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration's `uri`. 143 func (o LookupAliasResultOutput) InvokeArn() pulumi.StringOutput { 144 return o.ApplyT(func(v LookupAliasResult) string { return v.InvokeArn }).(pulumi.StringOutput) 145 } 146 147 func (o LookupAliasResultOutput) Name() pulumi.StringOutput { 148 return o.ApplyT(func(v LookupAliasResult) string { return v.Name }).(pulumi.StringOutput) 149 } 150 151 func init() { 152 pulumi.RegisterOutputType(LookupAliasResultOutput{}) 153 }