【发布时间】:2019-11-03 23:16:54
【问题描述】:
我正在尝试使用 python3.x 和 boto3 创建用户,但最终遇到了一些问题
我尝试过使用“admin_create_user”,即使 id 对我不起作用
import boto3
aws_client = boto3.client('cognito-idp',
region_name = CONFIG["cognito"]["region"]
)
response = aws_client.admin_create_user(
UserPoolId = CONFIG["cognito"]["pool_id"],
Username = email,
UserAttributes = [
{"Name": "first_name", "Value": first_name},
{"Name": "last_name", "Value": last_name},
{ "Name": "email_verified", "Value": "true" }
],
DesiredDeliveryMediums = ['EMAIL']
)
【问题讨论】:
-
错误说明了一切。您没有在任何地方传递访问密钥和秘密密钥,也没有在 awscli 中将其保存在您的机器上。
标签: python python-3.x boto3 amazon-cognito