Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API gateway apiKeys not generated #172

Open
maxm450 opened this issue May 9, 2022 · 3 comments
Open

API gateway apiKeys not generated #172

maxm450 opened this issue May 9, 2022 · 3 comments

Comments

@maxm450
Copy link

maxm450 commented May 9, 2022

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:

  • serverless-apigateway-service-proxy

custom:
apiGatewayServiceProxies:
- dynamodb:
path: /dynamodb/{id}
method: put
tableName: ${EXISTING_TABLE_ARN}
hashKey:
pathParam: id
attributeType: S
action: PutItem
cors: true
private: true

AWS provider configuration

provider:
name: aws
region: us-east-1
stage: dummy
apiGateway:
apiKeys:
- name: test
value: 12345
`

@mkint
Copy link

mkint commented May 19, 2022

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: serverless/serverless#4928

Is this how others are doing it now?

@wezside
Copy link

wezside commented May 25, 2022

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
Copy link

pnaw94 commented Jan 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants