简体   繁体   English

Boto3:缺少 cognito-idp 服务

[英]Boto3: Missing cognito-idp service

I was trying to implement signup with AWS Cognito and apparently something has changed on AWS since the last time I tried.我正在尝试使用 AWS Cognito 进行注册,显然自上次尝试以来 AWS 上发生了一些变化。 I rely on 'cognito-idp' service ( http://boto3.readthedocs.io/en/latest/reference/services/cognito-idp.html ) which is not available anymore.我依赖于不再可用的“cognito-idp”服务( http://boto3.readthedocs.io/en/latest/reference/services/cognito-idp.html )。 Here is a list of all available services I can obtain through boto3:以下是我可以通过 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'] ['autoscaling'、'cloudformation'、'cloudfront'、'cloudhsm'、'cloudsearch'、'cloudsearchdomain'、'cloudtrail'、'cloudwatch'、'codedeploy'、'cognito-identity'、'cognito-sync'、'配置','数据管道','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']

No 'cognito-idp ' anymore whatsoever.不再有'cognito-idp'。 Are there any recent changes on AWS or am I missing something? AWS 上最近有什么变化还是我遗漏了什么?

You are using an older version of Boto3 (botocore) in which cognito-idp service is not supported.您使用的是不支持cognito-idp服务的旧版 Boto3 (botocore)。 My installation which is not current supports cognito-idp , yours should be older than mine.我的安装不是当前支持cognito-idp ,你的应该比我的旧。 Upgrade boto3 and you should see cognito-idp supported by Boto3.升级boto3 ,您应该会看到cognito-idp支持的 cognito 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'

This was very dumb, but I ran into this error because I wrote:这非常愚蠢,但我遇到了这个错误,因为我写道:

client = boto3.client('cognito_idp') [Note the underscore]

Rather than:而不是:

client = boto3.client('cognito-idp') [hyphen, no underscore]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM