Now that we have two IAM policies, we will create a new Lambda IAM role and attach those two policies to it:
- Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
- In the navigation pane, choose Roles
- Choose Create Role
- Select AWS service and, under that, select Lambda
- Choose Next: Permissions
- Under Attach permissions policies | Filter polices, type dynamo-readonly-user-visits-api
- Select the checkbox for dynamo-readonly-user-visits-api
- Under Attach permissions policies | Filter polices, type lambda-cloud-write
- Select the checkbox for lambda-cloud-write
- Choose Next:Tags
- Choose Next:Review
- On the Review page, type lambda-dynamo-data-api for the Role name
- Choose Create ...