0
votes

I'm trying to use the Ask CLI to deploy an Alexa skill, but whenever I run ask deploy, I get this error:

[Error]: Cannot find the environment variable: AWS_ACCESS_KEY_ID

I'm 100% sure the AWS_ACCESS_KEY_ID env variable is set to a valid access key. This is how I'm setting it in my ~/.zshrc file:

export AWS_ACCESS_KEY_ID=AKIBJRSRMxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=fS0A6MS9Q9V1OIxKQjKwwaO2fxxxxxxxxxxxx

It is also set in my default AWS credentials at ~/.aws/credentials:

[default]
aws_access_key_id=AKIBJRSRMxxxxxxxxx
aws_secret_access_key=fS0A6MS9Q9V1OIxKQjKwwaO2fxxxxxxxxxxxx

I've re-run ask init multiple times and selected "load from env variables" and logged in through the browser successfully.

I've double checked my .zshrc is loaded with source ~/.zshrc. I've also echoed $AWS_ACCESS_KEY_ID successfully:

echo $AWS_ACCESS_KEY_ID
AKIBJRSRMxxxxxxxxx

And I've tried running ask deploy with the access key variable directly:

AWS_ACCESS_KEY_ID=AKIBJRSRMxxxxxxxxx ask deploy
[Error]: Cannot find the environment variable: AWS_ACCESS_KEY_ID

And I know these credentials are valid because I created them an hour ago.

The ask init prompt even says We have detected you have AWS environment variables. Would you like to setup your profile using those? which I answer yes to:

ask cli init and failed deploy

I've created an issues in the alexa skills kit sdk repo:

https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/531

But the maintainers point other issue authors to SO and the amazon dev forum.

Versions:

  • Ask CLI 1.6.4
  • Node 10.11.0
  • NPM 6.4.1
  • Mac OSX Mojave 10.14.2
  • AWS CLI aws-cli/1.16.56 Python/2.7.13 Darwin/18.2.0 botocore/1.12.46

EDIT:

I was able to deploy successfully by downgrading to [email protected]. It appears this bug was introduced in [email protected].

1
please add the output of ask --version to the question (1.6.4 according to the bug report)Sébastien Stormacq

1 Answers

1
votes

Looks like a bug in that version of the CLI. Current workaround is to use AWS credentials in your ~/.aws profile and not environment variables.

I forwarded this question to the appropriate team @ Alexa.