How does authentication/authoriation work with multi region api in a DNS fail-over scenario?

0

I want to set up a multi region api with DNS-fail over setting , by setting up health checks. I plan to set up api key for my api endpoint. say, if i create api gateway resource in two regions us-east-1 and us-west-1, with api key. i assume it will create different api keys for my api in each region. so if request comes into an api hosted in us-east-1 with a particular api key, and if us-east-1 fails and then request is routed to us-west , it should fail because the api key are different?

已提問 2 年前檢視次數 215 次
1 個回答
1
已接受的答案

You have the option to either have API Gateway generate API keys for you or you have the option to import API keys. If you use the import option, you can ensure that the same API Keys are used for a particular client for both your regional API Gateway end-points.

Look at the "Import API Keys" section in https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-setup-api-key-with-console.html#api-gateway-usage-pan-import-apikey

As a side note, you should not use API Keys for Authentication and Authorization. API Keys are only meant for implementing Usage Plans for clients.

You can use mechanisms such as Cognito User Pools, Cognito Identity Pools, Lambda Authorizers etc. for Authentication and Authorization in API Gateway

profile pictureAWS
專家
已回答 2 年前
profile pictureAWS
專家
已審閱 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南