aws / aws/aws-lambda-go

Lambdacontext version is always $LATEST

Open
#357 1 comment 1 reaction 0 assignees View on GitHub
question
Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
8h 18m
Merged PRs (30d)
1

Description

Using lambdacontext.version always gives the string `$LATEST`.

However, when I publish the lambda zip file, the response gives me a version number:

`aws lambda update-function-code --function-name ${{ env.FUNCTION_NAME }} --zip-file fileb://function.zip --publish`

Gives me this output: (note the 'Version:5')
```
{
"LastUpdateStatus":"Successful",
"FunctionName":"",
"LastModified":"2021-01-29T09:13:41.146+0000",
"RevisionId":"687f3a39-f5cc-4b20-b4ab-f0039c5a6cf3",
"MemorySize":128,
"Environment":{
"Variables":{
"":"",
},
"State":"Active",
"Version":"5",
"Role":"arn:aws:iam::***:",
"Timeout":3,
"Handler":"lambda-adapter",
"Runtime":"go1.x",
"TracingConfig":{
"Mode":"Active"
},
"CodeSha256":"bLIkKUdJw1zDMgwje2qxREodpGmRruyYTXVF0wHoVrM=",
"Description":"",
"CodeSize":6570169,
"FunctionArn":"arn:aws:lambda:us-east-1:***:function:",
"PackageType":"Zip"
}
```
How can I get the lambda version from inside code without just getting `$LATEST`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.