I'm trying to create API Gateway api keys in lambda using the sdk, but I can't seem to make it work Here's my code
exports.handler = (event, context, callback) => {
var apigateway = new AWS.APIGateway({apiVersion: '2015-07-09'});
var params = {
description: 'desc',
enabled: true,
generateDistinctId: true,
name: 'apiKey1',
value: 'qwerty'
};
apigateway.createApiKey(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
}
The function just times out after 1 minute, without logging anything at all to CloudWatch. It feels like the callback is never actually called.
Here are the policies attached to the function's role:
Anyone know what I'm missing?
callback(...).