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.

It stops deploy when I use ${param:some_key} in serverless.yml

See original GitHub issue

Bug Report

It stops deploy when I use ${param:some_key} in serverless.yml

Description

  1. What did you do?
    environment:
      variables:
        API_KEY: ${param:api_key}

Add parameter in default profile in dashboard. then I run sls deploy

  1. What happened?

Error: SDK: getAccessKeyForTenant() requires a “tenant”.

  1. What should’ve happened?

Deploy success

  1. What’s the content of your serverless.yml file?
service: github-notifier

provider: # provider information
  name: tencent
  runtime: Nodejs8.9
  credentials: ~/credentials
  region: ap-shanghai

plugins:
  - serverless-tencent-scf

functions:
  github-notifier:
    handler: index.main_handler
    environment:
      variables:
        API_KEY: ${param:api_key}
     - apigw:
         name: hello_world_apigw
         parameters:
           stageName: release
           serviceId:
           httpMethod: POST
  1. What’s the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)
$ SLS_DEBUG=* sls deploy -f github-notifier                                             [21:55:55]
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
 
  Error --------------------------------------------------
 
  Error: SDK: getAccessKeyForTenant() requires a "tenant".
      at _callee2$ (/usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-sdk/src/accessKeys/accessKeys.js:44:11)
      at tryCatch (/usr/local/lib/node_modules/serverless/node_modules/regenerator-runtime/runtime.js:45:40)
      at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/serverless/node_modules/regenerator-runtime/runtime.js:271:22)
      at Generator.prototype.<computed> [as next] (/usr/local/lib/node_modules/serverless/node_modules/regenerator-runtime/runtime.js:97:21)
      at step (/usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-sdk/dist/accessKeys/accessKeys.js:28:191)
      at /usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-sdk/dist/accessKeys/accessKeys.js:28:437
      at new Promise (<anonymous>)
      at /usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-sdk/dist/accessKeys/accessKeys.js:28:99
      at getAccessKeyForTenant (/usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-sdk/src/accessKeys/accessKeys.js:37:7)
      at Variables.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/@serverless/lib/variables.js:21:27)
      at Generator.next (<anonymous>)
      at asyncGeneratorStep (/usr/local/lib/node_modules/serverless/node_modules/@serverless/enterprise-plugin/lib/variables.js:9:103)
      at _next (/usr/local/lib/node_modules/serverless/node_modules/@serverless/enterprise-plugin/lib/variables.js:11:194)
      at /usr/local/lib/node_modules/serverless/node_modules/@serverless/enterprise-plugin/lib/variables.js:11:364
      at new Promise (<anonymous>)
      at Variables.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/@serverless/enterprise-plugin/lib/variables.js:11:97)
      at Variables.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/@serverless/lib/variables.js:11:40)
      at Variables.getValueFromSource (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:567:17)
      at Variables.splitAndGet (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:436:17)
      at /usr/local/lib/node_modules/serverless/lib/classes/Variables.js:373:41
      at arrayMap (/usr/local/lib/node_modules/serverless/node_modules/lodash/lodash.js:639:23)
      at Function.map (/usr/local/lib/node_modules/serverless/node_modules/lodash/lodash.js:9554:14)
      at Variables.populateMatches (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:373:14)
      at Variables.populateValue (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:404:30)
  From previous event:
      at Variables.populateValue (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:405:22)
      at /usr/local/lib/node_modules/serverless/lib/classes/Variables.js:286:12
      at arrayMap (/usr/local/lib/node_modules/serverless/node_modules/lodash/lodash.js:639:23)
      at Function.map (/usr/local/lib/node_modules/serverless/node_modules/lodash/lodash.js:9554:14)
      at Variables.populateVariables (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:285:14)
      at Variables.populateObjectImpl (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:318:30)
      at /usr/local/lib/node_modules/serverless/lib/classes/Variables.js:199:16
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:131:23)
  From previous event:
      at /usr/local/lib/node_modules/serverless/lib/classes/Variables.js:198:10
      at Variables.initialCall (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:102:12)
      at Variables.populateService (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:196:17)
      at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:120:27)
      at /usr/local/lib/node_modules/serverless/bin/serverless.js:75:30
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:111:16
      at /Users/wenchaoliu/qidian/sls/github-notifier/node_modules/graceful-fs/graceful-fs.js:57:14
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:45:10
      at FSReqCallback.oncomplete (fs.js:157:23)
  From previous event:
      at /usr/local/lib/node_modules/serverless/bin/serverless.js:75:8
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:131:23)
  From previous event:
      at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless.js:64:4)
      at Module._compile (internal/modules/cjs/loader.js:936:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
      at Module.load (internal/modules/cjs/loader.js:790:32)
      at Function.Module._load (internal/modules/cjs/loader.js:703:12)
      at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
      at internal/main/run_main_module.js:17:11
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.10.0
     Framework Version:         1.60.5
     Plugin Version:            3.2.7
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0
 
FAIL

Similar or dependent issues:

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thetimbankscommented, Feb 19, 2020

I just ran into this issue after logging in with serverless login. I then had to start specifying the app and org when running commands.

serverless deploy --org ORGNAME --app APPNAME

0reactions
medikoocommented, Feb 19, 2020

@thetimbanks this issue concerns Tencent (not AWS) provider. Is this your case?

If it’s otherwise can you report other issue at https://github.com/serverless/enterprise-plugin/issues ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless Framework Commands - AWS Lambda - Deploy
The sls deploy command deploys your entire service via CloudFormation. Run this command when you have made infrastructure changes (i.e., you edited serverless....
Read more >
AWS Lambda Guide - Serverless.yml Reference
Here is a list of all available properties in serverless.yml when the provider is set to ... The AWS profile to use to...
Read more >
Deploying to AWS - Serverless Framework
An AWS CloudFormation template is created from your serverless.yml . If a Stack has not yet been created, then it is created with...
Read more >
Serverless Framework Deprecations
The serverless.yml setting is ineffective for deprecations reported ... In order to deploy a single function, please use deploy function command instead.
Read more >
Variables - Serverless Framework
To reference environment variables, use the ${env:SOME_VAR} syntax in your serverless.yml configuration file. It is valid to use the empty string in place...
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