AWS Mobile
Developer Guide

Cloud Logic

Choose the AWS Mobile Hub Cloud Logic mobile backend service feature to:

  • Add business logic functions in the cloud with no cost for server set up or maintenance

  • Extend your app to other services within AWS and beyond

Create a free Mobile Hub project and add the Cloud Logic feature.

Feature Details

The following image show Cloud Logic using the combination of Amazon API Gateway and AWS Lambda to implement serverless business logic and extension to other services.

The Cloud Logic feature lets you build backend services using AWS Lambda functions that you can call from your mobile app. Using Cloud Logic, you can run code in the cloud to process business logic for your apps and share the same code for both iOS and Android apps. The Cloud logic feature is powered by AWS Lambda functions, which allow you to write code without worrying about managing frameworks and scaling backend infrastructure. You can write your functions in JavaScript, Java, or Python.

The Lambda functions you create are exposed to your app as a REST API by Amazon API Gateway which also provides a single secure endpoint with flexible traffic monitoring and throttling capabilities.

Cloud Logic At a Glance

AWS services and resources configured

Mobile Hub-enabled features use Amazon Cognito for authentication and IAM for authorization. For more information, see User Sign-in. For more information, see Viewing AWS Resources Provisioned for this Feature.

Configuration options

This feature enables the following mobile backend capabilities:

  • Provides a default Hello World Lambda function that accepts the parameter value entered by the app user and returns it back to an app.

  • Enables you to choose an existing function from the list provided or use the AWS Lambda console to create new functions.

Quickstart app demos

This feature adds the following functionality to a quickstart app generated by Mobile Hub:

  • User can specify an AWS Lambda function by name, provide parameters and call a function and see the value returned by the function

Viewing AWS Resources Provisioned for this Feature

The following image shows the Mobile HubResources pane displaying elements typically provisioned for the Cloud Logic feature.

Quickstart App Details

Your quickstart app includes code to use AWS Lambda APIs to invoke any functions you have selected in your project. Adding Cloud Logic to your quickstart app provides a Hello World default Lambda function. You can also choose an existing Lambda function from your AWS account, or you can create a new one. When you choose the edit button, you are taken to the function editor in the AWS Lambda console. From the Lambda console, you can edit the code directly or upload a package of source and libraries as a .zip file.

In the demo screen of the Cloud Logic quickstart app, you can enter the name and input parameters of the Lambda function you wish to invoke. The quickstart app then calls your Lambda function and displays the results it returns.