Tsimp. Dim
Tsimp. Dim

Reputation: 84

AWS IAM | Cannot Assume Role created on the same "session" (InvalidInputException)

This has happened to me on multiple occasions and I can't for the life of me figure out why. Examples:

I have tried waiting to make sure the role is created, but i still got the error. The error is:

"An error occurred (InvalidInputException) when calling the CreateCrawler operation: Service is unable to assume role arn:aws:iam::<acc_id>:role/GlueReadS3. Please verify role's TrustPolicy"

The weird thing is, the same role can be assumed by CloudFormation just fine.

{
    "Version": "2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Principal": {
            "Service": "glue.amazonaws.com"
        },
        "Action": "sts:AssumeRole"
    }]
}

I should mention that the boto3 error also returned the Role ARN (so I'm assuming that it was created) and also that I made a get_role beforehand to get the ARN it also did not work

Upvotes: 2

Views: 3053

Answers (1)

Hailey
Hailey

Reputation: 21

Maybe you can check the role in IAM, in my case, I thought I created a role like arn:aws:iam::<acc_id>:role/GlueReadS3, but I then go to IAM and checked, it was actually arn:aws:iam::<acc_id>:role/service-role/GlueReadS3.

Upvotes: 2

Related Questions