question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploy on another stage fails when api key is present

See original GitHub issue

This is a (Bug Report / Feature Proposal)

Bug

Description

I had an API deployed on dev stage with api keys. When I tried to deploy the same api with stage prod, it failed with error:

...
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::ApiKey - ApiGatewayApiKey1
CloudFormation - CREATE_FAILED - AWS::ApiGateway::ApiKey - ApiGatewayApiKey1
...
CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::ApiKey - ApiGatewayApiKey1
...
Serverless Error ---------------------------------------

     An error occurred while provisioning your stack: ApiGatewayApiKey1
     - dev-key already exists in stack arn:aws:xxxx

Serverless should skip creating keys if they exist.

Additional Data

OS:                 linux
Node Version:       6.10.3
Serverless Version: 1.12.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
pmuenscommented, Feb 7, 2019

Closing since this issue is quite old and there’s a potential workaround in the thread.

Additionally we published lots of new versions with fixes which should address this. Feel free to re-open if this is still a problem.

8reactions
shatguptcommented, May 16, 2017

I had a config like:

apiKeys:
    - dev-key

Figured out that I can use:

apiKeys:
    - ${self:provider.stage}-key

But I think bug still applies if I want to have same keys.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up a stage using the API Gateway console
After a successful deployment of an API, the stage is populated with default settings. You can use the console or the API Gateway...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
1. Invalid CloudFormation state · 2. Unable to fetch parameters · 3. API Gateway: No integration defined for method · 4. Codebuild deploy...
Read more >
REST API (API Gateway v1) - Serverless Framework
API Keys are created globally, so if you want to deploy your service to different stages make sure your API key contains a...
Read more >
Azure DevOps: An error occurred while loading the YAML ...
This line is getting repeated twelve times, with only four different values: - stage: deploy-${{ convertToJson(namespace) }}.
Read more >
Troubleshoot pipeline runs - Azure DevOps - Microsoft Learn
Can't access Azure Key Vault behind firewall from Azure DevOps ... Your pipeline may not move to the next stage because it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found