Skip to content

apiKeys property is not nested under apiGateway property in API Gateway documentation section #566

Open
@tvhees

Description

@tvhees

This is a Bug Report

Description

The example YAML under Setting API keys for your Rest API was not updated to reflect nesting of apiKeys property under apiGateway when the code was changed to match the new syntax in serverless framework v3

Current example YAML:

  service: my-service
  provider:
    name: aws
    apiKeys:
      - myFirstKey
      - ${opt:stage}-myFirstKey
      - ${env:MY_API_KEY} # you can hide it in a serverless variable
    usagePlan:
      quota:
        limit: 5000
        offset: 2
        period: MONTH
      throttle:
        burstLimit: 200
        rateLimit: 100
  functions:
    hello:
      handler: handler.hello

    stepFunctions:
      stateMachines:
        statemachine1:
          name: ${self:service}-${opt:stage}-statemachine1
          events:
            - http:
                path: /hello
                method: post
                private: true
          definition:
            Comment: "A Hello World example of the Amazon States Language using an AWS Lambda Function"
            StartAt: HelloWorld1
            States:
              HelloWorld1:
                Type: Task
                Resource:
                  Fn::GetAtt: [hello, Arn]
                End: true

    plugins:
      - serverless-step-functions
      - serverless-pseudo-parameters

Expected:
Step Function and API Gateway to successfully deploy with an API Key

Outcome:
Received the following error:

Error:
Configuration error at 'provider': unrecognized property 'apiKeys'

Additional Data

  • Framework: 3.30.1
  • Plugin: 3.13.1
  • Operating System: Ubuntu 20.04.6 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions