I have a profile already set in ~/.aws/credentials because my company uses Okta for single sign-on.
Saving a new execution role with sagemaker_save_execution_role("arn:aws:iam::xxxxxx:role/service-role/AmazonSageMaker-ExecutionRole-20200513T120887") appends this role to ~/.aws/config (it doesn't check if it already exists so it duplicates it, but that's another story) without naming the profile I set with
This results in sagemaker_get_execution_role() returning arn:aws:iam::xxxxx:role/Administrator instead of arn:aws:iam::xxxxxx:role/service-role/AmazonSageMaker-ExecutionRole-20200513T120887.
Makes sagemaker_get_execution_role() return the correct role, although other functions stopped working, example:
> sagemaker_xgb_estimator()
> You are not in a sagemaker hosted notebook.
Pulling local role in ~/.aws/config
Error in py_call_impl(callable, dots$args, dots$keywords) :
PartialCredentialsError: Partial credentials found in assume-role, missing: source_profile or credential_source
I think I encountered some cache invalidation issue. After restarting everything worked as it should, except of the duplication. I'll try to make a PR for that.
I have a profile already set in
~/.aws/credentials
because my company uses Okta for single sign-on. Saving a new execution role withsagemaker_save_execution_role("arn:aws:iam::xxxxxx:role/service-role/AmazonSageMaker-ExecutionRole-20200513T120887")
appends this role to~/.aws/config
(it doesn't check if it already exists so it duplicates it, but that's another story) without naming the profile I set withThis results in
sagemaker_get_execution_role()
returningarn:aws:iam::xxxxx:role/Administrator
instead ofarn:aws:iam::xxxxxx:role/service-role/AmazonSageMaker-ExecutionRole-20200513T120887
.Manually editing the file to:
Makes
sagemaker_get_execution_role()
return the correct role, although other functions stopped working, example: