-

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

penting

    1. Pilih Buat kebijakan.

catatan

catatan

    1. Pilih Buat kebijakan.

    2. For users of Studio and JupyterLab

      JSON
      JSON
      { "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/service-role/AmazonSageMaker-ExecutionRole" }, "Action": "sts:AssumeRole" } ] }
      For users of Studio Classic

      JSON
      JSON
      { "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:root" }, "Action": "sts:AssumeRole" } ] }

    1. Pilih Buat kebijakan.

    2. JSON
      { "Version":"2012-10-17", "Statement": [ { "Sid": "AllowRoleAssumptionForCrossAccountDiscovery", "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": [ "arn:aws:iam::111122223333:role/AssumableRole" ] } ] }
  1. Associate your assumable roles in JupyterLab using the SageMaker AI console

    1. Pilih Kirim.

    Associate your assumable roles in JupyterLab using a Python script

    import botocore.session import json sess = botocore.session.get_session() client = sess.create_client('sagemaker') client.update_userprofile( DomainId="domainID", UserProfileName="user-profile-name", DefaultUserSettings={ '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))
    For users of Studio Classic

    # This script creates the file that informs Studio Classic that the role "arn:aws:iam::emr-account:role/AssumableRole" in remote account "emr-account" must be assumed to list and describe Amazon EMR clusters in the remote account. #!/bin/bash set -eux 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 > "$FILE" <<- "EOF" { emr-cross-account1: "arn:aws:iam::emr-cross-account1:role/AssumableRole", emr-cross-account2: "arn:aws:iam::emr-cross-account2:role/AssumableRole" } EOF