godaddy / godaddy/serverless-aws-servicecatalog
having an FN::Join statement in you environment variable section makes this plugin crash.
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
Research direction
Reproduce the failure with the shown Serverless configuration, then inspect src/aws-compile-servicecatalog.js at line 223 and trace the shape of value for the Fn::Join environment variable. Done means the configuration no longer crashes during deployment and the reported TypeError is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100