LabVIEW AWS Toolkit

NI Cloud Toolkit for AWS functions palette

LabVIEW is one of our favorite languages and AWS our favorite Cloud platform. It would be nice to use them together, wouldn't it? There is a toolkit for that, so we are going to try and use it.

It might be easy to communicate directly with the AWS services APIs, but it is great to have that job already done in the form of a toolkit. Its name is LabVIEW Cloud Toolkit for AWS by NI and you can install it from the VIPM repository. It has a set of four example services, but you should be able to add other services too with the underlying functions.

As in the previous posts, we will do some exercises using the toolkit. You need programmatic access to AWS to run the examples. If you do not have an Access Key and a Secret Access Key, ask the teacher for one (if you are one of our students) or create a free account in AWS.

LabVIEW AWS Toolkit: example for listing all the S3 buckets  
 
We have changed the string control display format to "password" before catching the figure above, but notice that this does not solve many privacy issues, since anybody could turn that back if the VI is available as is. We will talk about that a little bit later.

So, what is our first challenge for you? Just run any of the examples with your own keys and check if they work. You can check them out directly from LabVIEW or using the AWS Management Console. It is easy to create a bucket (something similar to a folder) in S3 and upload files there. It is straightforward to create a SQS queue (a sort of mailbox) and send and receive messages to/from it. It is also easy to send automatic emails using SNS (please, do not send SMSs, which is something very easy to do too, but we have to pay for each SMS). It is not so easy to test the IoT interface, since you should do that with a real IoT device called an AWS IoT Button.
 
Just to have an idea of how simple an AWS LabVIEW program could be, have a look at the block diagram of some of the examples, like the one below.
 
Block diagram of the example of how to send an email using AWS SNS

 As we mentioned before, it is difficult to keep your secrets in LabVIEW. If you want to share your ideas with some colleagues and you send your VIs with your keys on (you should "Make Current Value Default" for avoiding losing the IDs when sending), anybody could use those IDs for accessing any other AWS service programmatically. This is so dangerous that you should try to hide them someway. If you delete the keys, your colleagues must enter theirs in every place you use them.You could convert them to constants and share an application instead of a VI, but yur colleagues would not be able to watch the hard work you did. Is there any other way?

Well, there is not much we can do to protect the secrets inside a VI, but we could read the values from a plain-text file, for example, and explain your colleagues how they can load the keys on their own. We have created a subVI that does exactly that, so you can wire it easily in your own block diagram:

How to call the get AWS Credentials subVI from your VIs

Let us see the block diagram of our subVI in the following picture. The picture is also a snippet, so you can drag and drop it into a blank VI and it will work.

VI snippet of "get AWS credentials.vi"

The file credentials.txt should look like this:

AKIxxxxxxxxxxxMD;j2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd9

that is,

your access Key;your secret Access key

That's it! Keep Pounding! Have fun running your own examples of LabVIEW and AWS.