serverless-operations / serverless-apigateway-service-proxy

This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway.
261 stars 78 forks source link

API gateway apiKeys not generated #172

Open maxm450 opened 2 years ago

maxm450 commented 2 years ago

API keys are not generated even if those are passed inside the provider section:

I would expect that the API gateway would use the api key name defined inside the provider section. Same as https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#setting-api-keys-for-your-rest-api

serverless: 3.16.0 serverless-apigateway-service-proxy: 2.1.0

yml: `service: test-integration

plugins:

custom: apiGatewayServiceProxies:

AWS provider configuration

provider: name: aws region: us-east-1 stage: dummy apiGateway: apiKeys:

mkint commented 2 years ago

I'm having a similar issue. Everything works well but no API keys are generated.

...
provider:
  name: aws
  stage: ${opt:stage, 'dev'}
  runtime: nodejs12.x
  apiGateway:
    apiKeys:
      - ${self:provider.stage}-myKey
    shouldStartNameWithService: true

custom:
  apiGatewayServiceProxies:
    - sqs:
        path: /test
        method: post
        queueName: { 'Fn::GetAtt': ['TestQueue', 'QueueName'] }
        private: true
...

I was able to find something which may work here: https://github.com/serverless/serverless/issues/4928

Is this how others are doing it now?

wezside commented 2 years ago

I got mine to work by removing apiGateway and have apiKeys directly underneath provider. Also I have a usage plan although not sure that is required.

pnaw94 commented 1 year ago

I got mine to work by removing apiGateway and have apiKeys directly underneath provider. Also I have a usage plan although not sure that is required.

That worked for me as well. I don't have a usage plan, so just moving apiKeys directly under provider seems to solve it.