我使用 Amplify CLI 创建了一个 Lambda 函数,执行 Lambda 函数时没有错误,但未创建 Cognito 用户。
我在这里缺少什么?
我已经检查了 CloudWatch Logs,但也没有发现任何错误。
/* Amplify Params - DO NOT EDIT
AUTH_XXXXXXXXXXXXXXXXXXXX_USERPOOLID
ENV
REGION
Amplify Params - DO NOT EDIT */
const AWS = require('aws-sdk');
AWS.config.update({ region: process.env.AWS_REGION,accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY });
const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider({ apiVersion: '2016-04-18' });
//console.log(process.env);
exports.handler = async (event) => {
let retailerid = event.pathParameters.retailerid;
let params = {
UserPoolId: process.env.AUTH_XXXXXXXXXXXXXXXXXXXX_USERPOOLID, /* required */
Username: 'testtest', /* required */
ClientMetadata: {
},
DesiredDeliveryMediums: [
'EMAIL'
],
ForceAliasCreation: false,
MessageAction: 'SUPPRESS',
TemporaryPassword: 'mynuw000000000TTS',
UserAttributes: [
{
Name: 'custom:app_role', /* required */
Value: 'retail'
},
{
Name: 'email_verified', /* required */
Value: 'true'
},
{
Name: 'email', /* required */
Value: 'usersname@someemail.co.za'
},
{
Name: 'phone_number', /* required */
Value: '27833260000'
},
/* more items */
],
ValidationData: [
/* more items */
]
};
神不在的星期二
HUX布斯
慕哥6287543
相关分类