Annotating PDF files - SagerMakerExecutionRole can not assume role for sagemaker.amazonaws.com

0

I follow this tutorial : https://docs.aws.amazon.com/comprehend/latest/dg/cer-annotation-pdf.html#cer-annotation-pdf-set-up

At the step "Creating an annotation job", I get this error :

botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the CreateLabelingJob operation: The role ARN arn:aws:iam::xxxxxxxxxxxx:role/xxxxxxxx-SageMakerExecutionRole-xxxxxxxxxxxxxx isn't valid. Make sure the role exists and that its trust relationship policy allows the action "sts:AssumeRole" for the service principal "sagemaker.amazonaws.com"

So, I went to IAM and check the trust relationships :

        {
            "Effect": "Allow",
            "Principal": {
                "Service": "sagemaker.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }

Is that enough ?

I'm using the Ubuntu app under Windows 10.

I checked the version of boto3 :

# pip show boto3
Name: boto3
Version: 1.26.52
...

What can I do more ?

Thank you in advance !

asked a year ago234 views
1 Answer
1

One of the first steps in this tutorial consists in setting up your AWS credentials. Calling aws configure by default points you to the AWS account the currently authenticated IAM user is part of along with a default region. Are you running the annotation job creation script from within the same account as where the stack was created? We'd need more information to make sure but it seems to a plausible cause.

AWS
NZ
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions