The current AWS identity is not a role for sagemaker?

前端 未结 3 1545
孤独总比滥情好
孤独总比滥情好 2021-01-04 08:00

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

I have added the SagemakerFullAccess Policy to

3条回答
  •  无人及你
    2021-01-04 08:35

    I struggled with this for a while and there are a few different pieces but I believe these are the steps to solve (according to this doc)

    You must add a role to your aws config file. Go to terminal and enter:

    ~/.aws/config
    

    Add your own profile

    [profile marketingadmin]
    role_arn = arn:aws:iam::123456789012:role/marketingadmin
    source_profile = default
    

    Then Edit Trust Relationships in the AWS Dashboard:

    add this and update:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "Service": "sagemaker.amazonaws.com",
            "AWS": "arn:aws:iam::XXXXXXX:user/YOURUSERNAME"
          },
          "Action": "sts:AssumeRole"
        }
      ]
    }
    

    Lastly, I clicked the link that says

    Give this link to users who can switch roles in the console

    After adding my credentials - it worked.

提交回复
热议问题