IAM Auth on API Gateway endpoint behind custom domain

0

I have an API Gateway endpoint that I want to use IAM auth to secure. All the examples I see seem to directly hit the API gateway URL. This API Gateway also has a custom domain that I would prefer to use instead of the API gateway one.

Is it possible to use IAM auth to hit an API Gateway endpoint using that API GW's custom domain? If so, what are the steps to accomplish that?

1 Answer
2

Yes, it's possible to use IAM authorization with a custom domain in AWS API Gateway. You can set up a custom domain name for your API using API Gateway and then configure IAM authorization for your HTTP API routes. The custom domain will act as a front-end to your API Gateway endpoint, and the IAM authorization will still be enforced before requests reach the underlying API.

To activate AWS Identity and Access Management (IAM) authentication for access to my Amazon API Gateway (API Gateway) REST API, Turn on IAM authentication for an API method in the API Gateway console. Then, use IAM policies and resource policies to designate permissions for your API's users. Please refer to this link for more details on how to set it up.

To know how to setup custom domain names for REST APIs, refer to this link.

Now, when a request hits your custom domain, API Gateway will first check IAM permissions before allowing access to the underlying API. It will use custom domain name as host for signing the request. This setup ensures secure access to your HTTP API with IAM authentication through the custom domain.

AWS
Mihir G
answered 3 months 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.

Guidelines for Answering Questions