dongzao9044
2019-09-16 21:27
浏览 125
已采纳

尝试调用Go AWS Lambda函数时权限被拒绝

I've created a AWS Lambda function that I'm using a Webhook to call an API Gateway Below is the code I've built with go build -o main.go since I've been reading that you have to specify the extension.

package main

import (
    "context"
    "fmt"

    "github.com/aws/aws-lambda-go/lambda"
)

func HandleRequest(ctx context.Context) (string, error) {
    return fmt.Sprintf("Hello!"), nil
}

func main() {
    lambda.Start(HandleRequest)
}

The issue is even though I have public permissions on my uploaded S3 function .zip as well as role permissions I'm still getting a permissions error.

{
  "errorMessage": "fork/exec /var/task/main: permission denied",
  "errorType": "PathError"
}

图片转代码服务由CSDN问答提供 功能建议

我创建了一个AWS Lambda函数,我正在使用Webhook调用 API网关以下是我使用 go build -o main.go 构建的代码 >由于我一直在阅读,因此您必须指定扩展名。

 包main 
 
import(
“上下文” 
“ fmt” 
 
“ github.com/aws/aws-lambda-go/lambda”  
)
 
func HandleRequest(ctx context.Context)(字符串,错误){
返回fmt.Sprintf(“ Hello!”),nil 
} 
 
func main(){
 lambda.Start  (HandleRequest)
} 
   
 
 

即使我有对我上传的” rel =“ nofollow noreferrer”> S3函数.zip < / a>以及角色权限我仍然遇到权限错误。

  {
“ errorMessage”:“ fork / exec / var / task / main:权限被拒绝”,
“ errorType”:“ PathError” 
} 
    
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题