While there are several tools and frameworks out there in the serverless industry, Sigma and AWS Cloud9 are two such kinds of cloud IDEs which support serverless application development. Both are browser-based IDEs and both have their own unique characteristics compared to each other. From this article, we’ll discuss what are the approaches of those IDEs when developing a serverless application and how they are different from one another.
The sample project will demonstrate how to create a serverless application with an API Gateway and AWS DynamoDB using AWS Cloud9. Before the start, make sure whether your AWS account mainly has sufficient permissions to access these AWS services; EC2, Cloud9, IAM, Lambda, API Gateway and DynamoDB. Let’s discuss the process step by step.
Step 1: Create a development environment
To start development with IDE, we have to create an environment from AWS Cloud9 console and configure settings of the instance.


In this example, I have created a new EC2 instance for the environment and used default settings for the rest. The reason behind the selection is that EC2 is already preconfigured with most of the initial requirements of the Cloud9 environment. Instead of an EC2 instance, you can connect to your own server over SSH. But the configurations of the instance and installation of other additional packages might be done manually.
Step 2: Install the AWS CLI / aws-shell, or both in your environment
AWS CLI is already installed in an EC2 environment. Or else, you can install it using the in-built terminal.
AWS CLI installation command:
sudo yum -y update
sudo yum -y install aws-cli
To install aws-shell should have pip. And to use pip, should have python installed(pip and python are already in an EC2 environment).
aws-shell installation command: sudo pip install aws-shell
Step 3: Set up Credentials Management in Your Environment
AWS managed temporary credentials are already set up for you in the EC2 environment. For any other preference, refer https://docs.aws.amazon.com/cloud9/latest/user-guide/auth-and-access-control.html.
Step 4: Create a lambda file with an API
From the AWS Resources tab on the right edge of the IDE, you can create a new lambda file.

While creating a new lambda, select function trigger with API Gateway(This creates an API in API Gateway) and declare Resource Path as “ / “ and attach a predefined lambda execution role with required permissions for operations of AWS DynamoDB.
Note: If there are no existing lambda execution roles, you can select ‘Automatically generate role’ and define permissions later. There you have to define permissions in an AWS CloudFormation template file and create the stack which creates an execution role in IAM.
AWS Cloud9 creates the function and its related API on the instance. Then it deploys automatically a copy of the function and API to Lambda and API Gateway. The serverless application and function are displayed in the Local Functions and Remote Functions lists in the AWS Resources tab. The editor opens the function’s code file, index.js. If you open the template.yaml file(AWS SAM template) in project directory you can see declared lambda execution role under function properties and API details with default method as “ANY”.


Likewise, create another 2 lambda functions as “addUser” and “getUser” with APIs under the same serverless application and edit template.yaml file with paths as “user” and “/user”.

Save all the changes and deploy the application. From AWS Cloud9, you can run functions and APIs both locally and remotely.

Step 5: Add DynamoDB
In this article, we are adding a DynamoDB as a resource. Open the terminal and type below command in order to declare the DynamoDB table.
aws dynamodb create-table \
–table-name USERS_TABLE \
–attribute-definitions \
AttributeName=userId,AttributeType=N AttributeName=name,AttributeType=S \
–key-schema \
AttributeName=userId,KeyType=HASH AttributeName=name,KeyType=RANGE \
–provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
To confirm the table is successfully created, run
aws dynamodb describe-table –table-name USERS_TABLE
And your successful response should be like this

Then update addUser and getUser lambda files with Put and Get operations respectively.


After deploying the functions you can call for the endpoints and perform Put and Get operations. Even after deploying the application, your responsibility is not over. Since, serverless is under ‘Pay As You Go’ mechanism, continuous monitoring of the infrastructure is essential and as a best practice, conducting a scheduled cleanup of your unwanted resources will prevent ongoing charges to your AWS account.
What if the same application develop from Sigma
Project Creation: Unless like in AWS Cloud9, Sigma does not need a VM/container as a backend. It’s 100% browser-based. You can just log in and start coding.

If you are new to Sigma, you can create your own account or login as a demo user or login via social media accounts. In next step, unless your a demo user, you have to authorize sigma with at least one of your cloud platforms. Currently Sigma supports AWS and GCP.

Then you can create a new project or load one from GitHub/Bitbucket or tryout a sample project. In our case, we create a new project.

Dependency Management: As you see in the sample, we have to NPM manually when using Cloud9. But Sigma has an in-built NPM dependency manager with search capabilities.

Add resources and code generation: Even though AWS Cloud9 provides a small starter code according to the given blueprints, the user has to type rest of the code/ run terminal commands. But from Sigma, you can just drag-n-drop resources to the code and sigma will automatically generate the code.

Permission Management: While using Sigma, there is no need to deal with yml files/terminal when creating resources, assigning permissions. And also you don’t have to manually compose lambda execution roles and attach IAM roles for every lambda file. Sigma will automatically generate minimal required IAM permissions. And also you can customize lambda permissions from the IDE UI itself.
Testing: AWS Cloud9 supports both local and remote testing for lambda and API Gateways. Sigma supports only remote testing. Sigma IDE utilizes its test framework by managing a test environment on AWS which allows developers to execute test events easily and provides real-time logs of test invocation results. And also to test deployed endpoints, Sigma comes with an inbuilt component with HTTP client, SNS client and SQS client.


Deployment: When creating a new lambda and an API, AWS Cloud9 automatically deploy that to the EC2 instance and AWS console. You can deploy further changes from the UI. When working with Sigma you can deploy your code whenever you wish with 2 deployment methods; Quick deployment or Full deployment.
Version Control: Sigma currently supports GitHub and Bitbucket. AWS Cloud9 supports GitHub and AWS CodeCommit. When working with AWS Cloud9 you can clone multiple repositories in one project. But you have to manually create repositories in GitHub/CodeCommit and run all the relevant terminal commands for each and every time you access that repositories. But Sigma will lift all that burdens on behalf of you. Before deploying every project, Sigma will integrate with the user preferred version control system and create a repository from the project name and commit changes to the repository straightaway.
Monitoring: Cloud9 doesn’t have a monitoring capability. But Sigma has an in-built monitoring component named as SigmaDash, which provides real-time log tailing and runtime statistics.

Conclusion
There are several tools and frameworks for serverless application development in the market with different capabilities. Among them, Cloud IDEs mainly supports the ‘Development’ stage of the serverless application development lifecycle. Rather than just providing a usual development platform, some of the IDEs come up with inbuilt features which facilitate multiple stages of the development lifecycle and reduce the development effort significantly.

Leave a comment