0
我今天开始使用AWS Lambda,并且无法将有效内容传递到该函数。在服务器端,我尝试读取所有事件数据,但它是空的。我在这里做错了什么?AWS Lamba调用具有参数/有效负载的函数
$client = LambdaClient::factory(array(
'profile' => 'default',
'key' => AWS_ACCESS_KEY_ID,
'secret' => AWS_SECRET_ACCESS_KEY,
'region' => 'eu-west-1'
));
$payload = array('key1' => '1');
$result = $client->invoke(array(
'FunctionName' => 'hello',
'InvocationType' => 'RequestResponse',
'LogType' => 'Tail',
'Payload' => json_encode($payload)
));
返回值:AWS
Received event: {}
功能代码:
console.log('Loading function');
exports.handler = function(event, context) {
console.log('Received event:', JSON.stringify(event, null, 2));
};