jamesphilipps / serverless-offline-plugins

A collection of plugins for serverless-offline
1 stars 0 forks source link

[secrets-manager-simulator] configuration problems #1

Open kobanyan opened 2 years ago

kobanyan commented 2 years ago

Thanks for developing awesome plugin!

There are 2 problems with the configutaion.

  1. secretsFile is not optional. Although the README states that secretsFile is optional, the following error occurs if it is not set.

    TypeError: Cannot read property 'startsWith' of undefined
    at pathRelativeToCwd (/node_modules/serverless-offline-secrets-manager-simulator/dist/index.js:154:11)
    at ServerlessSecretsManagerSimulatorPlugin._createSecretStore (/node_modules/serverless-offline-secrets-manager-simulator/dist/index.js:130:45)
    at new ServerlessSecretsManagerSimulatorPlugin (/node_modules/serverless-offline-secrets-manager-simulator/dist/index.js:78:33)
    at PluginManager.addPlugin (/node_modules/serverless/lib/classes/plugin-manager.js:91:28)
    at /node_modules/serverless/lib/classes/plugin-manager.js:137:69
    at Array.forEach (<anonymous>)
    at PluginManager.loadAllPlugins (/node_modules/serverless/lib/classes/plugin-manager.js:137:44)
    at async Serverless.init (/node_modules/serverless/lib/serverless.js:141:5)
    at async /node_modules/serverless/scripts/serverless.js:591:7
  2. Cannot get secrets if secrets is set as described in README

I can read the secrets after configuration as follows.

  secrets: [
    {
      name: 'Secret1',
      value: { SecretString: 'I-Am-A-Secret' },
    },
  ],