Error upload file. Use zappa+ lambda + s3 + django2 + RDS + Python 3.6
See original GitHub issueWhen I save in local it keeps me well in S3 but when it is running with lamda I get the following error. I’ve used with django 1.11 and python 2.7 and it works fine `
Request Method: | POST |
---|---|
https://s5h4s4t98f.execute-api.us-west-2.amazonaws.com/dev/admin/publicidad/publicidad/add/ | |
2.1.1 | |
ClientError | |
An error occurred (InvalidToken) when calling the PutObject operation: The provided token is malformed or otherwise invalid. | |
/var/runtime/botocore/client.py in _make_api_call, line 612 | |
/var/lang/bin/python3.6 | |
3.6.1 | |
[‘/var/task’, ‘/var/runtime/awslambda’, ‘/var/runtime’, ‘/var/lang/lib/python36.zip’, ‘/var/lang/lib/python3.6’, ‘/var/lang/lib/python3.6/lib-dynload’, ‘/var/lang/lib/python3.6/site-packages’, ‘/var/task/setuptools-39.1.0-py3.6.egg’, ‘/var/task’] | |
Lun, 24 Sep 2018 00:27:27 -0500 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Zappa S3 Django Media Upload Times Out - Stack Overflow
I am trying to configure Zappa and Django to be able to upload media files but I am getting a weird permission error...
Read more >Using Zappa and AWS Lambda to deploy serverless Django ...
Package your projects into Lambda-ready zip files and upload them to Amazon S3; Set up necessary AWS IAM roles and permissions; Deploy your ......
Read more >Serve a Django App from an AWS Lambda Function - Blog
Learn how to deploy your Django app to a serverless architecture in AWS' free usage tier using Zappa, AWS CLI, IAM, Lambda, S3...
Read more >zappa - PyPI
Server-less Python Web Services for AWS Lambda and API Gateway. ... Deploy or update your app using Zappa; Run $ zappa certify to...
Read more >Serverless Django with Zappa on AWS Lambda - Blog Post
cd /path/to/your/dev/folder/ $ pipenv install --python 3.6 zappa django ... Below we'll use zappa init to create our zappa's settings file ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This happens to me because
AWS_ACCESS_KEY_ID
+AWS_SECRET_ACCESS_KEY
do not match withAWS_SESSION_TOKEN
(see #68)When using Zappa, do not provide your own access+secret key. Use the built-in ones given by AWS Lambda, including the session token. If you want to change the role, change your Lambda function’s IAM execution role.
@ceefour thank you for the correct answer!
It is NOT about removing the variables from settings.py. The variables there must be mapped to the environment variables, that are automatically provided by lambda. So it has to be like:
These keys are unique for every lambda deployment, bound to the IAM role that is used by lambda.