I'm trying to get AWS SageMaker to call AWS Comprehend. I'm getting this message in SageMaker:
ClientError: An error occurred (AccessDeniedException) when calling the StartTopicsDetectionJob operation: User: arn:aws:sts::545176143103:assumed-role/access-aws-services-from-sagemaker/SageMaker is not authorized to perform: iam:PassRole on resource: arn:aws:iam::545176143103:role/access-aws-services-from-sagemaker
When creating the Jupyter notebook, I used this role:
arn:aws:sagemaker:us-east-2:545176143103:notebook-instance/access-comprehend-from-sagemaker
...with the following policies attached:
I'm using the same IAM role in SageMaker:
data_access_role_arn = "arn:aws:iam::545176143103:role/access-aws-services-from-sagemaker"
It looks like I'm giving the role all the access it needs. How can I correct this error?