Step 2: Create a Lambda Function
In this section, you do the following:
Create a Lambda function deployment package using the sample code provided. The sample Lambda function code that you'll use to subscribe to an Amazon SNS topic is provided in various languages. Select one of the languages and follow the corresponding instructions to create a deployment package.
Create an IAM role (execution role). At the time you upload the deployment package, you need to specify an IAM role (execution role) that Lambda can assume to execute the function on your behalf.