in migration/bring-your-own-role/byor.py [0:0]
def _update_domain_execution_role(sagemaker, domain_id, bring_in_role_arn, execute_flag):
print(f"Updating Project's SageMaker Domain id: {domain_id} execution role to {bring_in_role_arn}...\n")
if execute_flag:
sagemaker.update_domain(
DomainId=domain_id,
DefaultUserSettings={
'ExecutionRole': bring_in_role_arn
},
DefaultSpaceSettings={
'ExecutionRole': bring_in_role_arn
}
)
print(f"Updated Project's SageMaker Domain id: {domain_id} default execution role to {bring_in_role_arn} successfully\n")
else:
print(f"Skipping update Project's SageMaker Domain id: {domain_id} default execution role, set --execute flag to True to do the actual update\n")