Create AWS Lambda function to get Users from IAM
问题 I want to get user details from AWS IAM so I have created a lambda function but there is an error with response code 502. My code is as below. var AWS = require('aws-sdk'); var iam = new AWS.IAM(); AWS.config.loadFromPath('./config.json'); let getUsers = async (event, callback) => { var params = { UserName: "5dc6f49d50498e2907f8ee69" }; iam.getUser(params, (err, data) => { if (err) { callback(err) } else { console.log(data) callback(data) } }) }; 回答1: Since your function already is async you