The current AWS identity is not a role for sagemaker?


I am getting error when i call get_execution_role() from sagemaker in python.
I have attached the error for the same.
enter image description here

I have added the SagemakerFullAccess Policy to role and user both.


get_execution_role() is a function helper used in the Amazon SageMaker Examples GitHub repository.

These examples were made to be executed from the fully managed Jupyter notebooks that Amazon SageMaker provides.

From inside these notebooks, get_execution_role() will return the IAM role name that was passed in as part of the notebook creation. That allows the notebook examples to be executed without code changes.

From outside these notebooks, get_execution_role() will return an exception because it does not know what is the role name that SageMaker requires.

To solve this issue, pass the IAM role name instead of using get_execution_role().

Instead of:

you need to do:

Leave a Reply