Issue
I have two EC2 instances (prod and test) and I want to duplicate prod received requests to test instance. How can I do it in AWS infrastructure? Sorry, I cannot give you some code and examples, because I can't imagine how this is possible. I hope for your understanding
Solution
Following are some of the options;
A :
Write a AWS lambda to forward HTTP request to your production as well as test ec2 instances. If you have response, then in lambda code wait for response from production instance and then send back same as response from this lambda.
Create AWS Application Load Balancer and create ALB routing rule based on your production host and path, with target as the AWS lambda function created in step A.1)
B :
Build logic within your application to asynchronously forward HTTP request to test ec2 instance from production ec2 instance
Answered By - amitd