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

Not handling skip creation part in case of api key not defined for a stage #46

Open
sromic opened this issue Aug 20, 2021 · 1 comment

Comments

@sromic
Copy link

sromic commented Aug 20, 2021

Let say I have multiple stage and I just want API key added for some/not all stages, e.g.

  apiKeys:
    prod:
      - name: someProdAPIKey
        deleteAtRemoval: false
        value: nonHackableAPIKey

and when I try to deploy to non "prod" stage, I see this line printed as it should be:
"No ApiKey names specified for stage dev so skipping creation" https://github.com/rrahul963/serverless-add-api-key/blob/51201b99103c4d11b431d5da27172bf9919981db/src/helper.js#L296

But plugin continues with a key association process which of course fails with:
" TypeError: apiKeys is not iterable" as there is no apiKeys defined for other stage.

@sromic sromic changed the title Not handling skip creation part in case of api key not defined Not handling skip creation part in case of api key not defined for a stage Aug 20, 2021
@sromic
Copy link
Author

sromic commented Aug 20, 2021

Fixed with #47

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

1 participant