25 questions
1
vote
3
answers
4k
views
Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]
I am attempting to deploy an aws lambda function written in golang. However i get the following error:
Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]
IntradaySchedulerLfn ...
1
vote
1
answer
2k
views
AWS Lambda INIT_REPORT Runtime.ExitError in go app
I am using Lambda web adapter to run a Image from AWS-ECR. I am getting the below error during invocation. When this error is encountered, Lambda is invoked again.
Cloudwatch logs:
EXTENSION Name: ...
1
vote
0
answers
235
views
AWS Go lambda recevie raw http request bytes without any base64 encoding through API gateway
I am trying to build a rest api with Go using lambda and api gateway. In the api, I want to process the raw request body bytes without any base64 conversion in middle.
I am able to receive base64 ...
0
votes
1
answer
57
views
Trivial GO lambda in IMAGE fails with /bin/sh: ./lambda-handler: Permission denied
I am using the aws provided docker file to build a SAM template. The sam build and deploy works as expected, however when calling the endpoint I get Internal Server Error with
/bin/sh: ./lambda-...
2
votes
0
answers
205
views
Is there a way to read session tags from within an AWS lambda?
I have an AWS lambda written in Go which is invoked using:
aws lambda invoke …
I am setting session (sts) tags before invoking the lambda. Is there a way from within the lambda to get the session of ...
1
vote
1
answer
1k
views
cannot use req (variable of type events.APIGatewayProxyRequest) as core.SwitchableAPIGatewayRequest value in argument to adapter.ProxyWithContext
I'm new to Golang. I can't seem to supply the argument needed to work with adapter.ProxyWithContext. According to this https://pkg.go.dev/github.com/awslabs/[email protected]/gorillamux#...
1
vote
1
answer
3k
views
Terraform resource AWS LAMBDA GO Error : "fork/exec /var/task/main: no such file or directory"
I have a go script and I am making Terraform resource aws_lambda_function with runtime configurations as such :
handler = "main"
memory_size = 512
timeout = 360
runtime = ...
6
votes
1
answer
5k
views
func init() vs func main() for initalizing global state in AWS Lambda handlers
Looking at the Using global state section in the official AWS Lambda function handler in Go doc
https://docs.aws.amazon.com/lambda/latest/dg/golang-handler.html
suggests to initialise all global state ...
-4
votes
1
answer
1k
views
json: invalid use of string struct tag [closed]
I'm trying to write simple POST serverless Go AWS lambda function.
package main
import (
"fmt"
)
import (
"encoding/json"
"github.com/aws/aws-lambda-go/events&...
0
votes
1
answer
1k
views
Go lambda S3 file upload results in new object with size of 0
I'm writing my first golang api with aws lambda. The idea being to be able to record audio from a browser and save as an object in s3. I've gotten to the point of being able to save an object in the ...
1
vote
1
answer
237
views
How to allow anonymous access to images compressed by Lambda
I am using the AWS Lambda function named 'compress' by 'evanchiu'
I have set the source folder and destination folder. Both folders have 'Objects can be public' permission.
I am uploading images to ...
0
votes
2
answers
859
views
AWS Lambda GO PathError (Windows 10)
I've done the following in PowerShell in VSCode:
PS D:\Project Resume> set GOOS=linux
PS D:\Project Resume> set GOARCH=amd64
PS D:\Project Resume> set CGO_ENABLED=0
PS D:\Project Resume> ...
0
votes
1
answer
158
views
AWS Go Lambda: If/else Issue
I'm just trying to pick up Golang in the AWS Lambda flavor. I feel like the answer here is super simple, but I can't put my finger on it, nor could I find a post similar to this problem just yet.
//...
0
votes
0
answers
385
views
Returning pointer from an aws lambda
I was looking into a piece of code of creating a simple lambda function with go which returns a dummy value when invoked.
package main
import (
"github.com/aws/aws-lambda-go/lambda"
)
...
3
votes
1
answer
6k
views
How do I get the URL parameters with AWS lambda functions?
I am using Netlify functions for an API, most of which is working perfectly fine, apart from when I am needing to access URL parameters
Here is a snippet of what I have to get the parameter:
func ...
0
votes
1
answer
1k
views
Unable to find API Gateway Mapping Template for Golang
I have created a webhook for Twilio on AWS API Gateway, which is sending the request in application/x-www-form-urlencoded Content-Type. I am unable to write or find a mapping template for Golang.
I am ...
1
vote
0
answers
222
views
Invoke python application from lambda written in go
I'm developing an aws based application entirely in golang though I have a piece of python code I need to invoke in a lambda function as a separate subprocess.
The python code is written as a CLI ...
3
votes
1
answer
1k
views
AWS Lambda Go: The VM errors out in mounting the folder, /var/task/main no such file or directory. How to resolve?
I created a "hellogo" lambda, and tried to run it locally using
sam package
sam deploy
sam local start-api
accessing : http://localhost:3000/hellogo
The docker has the hellogo folder shared in ...
1
vote
0
answers
754
views
My Lambda function is timing out when I try to ping a DB connection
It seems like a very simple thing but my connection times out every time.
Here is the code in the Lambda function (written in Go)
package main
import (
"database/sql"
"log"
_ "github....
13
votes
1
answer
10k
views
AWS Lambda Go function not getting request body when called via API GW
First off, one might say this question is very similar to HTTP request body not getting to AWS lambda function via AWS API Gateway or Getting json body in aws Lambda via API gateway
However, none of ...
2
votes
1
answer
8k
views
Unable to invoke lambda function from localstack via aws cli
I have the lambda function pushed as I can see it in localstack, based on below command/output
aws lambda get-function --function-name books1 --endpoint-url=http://localhost:4574
{
"Code": {
...
0
votes
2
answers
2k
views
Can we publish a message to SNS topic using a lambda function written in Go language?
I had a lambda function written in Golang. And I was trying to publish a message to SNS topic from lambda function before the lambda is executed . Is it possible to do so?
0
votes
1
answer
559
views
Distinguish between two instances of the same AWS lambda
I need to uniquely identify the message I'm sending from the lambda to some consumer. What unique information can I utilize to create the unique ID for each message I'm sending out?
I can send few ...
42
votes
2
answers
28k
views
exec format error when running AWS Golang Lambda
I have a go application, structured like this:
cmd|reports|main.go
main.go imports internal/reports package and has a single function, main(), which delegates call to aws-lambda-go/lambda.Start() ...
5
votes
1
answer
7k
views
Mock context.Context to test lambdacontext.FromContext
I'm building an aws lambda using aws-sdk-go and aws-lambda-go and I'm stuck with a little problem.
I want to test my lambda handler. To do so, I need to mock a valid context.Context containing valid ...