0

I have a lambda function (e.g. /getName). This will be hosted by one domain (e.g. A) and can be triggered by multiple domains (A, B, C, etc.). I need to set up CloudFront so that a request to /getName from Domain B gets re-routed or re-directed to Domain A without an explicit redirect (returning 301) to browser.

For example, when the browser makes an ajax call to www.B.com/getName, internally it should be a call to www.A.com/getName. The call to www.A.com/getName should not be visible to client/browser.

Is this possible in CloudFront? If so, what is the right way of setting this up?

coffeefirst
  • 125
  • 2
  • 11
  • So, if domains B and C and D are to be on CloudFront, where is domain A? Is it API Gateway? Or Application Load Balancer? Or CloudFront/Lambda@Edge? (These are the three places where a Lambda function can be associated with a domain name and exposed to the Internet.) – Michael - sqlbot Jun 11 '19 at 23:44
  • Domains B and C and D won't be on CloudFront. They are going to make an http call to Domain A on CloudFront and Lambda (Lambda@Edge can be used if needed). By default, my lambda is set to use API Gateway. – coffeefirst Jun 12 '19 at 16:00
  • Okay, if B, C, and D are not on CloudFront, where are they? – Michael - sqlbot Jun 12 '19 at 17:45
  • Sorry for the confusion. I thought it through, and I think it's best to assume B, C, D will be on CloudFront for now.. We're trying to setup an AWS architecture with new APIs on Lambda, CloudFront, NAT gateway, etc. and call these APIs from existing domains. I'm not sure how these existing domains will be integrated with this new AWS setup. – coffeefirst Jun 12 '19 at 18:35

0 Answers0