None of the variables come through in an Lambda Invoke
- Dominant language
- Go
- Stars
- 8.8k
- Forks
- 383
- PR merge metrics
- No merged PRs in 30d
Description
## Prerequisites
* [x] I am running the latest version. (`up upgrade`)
* [x] I searched to see if the issue already exists.
* [x] I inspected the verbose debug output with the `-v, --verbose` flag.
* [x] Are you an Up Pro subscriber?
## Description
When I invoke a function through the lambda interface it seems to call it just fine, but none of the variables passed in make it through with the request. Just trying to see if I missed something in the setup.
## Steps to Reproduce
Attached is the code I used.
```
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"os"
)
func main() {
addr := ":" + os.Getenv("PORT")
http.HandleFunc("/", hello)
log.Fatal(http.ListenAndServe(addr, nil))
}
func hello(w http.ResponseWriter, r *http.Request) {
requestDump, err := httputil.DumpRequest(r, true)
if err != nil {
fmt.Println(err)
}
fmt.Println(string(requestDump))
fmt.Fprintln(w, "Hello World from Go")
}
```
### Log Output
```
Nov 3rd 11:39:25am INFO staging $LATEST initializing
Nov 3rd 11:39:25am INFO staging $LATEST starting app: PORT=35577 command=./server
Nov 3rd 11:39:25am INFO staging $LATEST started app
Nov 3rd 11:39:25am INFO staging $LATEST waiting for app to listen on PORT
Nov 3rd 11:39:25am INFO staging $LATEST app listening: duration=254ms
Nov 3rd 11:39:25am INFO staging $LATEST initialized: duration=257ms
Nov 3rd 11:39:25am INFO staging $LATEST request: method=GET
Nov 3rd 11:39:25am INFO staging $LATEST response: duration=19ms method=GET size=20 B status=200 Nov 3rd 11:39:25am INFO REPORT RequestId: 26347803-def0-11e8-81ce-6bbe7f8a55e9 Duration: 486.31 ms Billed Duration: 500
ms Memory Size: 512 MB Max Memory Used: 67 MB
Nov 3rd 11:44:30am INFO staging $LATEST initializing
Nov 3rd 11:44:30am INFO staging $LATEST starting app: PORT=36071 command=./server
Nov 3rd 11:44:30am INFO staging $LATEST started app
Nov 3rd 11:44:30am INFO staging $LATEST waiting for app to listen on PORT
Nov 3rd 11:44:30am INFO staging $LATEST app listening: duration=250ms
Nov 3rd 11:44:30am INFO staging $LATEST initialized: duration=251ms
Nov 3rd 11:44:30am INFO staging $LATEST request: method=GET
Nov 3rd 11:44:30am INFO staging $LATEST GET / HTTP/1.1
Nov 3rd 11:44:30am INFO staging $LATEST Host: 127.0.0.1:36071
Nov 3rd 11:44:30am INFO staging $LATEST Connection: close
Nov 3rd 11:44:30am INFO staging $LATEST Accept-Encoding: gzip
Nov 3rd 11:44:30am INFO staging $LATEST Connection: close
Nov 3rd 11:44:30am INFO staging $LATEST X-Context: {"apiId":"","resourceId":"","requestId":"","accountId":"","stage":"","identity":{"apiKey":"","accountId":"","userAgent":"","sourceIp":"","accessKey":"","caller":"","user":"","userARN":"","cognitoIdentityId":"","cognitoIdentityPoolId":"","cognitoAuthenticationType":"","cognitoAuthenticationProvider":""},"authorizer":null}
Nov 3rd 11:44:30am INFO staging $LATEST X-Request-Id:
Nov 3rd 11:44:30am INFO staging $LATEST X-Stage:
Nov 3rd 11:44:30am INFO staging $LATEST
Nov 3rd 11:44:30am INFO staging $LATEST
Nov 3rd 11:44:30am INFO staging $LATEST response: duration=8ms method=GET size=20 B status=200
Nov 3rd 11:44:30am INFO REPORT RequestId: dbce075b-def0-11e8-af74-2f6feb99ce1f Duration: 478.90 ms Billed Duration: 500 ms Memory Size: 512 MB Max Memory Used: 41 MB
```
Contributor guide
Assessment
This issue has not been assessed yet.