简体   繁体   English

AWS LAMBDA 函数“无法读取未定义的属性‘s3’”

[英]AWS LAMBDA function "Cannot read property 's3' of undefined"

I am using lambda AWS to convert mp4 to HLS and when I put my hostname: I am getting an error of the following:我正在使用 lambda AWS 将 mp4 转换为 HLS,当我输入我的主机名时:我收到以下错误:

{

"errorType": "TypeError",
  "errorMessage": "Cannot read property 's3' of undefined",
  "trace": [
    "TypeError: Cannot read property 's3' of undefined",
    "    at Runtime.exports.handler (/var/task/index.js:14:35)",
    "    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
  ]
}

It looks like the event your Lambda function is not a valid S3 event .看起来您的 Lambda 函数不是有效的 S3 事件

At a guess, you are manually triggering your Lambda function with a test event from the AWS console and you have supplied an non-conformant JSON structure.猜测一下,您正在使用来自 AWS 控制台的测试事件手动触发您的 Lambda 函数,并且您提供了一个不符合标准的 JSON 结构。

Here is a minimal example of what you need in the test event:这是您在测试活动中需要的一个最小示例:

{
  "Records": [
    {
      "s3": {
        "bucket": {
          "name": "my-s3-bucket"
        },
        "object": {
          "key": "HappyFace.jpg"
        }
      }
    }
  ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TypeError:无法读取未定义的属性“byteLength”-AWS S3 上传 - TypeError: Cannot read property 'byteLength' of undefined - AWS S3 Upload AWS Lambda:“无法读取未定义的属性‘0’” - AWS Lambda: "Cannot read property '0' of undefined" AWS Lambda:函数已成功创建,但在创建触发器时出错:无法读取未定义的属性“包含” - AWS Lambda: function was created successfully but an error occurred when creating the trigger: Cannot read property 'includes' of undefined AWS Lambda TypeError:无法读取未定义的属性“ toString” - AWS lambda TypeError: Cannot read property 'toString' of undefined TypeError:无法读取未定义的属性'id'-AWS Lambda - TypeError: Cannot read property 'id' of undefined - AWS Lambda AWS Lambda函数从S3读取并写入Elastic Cache - AWS Lambda function to read from S3 and write to Elastic Cache AWS Lambda函数和S3 - AWS lambda function & S3 无法在 AWS 中为 Lambda function 设置 S3 触发器 - Cannot set S3 trigger for Lambda function in AWS 无法上传到我的 Lambda function 内的 AWS S3 - Cannot upload to AWS S3 inside my Lambda function Lambda function 错误消息“:”无法读取未定义的属性“桶” - Lambda function errorMessage“: ”Cannot read property 'bucket' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM