Hands-On Chatbot Development with Alexa Skills and Amazon Lex
上QQ阅读APP看书,第一时间看更新

Method 2 – Cloud9 editor

Amazon recently acquired Cloud9, an online development platform. It runs a very basic version of Ubuntu that is integrated with the rest of the AWS platform.

Search for Cloud9 in the AWS Console, go to the page, and select Create environment. From here you give your environment a name and go to the next step.

Here you get to choose what you want to run this environment on. The great thing is that t2.micro is free-tier-eligible, so you can use this method without getting charged anything if you're on the free tier. I’ve never needed anything more powerful than a t2.micro.

Complete the setup process and you’ll end up in your new Cloud9 environment!

The cool thing about this is that you have access to all of your Lambda functions from inside your Cloud9 environment. Click AWS Resources and under Remote Functions, you'll find all of your functions. Click on the Lambda function you want to edit and then hit the download icon above to import it into your environment:

Accessing remote Lambdas

Once that's done, it'll just be like you're working on it locally.

Once you’re finished, just select the function you’ve been working on from the local list and hit the upload button. Within a few seconds, it’ll be live with all your changes.

The advantages:

  • Again, this is all remote so you don’t need to worry about forgetting to commit your work or saving it to a memory stick if you work on multiple machines.
  • Accessing your functions and reuploading them is super easy. This is by far the best bit about this method.
  • You now have an integrated terminal, allowing you to install npm packages and do everything else you want to do using the terminal.

The disadvantages:

  • It still has the same stability issues that the Lambda Console editor has. I’ve had multiple occasions where I’ve tried to save the function but couldn’t, and have had to copy to local, refresh, and recopy to Cloud 9. This becomes very annoying very quickly.
  • You need internet access to work on your Lambdas.