Hello everyone !!! Today in this blog we will see how we can create IAM role for AWS lambda function. But first let us know what IAM role is. IAM stands for Identity Access Management. It is a service from AWS by which we can permissions to different users who are using the same AWS account that you have created.
Steps to create IAM role for lambda function:
Step 1: First we logged into the AWS management console and navigate to services and search for IAM. Click on IAM. It will redirect to IAM management console.
Step 2 : Click on role and click on create role. There are four entities here. So, we will select AWS service from here.
Step 3 : From AWS service we will select lambda and click on next.
Here you can see all the listed policy name that we can attach with this role.
Step 4: For now we will attach the AmazonS3FullAccess. We will click on next review. We will assign the role name here. Let us name is lambda_s3_access. You can change the role description if you want. After assigning the role name we will click on create role.
Step 5: Here we can see that we have successfully created the lambda_s3_access row.
Step 6: After creating the row we check if it is showing in our lambda management console or not. For this we navigate to services and search for lambda.
Step 7: You can create a new function here or select an existing function and navigate to execution list and you can see that you have access to lambda_s3_access role.
In this way, we create IAM role for AWS lambda function.
IAM is an web service for securely controlling access to the AWS resource and it really helps us to authenticate or a set of limit access to a certain set of users accessing the AWS account or certain set of users accessing the certain set of resources in AWS account.