如何在本地为无服务器离线设置 ssm 参数
How to set ssm param locally for serverless offline
我最近开始研究无服务器架构。这是相同的 serverless.xml 示例。
test:
name: test
handler: handler.lambda_handler
timeout: 6
environment:
APP_ID: ${ssm:/path/to/ssm/test~true}
现在,当我尝试 运行 无服务器离线命令时,它会抱怨 ssm 变量。
以下是控制台上出现的错误。
我想 运行 我本地机器上的所有东西都用于开发。有人可以帮助我如何解决这个问题。
ServerlessError: Trying to populate non string value into a string for variable ${ssm:/path/to/ssm/test~true}. Please make sure the value of the property is a string.
at Variables.populateVariable (C:\Users\kumarn\AppData\Roaming\npm\node_modules\serverless\lib\classes\Variables.js:464:13)
at Variables.renderMatches (C:\Users\kumarn\AppData\Roaming\npm\node_modules\serverless\lib\classes\Variables.js:386:21)
at C:\Users\kumarn\AppData\Roaming\npm\node_modules\serverless\lib\classes\Variables.js:406:29
From previous event:
你可以通过添加插件来解决这个问题:
https://github.com/janders223/serverless-offline-ssm
如果你喜欢冒险,你也可以使用 localstack https://github.com/localstack/localstack
请注意,免费版并不支持所有内容
我最近开始研究无服务器架构。这是相同的 serverless.xml 示例。
test:
name: test
handler: handler.lambda_handler
timeout: 6
environment:
APP_ID: ${ssm:/path/to/ssm/test~true}
现在,当我尝试 运行 无服务器离线命令时,它会抱怨 ssm 变量。 以下是控制台上出现的错误。
我想 运行 我本地机器上的所有东西都用于开发。有人可以帮助我如何解决这个问题。
ServerlessError: Trying to populate non string value into a string for variable ${ssm:/path/to/ssm/test~true}. Please make sure the value of the property is a string.
at Variables.populateVariable (C:\Users\kumarn\AppData\Roaming\npm\node_modules\serverless\lib\classes\Variables.js:464:13)
at Variables.renderMatches (C:\Users\kumarn\AppData\Roaming\npm\node_modules\serverless\lib\classes\Variables.js:386:21)
at C:\Users\kumarn\AppData\Roaming\npm\node_modules\serverless\lib\classes\Variables.js:406:29
From previous event:
你可以通过添加插件来解决这个问题:
https://github.com/janders223/serverless-offline-ssm
如果你喜欢冒险,你也可以使用 localstack https://github.com/localstack/localstack
请注意,免费版并不支持所有内容