Raghu Ram
Raghu Ram

Reputation: 137

Issue with conflicting API Gateways pointing to Lambda in AWS

I am newbie to AWS and looking to resolve the API Gateway issue. We had a frontend web application where if users perform any activity by clicking a Personal Details link then request will hit the AWS API Gateway "A" and trigger lambda-A. We created AWS code pipeline and deployed application using Cloud Formation Stack which creates new API Gateway-B and Lambda-B. After the deployment it was intended that when ever user hits the Personal Details it should hit API Gateway-B and triggering the Lambda-B instead it was hitting old AWS API Gateway "A" and triggering lambda-A. Any help will be highly appreciated.

Regards, Raghu

Upvotes: 1

Views: 336

Answers (3)

Raghu Ram
Raghu Ram

Reputation: 137

This was due to the User request from Website navigating to data power (third party vendor for security). In data power it was configured to old API Gateway, so we changed it to new API Gateway.

Upvotes: 0

alpha-bird
alpha-bird

Reputation: 348

You need to change Lambda function in API Gateway. Please check this article which have screenshots.

https://aws.amazon.com/blogs/compute/using-api-gateway-stage-variables-to-manage-lambda-functions/

https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html

Also I want to recommend you to use Serverless for your project.

Upvotes: 1

Prashanna
Prashanna

Reputation: 1001

You need to update the base path mapping of your backend domain to API Gateway B.

Or you have to edit the backend url in frontend code to new api gateway url

Custom domains with API Gateway

Upvotes: 1

Related Questions