aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.67k stars 1.01k forks source link

Give Authorizer Outgoing Internet Access #1849

Closed theobouwman closed 2 years ago

theobouwman commented 2 years ago

I am using firebase_auth.verify_id_token(token) to very a Firebase generated JWT in my authorizer. This function requires internet access, so how can I set this up in Chalice?

jamesls commented 2 years ago

If your Lambda function is in a VPC, you'll need to ensure that the subnet it's on has internet access, which you would set up outside of Chalice (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html). Otherwise if you're Lambda function is not in a VPC, it should already have internet access by default.

kharandziuk commented 2 years ago

The other possibility: there is nothing that forces you to put your authorizer inside of VPC. You can configure your authorizer separately https://aws.github.io/chalice/topics/configfile.html#lambda-specific-configuration