4

I am hoping to restrict an aws lambda to a specific domain (maybe whitelist local dev too) with a specific domain so that others can't use the lambda if they reach it from a domain that isn't in a whitelist.

Is this possible as a service?

3
  • How are you currently triggering lambda function ? You can integrate it with API gateway and check for origin or Referer before trigger it. Commented Jun 24, 2019 at 3:39
  • @JamesDean I can integrate it, I'm guessing I check the origins in the gateway config? Commented Jun 24, 2019 at 3:50
  • 1
    You can use waf with api gateway and you can deny requests without your origin/referer domain. Commented Jun 24, 2019 at 4:39

1 Answer 1

7

enter image description hereAWS Lambda will not work alone itself you need to integrate with API Gateway or any other services. As per your requirement, you need to integrate your Lambda with API Gateway. Now follow the step:

  • Go to API Gateway
  • Select your API
  • Click Action->Enable Cors
  • Fill your domain inside Access-Control-Allow-Origin field. e.g; dev.yourdomain.com [Screenshot][2]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.