trek10inc / serverless-secrets

An opinionated tool for safely managing and deploying Serverless projects and their secrets.
Other
165 stars 27 forks source link

Serverless v1 support? #11

Closed am17torres closed 7 years ago

am17torres commented 7 years ago

Not sure if I'm doing something wrong or if this documentation is for a legacy version of serverless.

I also found this thread but I don't think Serverless has first-party support for secrets as of this writing.

$ sls secret encrypt -p kms -t client_secret

 Type Error ---------------------------------------------

    S.getServerlessPath is not a function

    For debugging logs, run again after setting SLS_DEBUG env var.

 Stack Trace --------------------------------------------

TypeError: S.getServerlessPath is not a function
   at new module.exports (./node_modules/serverless-secrets/src/index.js:11:32)
   at PluginManager.addPlugin (~/.nvm/versions/node/v6.9.1/lib/node_modules/serverless/lib/classes/PluginManager.js:28:28)
   at plugins.forEach (~/.nvm/versions/node/v6.9.1/lib/node_modules/serverless/lib/classes/PluginManager.js:61:12)
   at Array.forEach (native)
   at PluginManager.loadPlugins (~/.nvm/versions/node/v6.9.1/lib/node_modules/serverless/lib/classes/PluginManager.js:58:13)
   at PluginManager.loadServicePlugins (~/.nvm/versions/node/v6.9.1/lib/node_modules/serverless/lib/classes/PluginManager.js:86:10)
   at PluginManager.loadAllPlugins (~/.nvm/versions/node/v6.9.1/lib/node_modules/serverless/lib/classes/PluginManager.js:54:10)
   at service.load.then (~/.nvm/versions/node/v6.9.1/lib/node_modules/serverless/lib/Serverless.js:64:28)

 Get Support --------------------------------------------
    Docs:          docs.serverless.com
    Bugs:          github.com/serverless/serverless/issues

    Please report this error. We think it might be a bug.

 Your Environment Information -----------------------------
    OS:                 darwin
    Node Version:       6.9.1
    Serverless Version: 1.1.0
shortjared commented 7 years ago

Hey @am17torres, I wish I had better news for you.

We aren't planning on supporting V1: Check out https://github.com/trek10inc/serverless-secrets/issues/10 for previous discussion.

Our reasoning is that there are some efforts within the community to standardize environment configurations (including secrets) and we don't want to build and maintain a competing plugin: https://github.com/serverless/serverless/issues/2673

I recommend you manage your environment with dotenv and something like credstash and decrypt at runtime. You can dig through our code a bit to figure out how we do it.

https://github.com/roylines/node-credstash may also be helpful so you don't have to write your own credstash decryption.