Create IAM Role

Create IAM Role

In this step, we will proceed to create IAM Role. In this IAM Role, the policy AmazonDynamoDBFullAccess and CloudWatchFullAccess will be assigned, this is the policy that allows the Lambda function to interact with DynamoDB databases.

  1. Go to IAM service administration interface
  2. In the left navigation bar, click Roles.

role

  1. Click Create role.

role1

  1. on Select trusted entity
  • Click AWS service.
  • Click Lambda
  • Click Next

role1

  1. In the Search box, enter AmazonDynamoDBFullAccess and press Enter to search for this policy.
  • Click the policy AmazonDynamoDBFullAccess. createpolicy1
  1. In the Search box, enter CloudWatchFullAccess and press Enter to search for this policy.
  • Click the policy CloudWatchFullAccess
  • then click Next createpolicy
  1. Click Next: Review.
  2. Name the Role BotRoles in Role Name createpolicy
  3. check again if the roles are correct
  4. Click Create Role createpolicy

Next, we will configure the role to Lambda so it can be able to call the databases.