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.

Install and configure 3rd party plugins automatically (based on serverless.yml)

See original GitHub issue

This is a Bug Report

When updating the plugins section of serverless.yml dynamically, it doesn’t actually install and configure the required plugins.

Here’s a snippet of serverless.yml config: plugins: ${file(utils/combineServerlessConfig.js):plugins}

utils/combineServerlessConfig.js: module.exports.plugins = () => { return [ 'serverless-plugin-aws-alerts', 'serverless-plugin-warmup' ] }

Description

  • What went wrong?

The .serverless/serverless-state.json pulls in the required plugins, but the plugins doesn’t seem to load.

  • What did you expect should have happened?

I would have expected serverless install and deploy serverless-plugin-aws-alerts and serverless-plugin-warmup but it does not.

  • What was the config you used?

serverless.yml ` service: aws-python3-example

plugins: ${file(utils/combineServerlessConfig.js):plugins}

provider: name: aws runtime: python3.6

functions: hello: handler: handler.hello `

utils/combineServerlessConfig.js: module.exports.plugins = () => { return [ 'serverless-plugin-aws-alerts', 'serverless-plugin-warmup' ] }

  • What stacktrace or error message from your provider did you see? Does not output any errors; but it doesn’t deploy / configure any of the required packages.

Additional Data

  • Serverless Framework Version you’re using: 1.17.0
  • Operating System: macOS Sierra 10.12.5
  • Stack Trace: N/A
  • Provider Error messages: N/A

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
lsorbercommented, Feb 29, 2020

Closing since the plugin command can auto-install plugins for you. Other than that it’s required to install and configure plugins on your own since there are many different ways to use and confugre plugins.

@pmuens How do you auto-install plugins with the plugin command? If I run sls plugin install it tells me I need to provide a plugin name to install:

This command requires the --name option / -n shortcut. Usage: The plugin name

The help information doesn’t mention any other options for auto-installing the plugins specified in serverless.yml.

3reactions
ChrisLankscommented, Nov 3, 2021

Same issue. We end up parsing the yaml in order to install the plugins 1 by 1, or npm installing. Can we run 1 command to install all plugins. It would make CI/CD much simpler. @pmuens or whoever has a better solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugins - Serverless Framework
This command will install the plugin via NPM and register it in serverless.yml . You can also install the plugin manually via NPM:...
Read more >
Serverless Webpack in Lambda Simplified 101 - Learn | Hevo
The Serverless webpack plugin is configured by adding a custom: webpack object to your serverless.yml file with your specific configuration.
Read more >
AWS Serverless Development: Coding Best Practices
Setup a defaults file for serverless.yml imports ... If there are configuration values that are specific to an environment (DEV, QA, PREPROD, PROD) ......
Read more >
What is the AWS Serverless Application Model (AWS SAM)?
You can also use AWS CodeStar to get started with a project structure, code repository, and a CI/CD pipeline that's automatically configured for...
Read more >
Going serverless with Node.js apps - LogRocket Blog
yml file is used to configure our entire application — the kind of services we intend to add and how to configure the...
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