Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Lihat perinciannya di .
{ "Version":"2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": "elasticmapreduce:GetClusterSessionCredentials", "Resource": "*", "Condition": { "ArnLike": { "elasticmapreduce:ExecutionRoleArn": [ "arn:aws:iam::111122223333:role/emr-execution-role-ml-modeling*", "arn:aws:iam::111122223333:role/emr-execution-role-ml-training*" ]}, "StringLike":{ "elasticmapreduce:ResourceTag/group": [ "*modeling*", "*training*" ] } } } ] }
111122223333
{ "Version":"2012-10-17", "Statement": [ { "Sid": "AllowAssumeCrossAccountEMRAccessRole", "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam::111122223333:role/emr-access-role-name" } ] }
emr-access-role-name
{ "Version":"2012-10-17", "Statement": [ { "Sid": "AllowCrossAccountSageMakerExecutionRoleToAssumeThisRole", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/studio_execution_role" }, "Action": "sts:AssumeRole" } ] }
studio_execution_role
{ "Version":"2012-10-17", "Statement": [ { "Sid": "AllowCallingEmrGetClusterSessionCredentialsAPI", "Effect": "Allow", "Action": "elasticmapreduce:GetClusterSessionCredentials", "Resource": "arn:aws:elasticmapreduce:us-east-1:111122223333:cluster/cluster-id", "Condition": { "StringLike": { "elasticmapreduce:ExecutionRoleArn": [ "arn:aws:iam::111122223333:role/emr-execution-role-name" ] } } } ] }
us-east-1
cluster-id
emr-execution-role-name
Pilih Kirim.
import botocore.session import json sess = botocore.session.get_session() client = sess.create_client('sagemaker') client.update_user_profile( DomainId="domainID", UserProfileName="user-profile-name", UserSettings={ 'JupyterLabAppSettings': { 'EmrSettings': { 'AssumableRoleArns': ["arn:aws:iam::emr-accountID:role/AssumableRole"], 'ExecutionRoleArns': ["arn:aws:iam::emr-accountID:role/EMRServiceRole", "arn:aws:iam::emr-accountID:role/AnotherServiceRole"] } } }) resp = client.describe_user_profile(DomainId="domainID", UserProfileName=user-profile-name") resp['CreationTime'] = str(resp['CreationTime']) resp['LastModifiedTime'] = str(resp['LastModifiedTime']) print(json.dumps(resp, indent=2))
domainID
user-profile-name
emr-accountID
AssumableRole
EMRServiceRole
AnotherServiceRole
#!/bin/bash set -eux FILE_DIRECTORY="/home/sagemaker-user/.sagemaker-analytics-configuration-DO_NOT_DELETE" FILE_NAME="emr-configurations-DO_NOT_DELETE.json" FILE="$FILE_DIRECTORY/$FILE_NAME" mkdir -p $FILE_DIRECTORY cat << 'EOF' > "$FILE" { "emr-execution-role-arns": { "123456789012": [ "arn:aws:iam::123456789012:role/emr-execution-role-1", "arn:aws:iam::123456789012:role/emr-execution-role-2" ] } } EOF
emr-execution-role-1
emr-execution-role-2
#!/bin/bash set -eux FILE_DIRECTORY="/home/sagemaker-user/.sagemaker-analytics-configuration-DO_NOT_DELETE" FILE_NAME="emr-configurations-DO_NOT_DELETE.json" FILE="$FILE_DIRECTORY/$FILE_NAME" mkdir -p $FILE_DIRECTORY cat << 'EOF' > "$FILE" { "emr-execution-role-arns": { "123456789012": [ "arn:aws:iam::212121212121:role/emr-execution-role-1", "arn:aws:iam::434343434343:role/emr-execution-role-2" ] } } EOF # add your cross-account EMR access role FILE_DIRECTORY="/home/sagemaker-user/.cross-account-configuration-DO_NOT_DELETE" FILE_NAME="emr-discovery-iam-role-arns-DO_NOT_DELETE.json" FILE="$FILE_DIRECTORY/$FILE_NAME" mkdir -p $FILE_DIRECTORY cat << 'EOF' > "$FILE" { "123456789012": "arn:aws:iam::123456789012:role/cross-account-emr-access-role" } EOF
cross-account-emr-access-role
Javascript dinonaktifkan atau tidak tersedia di browser Anda.
Untuk menggunakan Dokumentasi AWS, Javascript harus diaktifkan. Lihat halaman Bantuan browser Anda untuk petunjuk.
Terima kasih telah memberitahukan bahwa hasil pekerjaan kami sudah baik.
Jika Anda memiliki waktu luang, beri tahu kami aspek apa saja yang sudah bagus, agar kami dapat menerapkannya secara lebih luas.
Terima kasih telah memberi tahu kami bahwa halaman ini perlu ditingkatkan. Maaf karena telah mengecewakan Anda.
Jika Anda memiliki waktu luang, beri tahu kami bagaimana dokumentasi ini dapat ditingkatkan.