serverless / serverless/serverless

Configuration validation reports `unsupported value` on valid AWS::ApiGatewayV2::Authorizer config

Open
#12,328 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

Are you certain it's a bug?
  • Yes, it looks like a bug
Is the issue caused by a plugin?
  • It is not a plugin issue
Are you using the latest v3 release?
  • Yes, I'm using the latest v3 release
Is there an existing issue for this?
  • I have searched existing issues, it hasn't been reported yet
Issue description

Configuration validation reports:

Configuration error at 'provider.httpApi.authorizers.jwtAuthorizer': unsupported value

Even when the configuration generates a valid CloudFormation template that successfully deploys a AWS::ApiGatewayV2::Authorizer


With configValidationMode: error (to be the default in future releases) this is preventing me from deploying an authorizer.
I have tried a number of configurations and attempted to satisfy the authorizerSchema in serverless/lib/plugins/aws/package/compile/events/api-gateway/index.js but nothing seems to work for me.

As an aside, maybe this should be a separate issue, but the docs say to use type: jwt while it seems the correct setting is type: token

Service configuration (serverless.yml) content
service: authorizers-validation-bug
frameworkVersion: '3'
configValidationMode: error

provider:
  name: aws
  runtime: nodejs18.x
  httpApi:
    authorizers:
      jwtAuthorizer:
        type: token
        identitySource: $request.header.Authorization
        issuerUrl: https://dev-ayrlnchoa04bhc5w.us.auth0.com/
        audience: foo

functions:
  hello:
    handler: handler.hello
    events:
      - httpApi:
          path: /
          method: get
          authorizer:
            name: jwtAuthorizer
Command name and used flags

serverless package

Command output
Environment: darwin, node 20.11.0, framework 3.38.0 (local), plugin 7.2.0, SDK 4.5.1
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Configuration error at 'provider.httpApi.authorizers.jwtAuthorizer': unsupported value

Learn more about configuration validation here: http://slss.io/configuration-validation
Environment information
Framework Core: 3.38.0 (local)
Plugin: 7.2.0
SDK: 4.5.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the authorizerSchema in serverless/lib/plugins/aws/package/compile/events/api-gateway/index.js and reproduce the reported error using the serverless.yml configuration and serverless package. Compare the validation result with the generated AWS::ApiGatewayV2::Authorizer template and the linked HTTP API documentation; done means the valid configuration passes validation and the documented authorizer settings are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.