When I used put_function_event_invoke_config of boto3,
import botocore
import boto3
client = boto3.client('lambda')
response = client.put_function_event_invoke_config(
FunctionName=FunctionName,
MaximumRetryAttempts=0,
)
The following error occurs
AttributeError: 'Lambda' object has no attribute 'put_function_event_invoke_config'
When translated
AttributeError: The'Lambda'object does not have the'put_function_event_invoke_config' attribute.
And that.
I added the following to lambda and confirmed the versions of boto3 and botocore.
print('botocore vertion is {0}'.format(botocore.__version__))
print('boto3 vertion is {0}'.format(boto3.__version__))
This is the result
botocore vertion is 1.12.253
boto3 vertion is 1.14.57
I checked the current version below ... Releases · boto/boto3 · GitHub Releases · boto/botocore · GitHub
botocore seems to be more than half a year old.
You can update it according to the following article.
[[AWS] How to use boto on Lambda and how to use the latest boto](https://bbh.bz/2019/11/10/how-to-use-latest-ver-boto-at-lambda/#boto -3)
In the case of Serverless Framework, it can be updated by inserting the serverless-python-requirements
plugin and adding boto3
and botocore
to requirement.txt.
The following articles will be helpful. [Tips] Deploy Lambda Layer with the latest boto3 installed with Serverless Framework
By updating botocore, the error has been resolved.
Recommended Posts