【发布时间】:2020-05-21 19:12:38
【问题描述】:
我正在尝试在 Lambda 函数中创建一个 IOT 事物组。当我尝试运行此功能时,它只是超时并且日志中没有出现其他错误。增加执行时间并没有帮助。
var AWS = require('aws-sdk');
exports.handler = (event, context, callback) => {
const region = "eu-west-1";
const iotParams = {"apiVersion": "2019-05-28", "region": region};
var iot = new AWS.Iot(iotParams);
var params = {
thingGroupName: 'test',
tags: [
{
Key: 'name',
Value: 'test'
},
/* more items */
],
thingGroupProperties: {
attributePayload: {
attributes: {
'name': 'test',
},
merge: false
},
thingGroupDescription: 'test'
}
};
iot.createThingGroup(params, function(err, data) {
if (err) {
callback(err);
}
else {
callback(null, data);
}
});
};
【问题讨论】:
-
VPC 中有 lambda 吗?
-
@Marcin 是的,它在 VPC 中
-
我提供了一些在 vpc 中使用 lambda 时值得检查的信息。
标签: node.js amazon-web-services aws-lambda aws-iot