Fine-grained Access with AssumeRole
So far what we have seen is kind of a static assignment of the roles and using the services accordingly. When we run our code inside Lambda, it has its own role and permissions.
API Gateway Authorizer to validate that we have a valid Cognito session
API Gateway Scope to validate that the user has the permission to invoke the API
But how we do make sure that the Lambda function has the exact permissions as per the request role?
In that case, we will be using Fine-grained access control. Conceptually it is a very simple practice that is used by most of the AWS services.
We will be using the AssumeRole API inside the Lambda function based on the incoming Cognito profile detail.
In this context, the executing Lambda by default has only the AssumeRole permission so that it can transition to the new role. The target role must have all the policies to execute the function's logic correctly.
Last updated