我尝试使用AWS Cognito实现注册,显然自上次尝试以来,AWS上发生了一些变化。我依靠'cognito-idp'服务(http://boto3.readthedocs.io/en/latest/reference/services/cognito-idp.html),这是不再可用的。以下是我可以通过boto3获得的所有可用服务的列表:
['autoscaling','cloudformation','cloudfront','cloudhsm', 'cloudsearch','cloudsearchdomain','cloudtrail','cloudwatch', 'codedeploy','cognito-identity','cognito-sync','config', 'datapipeline','directconnect','ds','dynamodb','ec2','ecs', 'efs','elasticache','elasticbeanstalk','elastictranscoder','elb', 'emr','glacier','iam','importexport','kinesis','kms','lambda', 'logs','machinelearning','opsworks','rds','redshift','route53', 'route53domains','s3','sdb','ses','sns','sqs','ssm', 'storagegateway','sts','support','swf','workspaces']
再也没有'cognito-idp'了。 AWS上是否有最新的更改,或者我错过了哪些内容?
答案 0 :(得分:1)
您使用的是旧版本的Boto3(botocore),其中不支持cognito-idp
服务。我的安装目前不支持cognito-idp
,您的安装应该比我的安装年龄大。升级boto3
,您应该看到Boto3支持cognito-idp
。
>>> import boto3
>>> boto3.__version__
'1.4.0'
>>> boto3.Session().get_available_services()
['acm', 'apigateway', 'application-autoscaling', 'autoscaling', 'cloudformation', 'cloudfront', 'cloudhsm', 'cloudsearch', 'cloudsearchdomain', 'cloudtrail', 'cloudwatch', 'codecommit', 'codedeploy', 'codepipeline', 'cognito-identity', 'cognito-idp', 'cognito-sync', 'config', 'datapipeline', 'devicefarm', 'directconnect', 'discovery', 'dms', 'ds', 'dynamodb', 'dynamodbstreams', 'ec2', 'ecr', 'ecs', 'efs', 'elasticache', 'elasticbeanstalk', 'elastictranscoder', 'elb', 'elbv2', 'emr', 'es', 'events', 'firehose', 'gamelift', 'glacier', 'iam', 'importexport', 'inspector', 'iot', 'iot-data', 'kinesis', 'kinesisanalytics', 'kms', 'lambda', 'logs', 'machinelearning', 'marketplacecommerceanalytics', 'meteringmarketplace', 'opsworks', 'rds', 'redshift', 'route53', 'route53domains', 's3', 'sdb', 'servicecatalog', 'ses', 'snowball', 'sns', 'sqs', 'ssm', 'storagegateway', 'sts', 'support', 'swf', 'waf', 'workspaces']
>>> import botocore
>>> botocore.__version__
'1.4.56'
答案 1 :(得分:0)
这很愚蠢,但是我遇到了这个错误,因为我写了:
client = boto3.client('cognito_idp') [Note the underscore]
而不是:
client = boto3.client('cognito-idp') [hyphen, no underscore]