I am aware that there is API gateway, AWS amplify console for rewrites and redirects, however, I am looking for a service that can parse the request body and then act as a reverse proxy.
Problem at hand - We have payment gateways(PG) that allow us to configure only two webhooks(1 for production and 1 for UAT/staging), but we need another webhook for pre-production and hence thinking to use the second webhook slot as a reverse proxy server. And redirect an incoming request form a PG to an appropriate configured path after request body JSON parsing. JSON could be nested to any level.
For example:
{
"payment": {
"env": "staging"
}
}
**Configuration** - if $payment.env == "staging", redirect to https://example.com/staging/url
Is there an AWS service that can allow to configure different paths for different request body?
Can AWS API gateway together with AWS lambda be used for this purpose? I could not find any code samples preferably in ruby or python. Can anyone please provide an example?
We were able to accomplish this after writing a custom code in AWS Lambda for each payment gateway(PG). Here's what we did:
('uat', 'pre-prod', 'dev')
to an existing unique attribute. And sent each payment request to the PG with this attribute.