【发布时间】:2017-11-28 00:22:50
【问题描述】:
尝试在 AWS Lambda 上使用 boto3 启动和停止 RDS 实例时,我遇到了一个有趣的错误 - 'RDS' object has no attribute 'stop_db_instance': AttributeError
即使是最简单的代码也会抛出这个错误,例如
import boto3
def lambda_handler(event, context):
boto3.client('rds').stop_db_instance(DBInstanceIdentifier='myInstanceID')
我正在使用 python3.6 运行时,因此根据 this 页面上提供的信息,boto3 1.4.4 应该可用(我假设它已经有适当的方法 - https://boto3.readthedocs.io/en/latest/reference/services/rds.html#RDS.Client.stop_db_instance)
感谢任何建议!
【问题讨论】:
标签: python amazon-web-services aws-lambda boto3