godaddy / serverless-aws-servicecatalog

An AWS Service Catalog enabling plugin for the popular Serverless project
MIT License
24 stars 5 forks source link

having an FN::Join statement in you environment variable section makes this plugin crash. #32

Open vincentclaes opened 3 years ago

vincentclaes commented 3 years ago

this is a function that raises an error when deploying using serverless-aws-servicecatalog;

MailswitchEndpointValidation:
    name: ${self:custom.unique_stack_name}-MailswitchEndpointValidation
    handler: mailswitch_webservice/lambda_handler/mailswitch_webservice_validation.handler
    events:
      - schedule: rate(1 hour)
    timeout: 180
    environment:
      STAGE: ${self:provider.stage}
      MAILSWITCH_WEBSERVICE_EVENTS_BUCKET: !Ref MailswitchWebserviceEventsBucket
      MAILSWITCH_WEBSERVICE_EVENTS_KEY: raw
      CATEGORIES: ${self:custom.categories_to_validate}
      API_HOST:
        Fn::Join:
        - ""
        - - "!Ref API"
          - "."
          - "api-host"

the error that i get is the following;

  TypeError: value.some is not a function
    at /mnt/c/Users/dvcl643/workspace/python/axa_ai_marketplace_mailswitch_webservice/node_modules/serverless-aws-servicecatalog/src/aws-compile-servicecatalog.js:223:34

aws-compile-servicecatalog.js:223:34 looks like

const isCFRef = !value.some(v => v !== 'Ref' && !v.startsWith('Fn::'));

I am not a JS dev, but it looks like it cannot call some on the value object. maybe it's the empty string "" in the Fn::Join that causes this?