Deploy mobile services to AWS Serverless using AWS Lambda and AWS API Gateway

Official Content
This documentation is valid for:

This document tells you the prerequisites and steps to deploy applications (REST APIs) to AWS Lambda and AWS API Gateway.

"AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running." ref.: https://aws.amazon.com/lambda/

"Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale." ref.: https://aws.amazon.com/api-gateway

The main benefits of deploying to serverless platforms are the following:

  • No worry about infrastructure at all.
  • No need to manage, configure or install any web server. 
  • No need to rent or buy any server. 
  • 24/7/365 up time for (almost) free. (You pay only if the App is used. )

Technology used

  • AWS Lambda is used in order to Deploy Code that will be run in the Cloud. 
  • AWS API Gateway for Deploying REST Services. 
  • Swagger definition for describing the API generated for our Application. 

 

Supports deployment of

  • Service Backend for REST based Applications (iOS, Angular, Android)
  • API Objects

Restrictions

  • Java Generator only
  • Storage
    • If using Image, Audio, Video, BlobFile data types => Storage Provider property must be used. This is because all App multimedia must be served from an external URL, such as Amazon S3. 
    • Cannot use FileSystem to serve content: File/read write access as Blob data type, Excel, PDF Reports. 
  • Temporal restrictions:
  • Max number of 600 services can be deployed per AWS Region. 

 

How to use it

  1. Deploy Infrastructure in AWS ("How to" coming soon) 
  2. Build your  GeneXus JAVA Application
  3. Using Application Deployment tool, select the Main Objects to Deploy. It must be a Smart Device Main Application. 
  4. From the Target Dropdown, select: "AWS Serverless Deploy"
  5. Fill required Deployment properties:
  6. Fill Application Name and Stage Name (ex: test, prod, v1, etc)
  7. Click "Deploy"

That's it!

At the final step, GeneXus will print out the final URL.

You can use it now in the Smart Devices Generator's Services URL property.

 

Important notes:

  • Database Access

The AWS Lambda Function deployed must have access to the Database (should be in the same VPC and Security Group). You will have to configure it manually in the AWS Lambda Function Console. 

 AWSAccessKeyRequiresCustomPolicy_PNG

 

Availability

Since GeneXus 17 upgrade 7

 

See Also