Bypass CORS policy on S3-hosted site connected to RDS database
0
I have a public domain in S3 connected to an RDS database via MySQL, a lambda function that runs scripts on the MySQL database, and an API gateway that sends queries to the lambda function. Whenever I try to make an API call from my site, I get the error below.
Access to XMLHttpRequest at (lambda url) from origin (my site) has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How can I get around this?
1 Answers
0
You can activate CORS on the API-Gateway. https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors.html
This will add the required OPTIONS Method for the preflight Request to your API.
answered 2 months ago
Relevant questions
Why the LoginFailures metric showing no data for RDS MySQL instance?
asked 3 years agoBypass CORS policy on S3-hosted site connected to RDS database
asked 2 months agoWhat are the minimal MySQL grants required by SecretsManager to rotate a password?
asked 4 months agoInternal Server Error from API Gateway when sending queries through gateway to Lambda function connected to RDS database
asked 2 months agoBest way to publicly host a website of HTML/JS files and connect them to a RDS database?
asked 2 months agoHow to connect MySQL database in nodeJS file.
asked 2 years agoHow to retrieve DATETIME fields from RDS database on S3 site via API Gateway and Lambda function
asked a month agoCan I import an RDS uncrypted mysql snapshot to an RDS encrypted mysql?
Accepted Answerasked 2 months agoContinues Replication between RDS MYsql to Keyspace Cassandra
Accepted Answerasked 2 months agoBest way to run a web scraper from my S3 website and save the returned information to a database
asked 2 months ago