Skip to content

AWS Amplify throws 403

0

I had deployed AWS Amplify that is internally calling APIs and it was throwing 403. After checking everything that looked fine, I just redeployed Amplify and unexpectedly started working. It worked for some days but now throwing the same 403 error again while calling those same APIs. Can someone help me on this, APIs are set correctly for CORS and Load balancer SG is also all fine that I haven't changed since it started working.

asked a year ago193 views

1 Answer
0

The 403 error you're experiencing with AWS Amplify is a known intermittent issue that can occur even without any changes to your deployment. There are several potential causes:

  1. Intermittent CloudFront Issues: AWS Amplify uses CloudFront distributions behind the scenes, and these can occasionally fail with 403 errors that resolve on their own or after redeployment.

  2. Authorization Header Problems: A common issue with Amplify is that authorization headers are sometimes missing from API requests, causing 403 Forbidden errors. This happens intermittently and can be difficult to reproduce consistently.

  3. AWS WAF Rules: If you have AWS WAF enabled for your Amplify app (or if AWS has made changes to underlying configurations), certain requests might be getting blocked. AWS recently added firewall support for Amplify hosted sites, which could potentially impact your application.

  4. IAM Role Permissions: The IAM role associated with your Amplify app might have permission issues that manifest intermittently.

Some troubleshooting steps you can take:

  1. Redeploy your application again (since this worked previously)
  2. Check CloudFront logs and AWS WAF logs (if enabled) for patterns in the 403 errors
  3. Implement more detailed error logging to capture information about the failed requests
  4. Verify that any authentication tokens are being properly managed and refreshed
  5. Check if there are any geographic restrictions in your CloudFront distribution that might be blocking API calls
  6. Review your IAM role permissions to ensure they haven't changed

Since redeployment worked temporarily before, it suggests this might be related to an intermittent issue with the underlying AWS services rather than your code or configuration.
Sources
Amplify throwing 403 ERROR | AWS re:Post
Intermittent Authorization Header Issue with AWS Amplify | AWS re:Post
on amplify react app deploy issue | AWS re:Post
Firewall support for AWS Amplify hosted sites | AWS News Blog

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.