Skip to content

Command Line Tools

alidaniell edited this page Sep 5, 2018 · 10 revisions

Identity and Access Manager (IAM)

In order to provide the below CLI tools access to your Lambda function, you'll need to set up a user in the Identity and Access Manager (IAM).

  1. Go to the Users section.
  2. Click Add User.
  3. Give your user a name (it doesn't matter what, this is just used to identify it in IAM).
  4. Select both options under Access Type (Programmatic access, AWS Management Console access).
  5. In the permissions section, select Attach existing policies directly.
  6. Select AWSLambdaFullAccess.
  7. Review and create user.

AWS CLI

  1. install aws cli using pip install awscli --upgrade --user (Linux)
  2. Make sure an IAM user is created and has access to AWS services.
  3. Configure aws-cli using aws configure. See here for help. We use region us-east-1
  4. Finally, run python deploy_tools.py -p -f BostonData. If everything runs well, you should see the following message:
Updating/uploading lambda code

<a bunch of text>

TRACINGCONFIG	PassThrough
VPCCONFIG	
DONE UPLOADING...

Note: The exact output text is dependent on your AWS CLI configuration, but if you see DONE UPLOADING you should be ok.

Note for users of Windows CMD shell:

After installing awscli as above using pip, your system may not find aws when you run aws configure because aws is not in the existing path. If you find this is the case, uninstall awscli and re-install it without the --user switch.

pip uninstall awscli pip install awscli --upgrade


ASK CLI

BostonInfo uses ASK CLI to programmatically upload and build the interaction model with deploy_tools.py. This just automates the upload/build functions we've accessed through the Alexa skills console in the past.

To install the Amazon Skills Kit (ASK) command line interface, follow these instructions: https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html

Prerequisites:

Note: Make sure your version of ASK CLI is up to date. As of this writing (8.31.18), we are using ASK 1.4.2.

Note for users of Windows CMD shell:

When installing Amazon Skills Kit Command Line Interface, Windows CMD shell users may receive this message: MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008. [C:\Users\Ali\AppData\Roaming\npm\node_modules\ask-cli\node_modu les\dtrace-provider\build\binding.sln]

If you receive the above MSBUILD message, installing windows-build-tools could be a quick fix for the issue. Installing windows-build-tools also installs Python v2.7, but does not change the default Python version.

npm install -g --production windows-build-tools

Then, try installing the Amazon Skills Kit Command line Interface again.