When I get to Notebook Instance in SageMaker and create model in linear_learner_mnist example I get error even when I have the role with AmazonSageMakerFullAccessand AssumeRole attached policies attached. When I add AdministratorAccesspolicy to the role - all works fine. What am I missing here?
role exists and attached
Resources:
SageMakerExecutionRole:
Condition: RoleArnEmpty
Type: "AWS::IAM::Role"
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: "Allow"
Principal:
Service:
- "sagemaker.amazonaws.com"
Action:
- sts:AssumeRole
ManagedPolicyArns:
- "arn:aws:iam::aws:policy/AmazonSageMakerFullAccess"
Path: "/service-role/"
Policies:
Fn::If:
- S3BucketNotEmpty
-
- PolicyName: SageMakerS3BucketAccess
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- s3:*
Resource:
- !Sub 'arn:aws:s3:::${SageMakerS3Bucket}'
- !Sub 'arn:aws:s3:::${SageMakerS3Bucket}/*'
- Ref: AWS::NoValue
ClientError: An error occurred (ValidationException) when calling the CreateTrainingJob operation: Could not assume role arn:aws:iam::XXX:role/sagemaker-stack-SageMakerExecutionRole-1JT7AT4OPUK9R. Please ensure that the role exists and allows principal 'sagemaker.amazonaws.com' to assume the role.