Skip to content

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

@sromic

Description

@sromic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions