我有代码创建类型为'lambda'的boto3客户端 . 然后我使用该客户端调用list_functions(),create_function()和update_function()方法 . 这一切都很好,如本文档中所述:http://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.list_functions
但是当我去使用list_tags()或tag_resource()方法概述时:http://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.list_tags
我收到一个错误说:
AttributeError:'Lambda'对象没有属性'list_tags'
我究竟做错了什么?这些方法列在同一个doc页面上,所以我认为它们是在同一个客户端上调用的 . 是什么赋予了:
l = boto3.client(
'lambda',
region_name='us-east-1',
aws_access_key_id = 'AletitgoQ',
aws_secret_access_key = 'XvHowdyW',
)
l.list_tags(
Resource="myArn"
)
l.tag_resource(
Resource="myArn",
Tags={
'action': 'test'
}
)
更糟糕的是,我似乎无法在create_function()调用中包含标记,尽管文档在此处对此进行了说明:http://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.create_function
当我在通话中包含标签时,我得到以下回复:
botocore.exceptions.ParamValidationError:参数验证失败:输入中的未知参数:“Tags”必须是以下之一:FunctionName,Runtime,Role,Handler,Code,Description,Timeout,MemorySize,Publish,VpcConfig,DeadLetterConfig,Environment,KMSKeyArn
将该列表与boto3文档中显示的内容进行比较,您会看到最后遗漏了一些内容,包括标签
我在python 2.7和pip确认我的boto3是1.4.4
1 回答
它适用于我: