Skip to main content

Basic Serverless Applications- Client Environment

  

Setting Up the Environment for a Serverless Application

 

Part of adapting to the vendor’s world of serverless technologies is getting your own workstation (be it PC, Mac, Unix workstation, table, or something else) in sync with what the vendor best supports. While it is theoretically possible that you could use a simple text editor such as Notepad to create software, there are free alternatives that give you powerful editing tools. They make your code much easier to read and allow you to see things such as matching opening and closing quotation marks. They also have integrations to interface with libraries such as Node.js for Lambda for the serverless apps to save having to download and configure these manually.

 

This section provides an example of what I did (using a Windows Microsoft Surface Pro 3 tablet) to set up my environment for development. As with so many things today, there are other perfectly good options available. One note: vendors may change their screens and software download URLs around over time as they update their products (change is the only constant these days). You may have to adapt a little in terms of URLs, screen labels and flows to get the job done.

 

Vendor Account Setup (Step 1)

 

This one is one that will vary between vendors and over time. The goal is to get access to the vendor’s services. Some may already have accounts with one or more vendors and can just use them. Others might need to create one. At the time of this writing, the major vendors allow you to sign up for “free tier” accounts which have limits on how much they can be used. These are more than sufficient for purposes of this prototype serverless application, so I suggest using those. Note that you will probably be asked for a credit card or payment information in case you exceed your free tier limits so be ready with that.

 

What the account provides is secure access to your web resources and billing capabilities if you choose to go beyond the free tier and use it for business. You will set up all your services for this prototype using this account. A quick overview of the steps involved with signing up for the AWS account that I based this sample on would be:

1.       Go to aws.amazon.com.

2.       Choose Create an AWS Account.

3.       <fill in the information about you requested>.

4.       The system will create an account for you and send you the login information about the login.

5.       Note the following information for future reference (I have a table at the end of this document, but you can use a pad of paper if that works for you):

a.       Account ID (12-digit number such as 1234567890012)

b.       Root user email address

c.       It is probably best not to write down the root user password (security), so pick one that you can remember.

 

Developer User Setup (Step 2a)

 

This is the first vendor service that will be used. In the AWS family it is the IAM product and is used for user and role security. It controls access to AWS services and the administrative tools. What I call step 2a is the creation of a developer user. There will be steps 2b and 2c in the documents to set up the application front end and back end that will use IAM to create security roles to control access to the serverless functions and to the serverless databases that will be created later.

 

This step is technically not needed but after too many years working in IT operations and seeing too many problems with super privileged accounts, I must throw this in here for good security. The root account (some vendors may call it a master account, etc.) is all powerful and has access to your money. It is much safer to create a separate account to do just the administrative functions that you need to create this prototype so I will go over the steps involved here.

 

To create a developer user account:

1.       On the AWS Management Console -> Select IAM (can search for it or find the link).

2.       Select Users on the menu on the left side of the page.

3.       Click on the Add User button.

4.       Fill in the user name (i.e. protouser).

5.       Check the check boxes under access type for Programmatic Access and AWS Management Console Access.

6.       Add a Custom Password.

7.       Uncheck the Require User to Change Password check box (you are the one doing the work anyway).

8.       Click on Next: Permissions.

9.       Select the Attach Existing Policies Directly button.

10.   Choose Administrator Access.

11.   Click on Next:Tags.

12.   Add any tags (just key value pairs that make sense to you for reporting, etc. if you want).

13.   Click on Create User.

 

Note:  any privileged user that can spend money or wipe out your application setups would be an ideal candidate for higher security levels such as the use of Multi-Factor Authentication. Depending on how the rest of your environment is set up and your budgets, there are numerous options available that might be worth reading about once you get past the simple prototype phase (I use a simple phone application to generate a code that I must put in after my user ID and password).

 

Web Browser (Step 3)

 

Here you get to pick your favorite web browser for your operating system (Chrome, Firefox, Edge, Safari, or others). The key for this prototype is that it needs to be able to run JavaScript. The goal of this prototype was to be as neutral as possible and make calls to services using just HTTPS requests. There are vendor-specific and product-specific libraries that can be used to directly interface from a client workstation to back end services that would change the model as opposed to just relying on APIs which may give you a lot of functionality. This prototype is based on keeping it simple for the client avoiding security setups and configurations and showing the serverless and API concepts versus the details of any one serverless product and its supporting code libraries.

 

Development Tools (Step 4)

 

Theoretically, you could just use a text editor such as Notepad on a Windows PC to edit the software, but there are free alternatives that are much more convenient. This is one area where your vendor may have a preferred development tool for your operating system that may or may not be your favorite. I have used NetBeans for years, but to work in the AWS environment with JavaScript on a Windows PC, their supported development tool is Microsoft Visual Studio. So, you could use your favorite tool with some manual work arounds or take advantage of the vendor-provided plug ins to make things easier.

 

Here are my notes on how I set up my environment that you can use as an example or reference:

1.       Install Microsoft Visual Studio (I used the Community free edition).

a.       I downloaded it from www.visualstudio.com/download/ (they may move the download URL in the future so you might have to do a search to find the current URL).

b.       I chose the JavaScript environment option for this prototype.

2.       From AWS, install the AWS Toolkit for Visual Studio (aws.amazon.com/visualstudio/)

a.       Configure your AWS account key and secret key into Visual Studio.

3.       Run the Microsoft Visual Studio installer again and get the Node.js plug in

 

AWS Command Line Interface

While it is possible to do what is needed for this prototype using the various Amazon consoles, all major web service providers have command line interfaces that can be used to do all of the development and administrative tasks. I suggest downloading them just to see what they can do for you.

1.       Download the AWS Command Line Interface from AWS (search for AWS CLI Windows).

2.       Download the AWS SAM Command Line Interface from AWS for Serverless commands (search for AWS SAM CLI)

 

Some Windows PowerShell Notes for Developers

1.       If you want to use curl to test calling web URLs from the PowerShell command line prompt on Windows, curl is available but type curl.exe for compatibility (otherwise it is an alias for a windows function that has some challenges with uploads to AWS if it uses sub-directories).

 

Parameters/Settings to Remember

 

Account ID

<number similar to 123456789012>

Root user email address

 

Root user password

Best not to write it down but remember it

Developer user name

 

Developer user password

Best not to write it down but remember it

 

 

 

 

 

 

 

  

Comments