AWS API Gateway Lambda RDS VPC and Auth0

Hello,

I have a NodeJS application running in AWS services. Currently, my lambda is able to connect to your jwks.json check token endpoint. However, when I add settings to allow Lambda to connect to my RDS database, it fails to connect to the jwks.json endpoint.

I’m using the serverless.yml (from serverless.com) to assist for deployment.

I have it as follows (slim version):

service: cool-project
provider:
  name: aws
  runtime: nodejs12.x
  stage: dev
  region: us-east-1
  vpc:
    securityGroupIds:
      - sg-xxxxxxxx
    subnetIds:
      - subnet-11111111
      - subnet-22222222
      - subnet-33333333
      - subnet-44444444
      - subnet-55555555
      - subnet-66666666
functions:
  web:
    handler: index.handler
    events:
      - http: "ANY /"
      - http: "ANY /{proxy+}"

To summarize, without the VPC settings, Lambda won’t connect to RDS, but JWT checking works. When adding VPC settings, Lambda is able to connect to RDS, but JWT checking fails.

Has anyone else faced this?

Cheers!

1 Like

Hello,

We are experiencing the exact same issue, any help would be appreciated!

I have exactly the same setup and issue now. The call to https://***.eu.auth0.com/.well-known/jwks.json simply times out from my Lambda. @isidoro.ferreiro @joshua.sickmeyer Did you figure this out at some point?

Hey, we ended up handling the authorization in the api gateway, was very convenient, can use serverless to configure everything!

1 Like

Glad you have figured it out!

I am experiencing the same issue as the original poster. When configuring my serverless app to use an AWS VPC, it times out when trying to reach the jwks.json endpoint. When I deploy it without the VPC configuration, it works fine.