0

I am trying to create a HyperparameterTuner job in Sagemaker. We only use assumed roles, so my ARN looks like:

arn:aws:sts::123456789012:assumed-role/ROLE_NAME/[email protected]

However, when I try to create a job according to AWS's tutorial, I get the following error:

(not all code included)
>>> tuner = HyperparameterTuner(
    xgb, objective_metric_name, hyperparameter_ranges, max_jobs=20, max_parallel_jobs=3
)
>>> tuner.fit()

ClientError: An error occurred (ValidationException) when calling the CreateHyperParameterTuningJob 
operation: 1 validation error detected: Value 
'arn:aws:sts::123456789012:assumed-role/ROLE_NAME/[email protected]' at 
'trainingJobDefinition.roleArn' failed to satisfy constraint: Member must satisfy regular expression 
pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$

The error message states that the role must have iam::123:role/. This is problematic because assumed roles look like sts::123:assumed-role/.

Is there some way to format my assumed role into something the HyperparameterTuner will accept, or are assumed roles simply not compatible with AWS Sagemaker?

1 Answer 1

0

Try to change the role name to a simple string, do not add numbers or anything of that sort, an example would be "sm-overall-role".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.