deploy command not picking up deploy.env variables

Abierto
#301 12 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
aws, javascript, node.js
Área
cli, cloud

Línea de trabajo

Start with the deploy command in package.json, deploy.env, and the credential-related code around lib/main.js lines 700-701. Trace how --configFile values and other node-lambda CLI parameters reach the AWS request, then verify deployment with the reported configuration succeeds without the invalid-token error.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

question

In my package.json I have the following deploy command in scripts:

  "scripts": {
    "deploy": "node-lambda deploy --configFile deploy.env --prebuiltDirectory dist",

My deploy.env is:

AWS_ACCESS_KEY_ID=xxx
AWS_SECRET_ACCESS_KEY=yyy

If I log the key and secret key here I get this:

your_key your_secret

followed by this error:

The security token included in the request is invalid.

UnrecognizedClientException: The security token included in the request is invalid.
    at Object.extractError (MY_PROJECT\node_modules\aws-sdk\lib\protocol\json.js:48:27)
    at Request.extractError (MY_PROJECT\node_modules\aws-sdk\lib\protocol\rest_json.js:37:8)
    at Request.callListeners (MY_PROJECT\node_modules\aws-sdk\lib\sequential_executor.js:105:20)
    at Request.emit (MY_PROJECT\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
    at Request.emit (MY_PROJECT\node_modules\aws-sdk\lib\request.js:678:14)
    at Request.transition (MY_PROJECT\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (MY_PROJECT\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at MY_PROJECT\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request.<anonymous> (MY_PROJECT\node_modules\aws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (MY_PROJECT\node_modules\aws-sdk\lib\request.js:680:12)

I'm not sure what the problem is here. Can I not use a combination of --configFile and other node-lambda CLI parameters?

The env vars are in the params if I print those out:

params { FunctionName: 'MY_FUNCTION_NAME',
  Code: { ZipFile: <Buffer 50 4b 03 04 0a 00 00 00 08 00 49 58 bd 4a 9e b6 b4 2d 70 ff 07 00 81 ac 24 00 08 00 00 00 69 6e 64 65 78 2e 6a 73 ec bd 7b 7b 1b 37 ae 38 fc 7f 9e e7 ... > },
  Handler: 'index.handler',
  Role: 'your_amazon_role',
  Runtime: 'nodejs6.10',
  Description: '',
  MemorySize: '128',
  Timeout: '3',
  Publish: false,
  VpcConfig: { SubnetIds: [], SecurityGroupIds: [] },
  Environment:
   { Variables:
      { AWS_ACCESS_KEY_ID: 'xxx',
        AWS_SECRET_ACCESS_KEY: 'yyy' } },
  DeadLetterConfig: { TargetArn: null },
  TracingConfig: { Mode: null } }
Lenguaje dominante
JavaScript
Estrellas
1.4k
Forks
185
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de motdotla/node-lambda

Todos los issues de motdotla/node-lambda

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.