'AWS CORS Enabling - Where it needs to be enabled? Chalice? Dynamodb? or S3?
Trying my hands on with aws. I have done following.
Created a dynamodb table.
Created Chalice app to access the data through api.
Created a Angular6 application to do CRUD operation on the table using above api.
Everything worked fine when the angular app was on local. Now I uploaded my angular app on to S3, after that I am getting CORS error.
As per the documentation I did set the CORS Rules on s3 bucket but still the error persist.
Apart from S3 bucket do I need to set the CORS Rules somewhere else as well?
Error ScreenShot:
S3 bucket CORS Conf:
Solution 1:[1]
Setting the CORS on API gateway did not help, but setting the cors=True on the chalice app.py did help. As per the documentation they both are supposed to behave the same way, but in my case it did not help.
@app.route('/gsgl/update', methods=['PUT'],cors=True)
reference: https://github.com/aws/chalice#tutorial-cors-support
Solution 2:[2]
Your application architecture is not evident form the questions.
However the error screen shot you have posted may hint at the fact that an API gateway is involved and You may need to enable CORS on the API gateway that you have created.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | just10minutes |
Solution 2 | Yogesh_D |