How to configure Alexa ask-cli with a valid AWS profile?
Asked Answered
S

2

9

After playing around with the nice browser GUIs of developer.amazon.com and aws.amazon.com things getting serious and now I want to use ask-cli to initialize Alexa skills and their lambda functions.

When I want to ask init, it tells me, I should select a profile or create a new one. Both jump to the browser and use OAuth to authenticate my ask installation.

~ ask init
? Please create a new profile or overwrite the existing profile.
 (Use arrow keys)
  ──────────────
❯ Create new profile
  ──────────────
  Profile              Associated AWS Profile
  [default]                 ** NULL **
  [aws_profile]             ** NULL **

But the AWS Profile will not associate my AWS Profile.

My LamdaFunction will not load/deploy, if I don't connect the profile with AWS.

No AWS credential setup for profile: [default]. 
Lambda clone skipped. CLI lambda functionalities can be enabled 
by running `ask init` again to add 'aws_profile' to ASK cli_config

How could I connect my ask-cli correctly?

Shank answered 18/10, 2017 at 13:13 Comment(2)
what version are you running? 'ask -v'Nonplus
I had to restart my command line session to 'reload' the profile and recognize the tokenNonplus
A
8

You need to first download and install aws CLI on your local machine. You can download aws CLI from below link.

http://docs.aws.amazon.com/cli/latest/userguide/installing.html

If you are working with your root account user then you have to generate your access ID and secret key else you have to create new IAM user with lambda execute permission.

You can generate root user access ID and secret key from below link. https://console.aws.amazon.com/iam/home

Then click on Manage Security credential as shown in below image and after ignoring the warnings you can process and click Access Key ID and secret key link and generate new one and copy them.

Manage Security Credentials

Run aws configure command to configure your aws account and it will ask for Access ID and secret key that you generated and will setup your aws account.

aws configure

After aws configure, you can run again ask init command again to configure account.

ask init

Agronomics answered 7/12, 2017 at 2:48 Comment(0)
F
5

Well, you don't need to setup an aws-cli when you already have an ask-cli installed.

Instead you can run below command to setup AWS credentials and link to an ASK profile, if somehow aws credentials are not setup.

ask init --aws-setup

Then, you will be prompted to enter your profile name, your access key, and your secret access key. You can use profile name as default if you have not created multiple ASK profiles. This will automatically create an aws credentials file at %USERPROFILE%.aws\credentials location. Now every time you try to deploy/access lambda code through ask-cli, it will access the credentials from this file.

Faradmeter answered 28/9, 2018 at 6:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.