9

I have created one API in AWS API Gateway. In that API I created one proxy resource with custom http endpoint. But when I access the API Gateway endpoint https://2r3g3ttr6y.execute-api.eu-east-1.amazonaws.com/production/abc/abc.html it is not working whereas the original HTTP endpoint is working perfectly fine.

I get {"message":"Forbidden"} response. Here is the setting:

enter image description here

NOTE: The above API Endpoint is just a dummy endpoint.

Yuri
  • 4,254
  • 1
  • 29
  • 46
user3847894
  • 986
  • 4
  • 16
  • 37
  • Are you sure this is an issue with the gateway and not whatever it is tied to? I had a lambda function behind a gateway that was returning a forbidden message because of errors with being invoked. It was very misleading. – Brandon Miller May 30 '18 at 15:47
  • @BrandonMiller, I am damn sure this issue is not related to custom http end point as it is working perfectly fine – user3847894 May 30 '18 at 15:56
  • I once again double checked. It is not the issue of http endpoint but API gateway – user3847894 May 30 '18 at 15:59
  • Maybe you applied a resource policy to your API? According to the Resource Policy page, under APIs > YourApi, *If the Principal is set to AWS: ..., then authorization will fail for all resources not secured with AWS_IAM auth, including unsecured resources*. – Razvan May 31 '18 at 16:57
  • No I have not applied any resource policy – user3847894 May 31 '18 at 17:10
  • 2
    Make sure that stage IS deployed – iMysak Dec 07 '18 at 08:34

1 Answers1

1

This thing happened to me in the past because I forget to deploy my API.

Here how I fixed it:

Click Actions dropdown on the top -> Deploy API -> choose [New Stage] -> enter whatever name you want -> Deploy

Lê Quang Bảo
  • 2,670
  • 2
  • 27
  • 40
  • Doing so is also not working. Tried deploying to another new stage as well, but still facing same issue, able to call successfully from Postman client. but not from React UI using axios. – Vamsi May 18 '21 at 04:49
  • @Vamsi seems like you need to enable CORS, Click Actions dropdown on the top -> Enable CORS -> and then re-deploy the API – Lafif Astahdziq Mar 08 '22 at 14:40