AWS Lambda
Developer Guide

Step 2.2: Create the Execution Role (IAM Role)

In this section, you create an IAM role using the following predefined role type and access policy:

  • AWS service role of the type AWS Lambda – This role grants AWS Lambda permissions to assume the role.

  • AWSLambdaBasicExecute – This is the access permissions policy that you attach to the role. This Lambda function only writes logs to CloudWatch Logs. So it only needs permission for specific CloudWatch actions. This policy provides these permissions.

For more information about IAM roles, see IAM Roles in the IAM User Guide. Use the following procedure to create the IAM role.

To create an IAM role (execution role)

  1. Sign in to the AWS Management Console and open the IAM console at

  2. Follow the steps in Creating a Role to Delegate Permissions to an AWS Service in the IAM User Guide to create an IAM role (execution role). As you follow the steps to create a role, note the following:

    • In Role Name, use a name that is unique within your AWS account (for example, lambda-android-execution-role).

    • In Select Role Type, choose AWS Service Roles, and then choose AWS Lambda. This grants the AWS Lambda service permissions to assume the role.

    • In Attach Policy, choose AWSLambdaBasicExecute. The permissions in this policy are sufficient for the Lambda function in this tutorial.

  3. Write down the role ARN. You will need it in the next step when you create your Lambda function.

Next Step

Step 2.3: Create the Lambda Function and Invoke It Manually (Using Sample Event Data)

On this page: