-
Notifications
You must be signed in to change notification settings - Fork 0
4. Create a AWS Role
Vikas Rathod edited this page Feb 20, 2021
·
1 revision
Now we need to Create a AWS Role to give permission to AWS Lambda to do CRUD operations on DynamoDB Table.
- Login into your AWS Management Console.
- Go to
Services
, and openIAM
under Security, Identity, & Compliance section. - Click on
Roles
- Click on
Create role
we need to create a role for lambda to permit basic execution operations. So,
- Select
Lambda
and click onNext: Permissions
- Enter
AWSLambdaBasicExecutionRole
in search bar - Click on provided check box in front of
AWSLambdaBasicExecutionRole
- Click on
Next: Tags
- Enter
Function
as key andPractice
as Value - Click on
Next: Review
- Enter
LambdaDynamoDBAccessRole
as Role name - Click on
Create role
- Select
- Now you'll see
LambdaDynamoDBAccessRole
in list, but we need to give access of specific DynamoDB table for write operations. So,- Click on
LambdaDynamoDBAccessRole
. - Click on
Add inline policy
- Click on
Choose a service
and selectDynamoDB
- Click check box in front of
Write
NOTE : Best practice is to give minimum required permission to resources.
- Click on
Resources
, look fortable
and click onAdd ARN
. - Paste your DyanmoDB ARN in the
Specify ARN for table
area and click onAdd
.
Here we've given only
write
permission to onlyserverless
table with this role.- Now click on
Review Policy
- Enter
serverlessDBAccessforLambda
in Name - Now click on
Create policy
- Click on