himanshubhatt
The error indicates that the version of boto3 you are trying to use does not support this new field.
I see that you added a tag "lambda" to your post. Are you seeing this issue in a lambda deployment or when you run the script local?
If in a lamdba then the issue is that lambda doesn't use the latest version of boto3. You therefore have to bundle this with your deployment. To verify which version of boto3 and botocore is running in your lambda instance you can run the following in a python script:
print("boto3 version:"+boto3.version)
print("botocore version:"+botocore.version)
See https://www.mandsconsulting.com/lambda-functions-with-newer-version-of-boto3-than-available-by-default/ as an example of a similar experience as you reported and how this was resolved.
If local, then run "pip list" in the environment in which you execute your script and see what version of boto3 it reports.
I am running it on lambda locally on sam cli.
The version in the pip list of boto and botocore is 1.9.212 & 1.12.212 but when I print it that shows up the version 1.7.74 & 1.10.74.
himanshubhatt
As described in the link I had previously provided, you will have to bundle the updated boto3 version (and updated botocore) with your deployment.
See also https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html
Relevant content
- asked 2 years ago
- asked 4 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago