

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 將 Amazon EMR 與 整合 AWS IAM Identity Center
<a name="emr-idc"></a>

透過 Amazon EMR 6.15.0 版和更新版本，您可以使用來自 的身分 AWS IAM Identity Center 來驗證 Amazon EMR 叢集。下列各節提供使用 Identity Center 整合來啟動 EMR 叢集所需的概念性概觀、先決條件和步驟。

**Topics**
+ [概觀](#emr-idc-overview)
+ [功能和優勢](#emr-idc-features)
+ [AWS IAM Identity Center 和 Amazon EMR 入門](emr-idc-start.md)
+ [使用者背景工作階段](user-background-sessions.md)
+ [Amazon EMR 與 Identity Center 整合的考量事項和限制](emr-idc-considerations.md)

## 概觀
<a name="emr-idc-overview"></a>

[Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) 是建議用於任何大小和類型 AWS 之組織的人力資源身分驗證和授權的方法。使用 Identity Center，您可以在 中建立和管理使用者身分 AWS，或連接現有的身分來源，包括 Microsoft Active Directory、Okta、Ping Identity、JumpCloud、Google Workspace 和 Microsoft Entra ID （先前稱為 Azure AD)。

[信任的身分傳播](https://docs.aws.amazon.com//singlesignon/latest/userguide/trustedidentitypropagation-overview.html)是一項 AWS IAM Identity Center 功能，連線的管理員 AWS 服務 可以使用此功能來授予和稽核服務資料的存取權。存取此資料是根據使用者屬性，例如群組關聯。設定信任的身分傳播需要連線的管理員 AWS 服務 與 IAM Identity Center 管理員之間的協同合作。如需詳細資訊，請參閱[先決條件和考量](https://docs.aws.amazon.com//singlesignon/latest/userguide/trustedidentitypropagation-overall-prerequisites.html)。

## 功能和優勢
<a name="emr-idc-features"></a>

Amazon EMR 與 IAM Identity Center 整合可提供以下優勢：
+ Amazon EMR 會提供憑證，將您的 Identity Center Identity 轉送至 EMR 叢集。
+ Amazon EMR 會設定所有支援的應用程式，以使用叢集憑證來進行身分驗證。
+ Amazon EMR 會使用 Kerberos 通訊協定為支援的應用程式設定和維護安全性，且您無須發出任何命令或指令碼。
+ 能夠在 S3 Access Grants 受管 S3 字首上使用 Identity Center 身分，強制執行 Amazon S3 字首層級授權。
+ 在 AWS Lake Formation 受管 Glue AWS 資料表上使用 Identity Center 身分強制執行資料表層級授權的能力。

# AWS IAM Identity Center 和 Amazon EMR 入門
<a name="emr-idc-start"></a>

本節可協助您設定要與 整合的 Amazon EMR AWS IAM Identity Center。

**Topics**
+ [建立 Identity Center 執行個體](#emr-idc-start-instance)
+ [為 Identity Center 建立 IAM 角色](#emr-idc-start-role)
+ [新增未與 IAM Identity Center 整合之服務的許可](#emr-idc-start-securityconfig-nonidc)
+ [建立已啟用 Identity Center 的安全組態](#emr-idc-start-securityconfig)
+ [建立並啟動已啟用 Identity Center 的叢集](#emr-idc-cluster)
+ [為已啟用 IAM Identity Center 的 EMR 叢集設定 Lake Formation](emr-idc-lf.md)
+ [在已啟用 IAM Identity Center 的 EMR 叢集上使用 S3 Access Grants](emr-idc-s3ag.md)

**注意**  
若要使用 Identity Center 與 EMR 整合，必須啟用 Lake Formation 或 S3 Access Grants。您也可以同時使用兩者。如果兩者都未啟用，則不支援 Identity Center 整合。

## 建立 Identity Center 執行個體
<a name="emr-idc-start-instance"></a>

如果您還沒有 Identity Center 執行個體，請在要啟動 EMR 叢集的 AWS 區域 中建立 Identity Center 執行個體。Identity Center 執行個體僅能存在於一個 AWS 帳戶的單一區域中。

使用以下 AWS CLI 命令建立名為 的新執行個體`MyInstance`：

```
aws sso-admin create-instance --name MyInstance
```

## 為 Identity Center 建立 IAM 角色
<a name="emr-idc-start-role"></a>

若要整合 Amazon EMR 與 AWS IAM Identity Center，請建立 IAM 角色，從 EMR 叢集向 Identity Center 進行身分驗證。本質上而言，Amazon EMR 會使用 SigV4 憑證將 Identity Center 身分轉送至下游服務，例如 AWS Lake Formation。您的角色也應具有調用下游服務的對應許可。

在建立角色時，請使用以下許可政策：

```
{
  "Statement": [
    {
      "Sid": "IdCPermissions",
      "Effect": "Allow",
      "Action": [
        "sso-oauth:*"
      ],
      "Resource": "*"
    },
    {
      "Sid": "GlueandLakePermissions",
      "Effect": "Allow",
      "Action": [
        "glue:*",
        "lakeformation:GetDataAccess"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AccessGrantsPermissions",
      "Effect": "Allow",
      "Action": [
        "s3:GetDataAccess",
        "s3:GetAccessGrantsInstanceForPrefix"
      ],
      "Resource": "*"
    }
  ]
}
```

此角色的信任政策讓 InstanceProfile 角色可擔任該角色。

```
{
    "Sid": "AssumeRole",
    "Effect": "Allow",
    "Principal": {
        "AWS": "arn:aws:iam::12345678912:role/EMR_EC2_DefaultRole"
    },
    "Action": [
        "sts:AssumeRole",
        "sts:SetContext"
    ]
}
```

如果角色沒有信任的登入資料並存取 Lake Formation 保護的資料表，Amazon EMR 會自動將擔任角色`principalId`的 設定為 `userID-untrusted`。以下是顯示 的 CloudTrail 事件程式碼片段`principalId`。

```
{
    "eventVersion": "1.09",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "ABCDEFGH1JKLMNO2PQR3TU:5000-untrusted",
        "arn": "arn:aws:sts::123456789012:assumed-role/EMR_TIP/5000-untrusted",
        "accountId": "123456789012",
        "accessKeyId": "ABCDEFGH1IJKLMNOPQ7R3"
        ...
```

## 新增未與 IAM Identity Center 整合之服務的許可
<a name="emr-idc-start-securityconfig-nonidc"></a>

AWS 對於未與 IAM Identity Center 整合之服務的任何呼叫，使用 IAM 角色中定義之 IAM 政策的 憑證。例如，這包括 AWS Key Management Service。您的角色也應該為嘗試存取範例的任何此類服務定義任何 IAM 許可 AWS Key Management Service。目前支援的 IAM Identity Center 整合服務包括 AWS Lake Formation 和 Amazon S3 Access Grants。

若要進一步了解受信任身分傳播，請參閱[跨應用程式的受信任身分傳播](https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation.html)。

## 建立已啟用 Identity Center 的安全組態
<a name="emr-idc-start-securityconfig"></a>

若要啟動具有 IAM Identity Center 整合的 EMR 叢集，請使用以下範例命令來建立已啟用 Identity Center 的 Amazon EMR 安全組態。每個組態的說明如下。

```
aws emr create-security-configuration --name "IdentityCenterConfiguration-with-lf-accessgrants" --region "us-west-2" --security-configuration '{
    "AuthenticationConfiguration":{
        "IdentityCenterConfiguration":{
            "EnableIdentityCenter":true,
            "IdentityCenterApplicationAssigmentRequired":false,
            "IdentityCenterInstanceARN": "arn:aws:sso:::instance/ssoins-123xxxxxxxxxx789"
        }
    },
    "AuthorizationConfiguration": {
        "LakeFormationConfiguration": {
            "AuthorizedSessionTagValue": "Amazon EMR"
        },
        "IAMConfiguration": {
          "EnableApplicationScopedIAMRole": true,
          "ApplicationScopedIAMRoleConfiguration": {
            "PropagateSourceIdentity": true
          }
        }
    },
    "EncryptionConfiguration": {
        "EnableInTransitEncryption": true,
        "EnableAtRestEncryption": false,
        "InTransitEncryptionConfiguration": {
            "TLSCertificateConfiguration": {
                "CertificateProviderType": "PEM",
                "S3Object": "s3://amzn-s3-demo-bucket/cert/my-certs.zip"
            }
        }
    }
}'
```
+ **`EnableIdentityCenter`**：(必要) 啟用 Identity Center 整合。
+ **`IdentityCenterInstanceARN`** – （選用） Identity Center 執行個體 ARN。如果不包含此項目，則會在組態步驟中查詢現有的 IAM Identity Center 執行個體 ARN。
+ **`IAMRoleForEMRIdentityCenterApplicationARN`**：(必要) 從叢集採購 Identity Center 權杖的 IAM 角色。
+ **`IdentityCenterApplicationAssignmentRequired `**：(布林值) 控管是否需要指派才能使用 Identity Center 應用程式。此欄位為選用欄位。如果未提供值，則預設值為 `false`。
+ **`AuthorizationConfiguration` / `LakeFormationConfiguration`** – 選擇性地設定授權：
  + **`IAMConfiguration`** – 除了 TIP 身分之外，還啟用 EMR 執行期角色功能。如果您啟用此組態，則每次呼叫 EMR 步驟或 EMR `GetClusterSessionCredentials` APIs 時，都需要您 （或發起人 AWS 服務） 指定 IAM 執行期角色。如果 EMR 叢集與 SageMaker Unified Studio 搭配使用，則如果也啟用受信任身分傳播，則需要此選項。
  + **`EnableLakeFormation`**：在叢集上啟用 Lake Formation 授權。

若要啟用 Identity Center 與 Amazon EMR 整合，您必須指定 `EncryptionConfiguration` 和 `IntransitEncryptionConfiguration`。

## 建立並啟動已啟用 Identity Center 的叢集
<a name="emr-idc-cluster"></a>

現在，您已設定使用 Identity Center 執行身分驗證的 IAM 角色，並已建立已啟用 Identity Center 的 Amazon EMR 安全組態，您可以建立和啟動身分感知叢集。如需了解使用所需安全組態來啟動叢集的步驟，請參閱 [指定 Amazon EMR 叢集的安全組態](emr-specify-security-configuration.md)。

下列各節說明如何使用 Amazon EMR 支援的安全選項來設定啟用 Identity Center 的叢集：
+ [在已啟用 IAM Identity Center 的 EMR 叢集上使用 S3 Access Grants](emr-idc-s3ag.md)
+ [為已啟用 IAM Identity Center 的 EMR 叢集設定 Lake Formation](emr-idc-lf.md)

# 為已啟用 IAM Identity Center 的 EMR 叢集設定 Lake Formation
<a name="emr-idc-lf"></a>

您可以[AWS Lake Formation](https://docs.aws.amazon.com/lake-formation/latest/dg/)與 AWS IAM Identity Center 已啟用 EMR 叢集整合。

首先，請務必在叢集所在的相同區域中設定 Identity Center 執行個體。如需詳細資訊，請參閱[建立 Identity Center 執行個體](emr-idc-start.md#emr-idc-start-instance)。在您檢視執行個體詳細資訊時，您可以在 IAM Identity Center 主控台中找到執行個體 ARN，或使用以下命令從 CLI 檢視所有執行個體的詳細資訊：

```
aws sso-admin list-instances
```

然後使用 ARN 和 AWS 您的帳戶 ID 搭配下列命令，將 Lake Formation 設定為與 IAM Identity Center 相容：

```
aws lakeformation create-lake-formation-identity-center-configuration --cli-input-json file://create-lake-fromation-idc-config.json 
json input:
{
    "CatalogId": "account-id/org-account-id",
    "InstanceArn": "identity-center-instance-arn"
}
```

現在，請使用 Lake Formation 呼叫 `put-data-lake-settings` 並啟用 `AllowFullTableExternalDataAccess`：

```
aws lakeformation put-data-lake-settings --cli-input-json file://put-data-lake-settings.json 
json input:
{
    "DataLakeSettings": {
        "DataLakeAdmins": [
            {
                "DataLakePrincipalIdentifier": "admin-ARN"
            }
        ],
        "CreateDatabaseDefaultPermissions": [...],
        "CreateTableDefaultPermissions": [...],
        "AllowExternalDataFiltering": true,
        "AllowFullTableExternalDataAccess": true
    }
}
```

最後，將身分 ARN 的完整資料表許可授予存取 EMR 叢集的使用者。ARN 包含 Identity Center 中的使用者 ID。導覽至主控台中的 Identity Center，選取**使用者**，然後選取該使用者以檢視其**一般資訊**設定。

複製使用者 ID 並將其貼至以下 `user-id` 的 ARN：

```
arn:aws:identitystore:::user/user-id
```

**注意**  
僅在 IAM Identity Center 身分在受 Lake Formation 保護之資料表上具有完整資料表存取權限時，EMR 叢集上的查詢才會運作。如果該身分不具有完整的資料表存取權限，則查詢將失敗。

使用以下命令授予使用者完整資料表存取權限：

```
aws lakeformation grant-permissions --cli-input-json file://grantpermissions.json
json input:
{
    "Principal": {
        "DataLakePrincipalIdentifier": "arn:aws:identitystore:::user/user-id"
    },
    "Resource": {
        "Table": {
            "DatabaseName": "tip_db",
            "Name": "tip_table"
        }
    },
    "Permissions": [
        "ALL"
    ],
    "PermissionsWithGrantOption": [
        "ALL"
    ]
}
```

## 將應用程式 ARN 新增至 IDC 以進行 Lake Formation 整合
<a name="emr-idc-enabled-idc"></a>

若要查詢已啟用 Lake Formation 的資源，需要新增 IDC 應用程式的應用程式 ARN。若要這麼做，請依照下列步驟進行：

1. 在 主控台上，選擇 **AWS Lake Formation**。

1. 透過比對應用程式 ARN，選取 **IAM Identity Center 整合**和 Lake Formation 應用程式整合。 ****ARN 會出現在**應用程式 ID** 清單中。

# 在已啟用 IAM Identity Center 的 EMR 叢集上使用 S3 Access Grants
<a name="emr-idc-s3ag"></a>

您可以將 [S3 Access Grants](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants.html) 與 AWS IAM Identity Center 已啟用的 EMR 叢集整合。

使用 S3 Access Grants 授予存取權限，以存取來自使用 Identity Center 之叢集的資料集。建立授予以增強您為 IAM 使用者、群組、角色或公司目錄設定的許可。如需詳細資訊，請參閱[將 S3 Access Grants 與 Amazon EMR 搭配使用](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-access-grants.html)。

**Topics**
+ [建立 S3 Access Grants 執行個體和位置](#emr-idc-s3ag-instance)
+ [為 Identity Center 身分建立授予](#emr-idc-s3ag-identities)

## 建立 S3 Access Grants 執行個體和位置
<a name="emr-idc-s3ag-instance"></a>

如果您還沒有 S3 Access Grants 執行個體，請在要啟動 EMR 叢集的 AWS 區域 中建立 S3 Access Grants 執行個體。

使用以下 AWS CLI 命令建立名為 的新執行個體`MyInstance`：

```
aws s3control-access-grants create-access-grants-instance \
--account-id 12345678912 \
--identity-center-arn "identity-center-instance-arn" \
```

然後，請建立 S3 Access Grants 位置，使用您自有的值取代紅色值：

```
aws s3control-access-grants create-access-grants-location \
--account-id 12345678912 \
--location-scope s3:// \
--iam-role-arn "access-grant-role-arn" \
--region aa-example-1
```

**注意**  
將 `iam-role-arn` 參數定義為 `accessGrantRole` ARN。

## 為 Identity Center 身分建立授予
<a name="emr-idc-s3ag-identities"></a>

最後，請為具有叢集存取權限的身分建立授予：

```
aws s3control-access-grants create-access-grant \
--account-id 12345678912 \
--access-grants-location-id "default" \
--access-grants-location-configuration S3SubPrefix="s3-bucket-prefix"
--permission READ \
--grantee GranteeType=DIRECTORY_USER,GranteeIdentifier="your-identity-center-user-id"
```

輸出範例：

```
{
"CreatedAt": "2023-09-21T23:47:24.870000+00:00",
"AccessGrantId": "1234-12345-1234-1234567",
"AccessGrantArn": "arn:aws:s3:aa-example-1-1:123456789012:access-grants/default/grant/xxxx1234-1234-5678-1234-1234567890",
"Grantee": {
"GranteeType": "DIRECTORY_USER",
"GranteeIdentifier": "5678-56789-5678-567890"
},
"AccessGrantsLocationId": "default",
"AccessGrantsLocationConfiguration": {
"S3SubPrefix": "myprefix/*"
},
"Permission": "READ",
"GrantScope": "s3://myprefix/*"
}
```

# 使用者背景工作階段
<a name="user-background-sessions"></a>

使用者背景工作階段可讓長時間執行的分析和機器學習工作負載繼續進行，即使使用者已從筆記本界面登出也一樣。從 EMR on EC2 7.11 版開始，此功能可透過 EMR-EC2 的受信任身分傳播功能使用。下列各節說明使用者背景工作階段的組態選項和行為。

**注意**  
使用者背景工作階段設定只會影響透過 SageMaker Unified Studio 啟動的 Spark 工作負載。此設定的變更會套用至新的 Livy 工作階段 - 現有的作用中工作階段不會受到影響。

## 設定使用者背景工作階段
<a name="w2aac30c29c15b7"></a>

使用者背景工作階段必須在兩個層級啟用，才能正常運作：

1. **IAM Identity Center 執行個體層級** （由 IdC 管理員設定）

1. **EMR 叢集層級** （由 EMR 叢集管理員設定）

### 啟用 Amazon EMR 的使用者背景工作階段
<a name="w2aac30c29c15b7b7"></a>

若要啟用 的使用者背景工作階段，您必須在建立 EMR 安全組態`identityCenterConfiguration`時，在 `true`中將 `userBackgroundSessionsEnabled` 參數設定為 。

**先決條件：**
+ 用於建立或更新 EMR 安全組態的 IAM 角色需要 `sso:PutApplicationSessionConfiguration`許可。此許可會啟用 Amazon EMR 受管 IAM Identity Center 應用程式的使用者背景工作階段。
+ 為 IAM Identity Center 建立 IAM 角色
  + 若要將 Amazon EMR 與 IAM Identity Center 整合，請建立 IAM 角色，從 EMR 叢集向 IAM Identity Center 進行身分驗證。Amazon EMR 使用 SigV4 登入資料將 IAM Identity Center 身分轉送至下游服務，例如 AWS Lake Formation。您的角色也應該具備呼叫下游服務所需的許可。
  + 為[已啟用 IAM Identity Center 的 EMR 叢集設定 Lake Formation](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-idc-lf.html)。如需必要的角色許可，請參閱：[建立 Identity Center 的 IAM 角色。](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-idc-start.html#emr-idc-start-role)
+ 使用 7.11 版或更新版本啟動 EMR 叢集，並啟用受信任身分傳播。

**步驟 1 - 建立 Identity Center UserBackgroundSession 啟用的 EMR 安全組態**

使用者需要`EnableUserBackgroundSession`**將旗標設定為 `true` **，這將允許 EMR 服務在 EMR 受管 IDC 應用程式層級啟用 UserBackgourndSession。如果此旗標設定為`false`或未設定，EMR 預設會停用 IDC UserBackgroundSession。

**使用 的範例 AWS CLI：**

```
aws emr create-security-configuration --name "idc-userBackgroundSession-enabled-secConfig" \
--region AWS_REGION  \
--security-configuration ' \
{ 
	"AuthenticationConfiguration":{
		"IdentityCenterConfiguration":{
		"EnableIdentityCenter":true,
		"IdentityCenterInstanceARN": "arn:aws:sso:::instance/ssoins-123xxxxxxxxxx789",
		"IdentityCenterApplicationAssigmentRequired": false,
		"EnableUserBackgroundSession": true,
		"IAMRoleForEMRIdentityCenterApplicationARN": "arn:aws:iam::12345678912:role/YOUR_ROLE"
		}
	},\
	"AuthorizationConfiguration": {
	"IAMConfiguration": {
		"EnableApplicationScopedIAMRole": true,
		"ApplicationScopedIAMRoleConfiguration": {
		"PropagateSourceIdentity": true
		}
	},\
	"LakeFormationConfiguration": {
		"AuthorizedSessionTagValue": "Amazon EMR"
	}
	},\
	"EncryptionConfiguration": {
		"EnableInTransitEncryption": true,
		"EnableAtRestEncryption": false,
		"InTransitEncryptionConfiguration": {
			"TLSCertificateConfiguration": {
				"CertificateProviderType": "PEM",
							"S3Object": "s3://amzn-s3-demo-bucket/cert/my-certs.zip"
			}
		}
	}
}'
```

** 步驟 2 - 建立和啟動啟用 Identity Center 的叢集**

 現在，您已設定使用 Identity Center 執行身分驗證的 IAM 角色，並已建立已啟用 Identity Center 的 Amazon EMR 安全組態，您可以建立和啟動身分感知叢集。如需使用所需的安全組態啟動叢集的步驟，請參閱指定 Amazon EMR 叢集的安全組態。

### 組態矩陣
<a name="security-trusted-prop-user-background-matrix"></a>

使用者背景工作階段行為取決於 EMR-EC2 設定和 IAM Identity Center 執行個體層級設定：


**使用者背景工作階段組態矩陣**  

| IAM Identity Center userBackgroundSession 已啟用 | Amazon EMR userBackgroundSessionsEnabled | Behavior (行為) | 
| --- | --- | --- | 
| 是 | TRUE | 使用者背景工作階段已啟用 | 
| 是 | FALSE | 工作階段會隨著使用者登出而過期 | 
| 否 | TRUE | 工作階段會隨著使用者登出而過期 | 
| 否 | FALSE | 工作階段會隨著使用者登出而過期 | 

### 預設使用者背景工作階段持續時間
<a name="security-trusted-prop-user-background-duration"></a>

根據預設，所有使用者背景工作階段在 IAM Identity Center 中的持續時間限制為 7 天。管理員可以在 IAM Identity Center 主控台中修改此持續時間。此設定適用於 IAM Identity Center 執行個體層級，影響該執行個體內所有支援的 IAM Identity Center 應用程式。
+ 持續時間可以設定為任何值，從 15 分鐘到 90 天。
+ 此設定是在 IAM Identity Center 主控台的設定 → **身分驗證** → **設定**下**進行設定** （請參閱非互動式任務一節）

### 停用使用者背景工作階段的影響
<a name="security-trusted-prop-user-background-disabling"></a>

在 IAM Identity Center 中停用使用者背景工作階段時：

現有的 Livy 工作階段  
+ 如果使用者背景工作階段已啟用，則繼續執行而不會中斷。這些工作階段將繼續使用其現有的背景工作階段字符，直到其自然終止或明確停止為止。

新的 Livy 工作階段  
+ 將使用標準信任的身分傳播流程，並在使用者登出或其互動式工作階段過期時終止 （例如關閉 Amazon SageMaker Unified Studio JupyterLab 筆記本時）。

### 變更使用者背景工作階段持續時間
<a name="security-trusted-prop-user-background-changing-duration"></a>

在 IAM Identity Center 中修改使用者背景工作階段的持續時間設定時：

現有的 Livy 工作階段  
+ 繼續執行與啟動時相同的背景工作階段持續時間。

新的 Livy 工作階段  
+ 將為背景工作階段使用新的工作階段持續時間。

### 考量事項
<a name="security-trusted-prop-user-background-considerations"></a>

#### 功能可用性
<a name="prop-user-background-additional-feature-availability"></a>

Amazon EMR 的使用者背景工作階段可用於：
+ 僅限 Spark 引擎 （不支援 Hive 引擎）
+ 僅限 Livy 互動式工作階段 （不支援批次任務和串流任務）
+ Amazon EMR 發行標籤 7.11 及更新版本。使用 EMR 7.11 版，您需要安裝引導操作指令碼，以在建立叢集時啟用使用者背景工作階段。如需其他詳細資訊，請聯絡 AWS Support。
**注意**  
如果您使用的是 SageMaker Unified Studio 佈建叢集，則不需要引導操作指令碼即可使用此功能。

#### 成本影響
<a name="prop-user-background-additional-data-persistence-cost"></a>
+ 即使使用者結束其 Amazon SageMaker Unified Studio JupyterLab 工作階段，任務仍會繼續執行至完成，並在整個執行期間產生費用。
+ 監控您的作用中背景工作階段，以避免忘記或捨棄的工作階段產生不必要的成本。

#### Livy 工作階段終止條件
<a name="security-trusted-prop-user-background-considerations-session"></a>

使用使用者背景工作階段時，Livy 工作階段會繼續執行，直到發生下列其中一種情況：
+ 使用者背景工作階段過期 （根據 IdC 組態，最多 90 天）。
+ 管理員會手動撤銷使用者背景工作階段。
+ Livy 工作階段達到閒置逾時 （預設值：上次執行陳述式後 8 小時）。
+ 使用者明確停止或重新啟動筆記本核心。

# Amazon EMR 與 Identity Center 整合的考量事項和限制
<a name="emr-idc-considerations"></a>

將 IAM Identity Center 與 Amazon EMR 搭配使用時，請考量以下幾點：
+ Amazon EMR 6.15.0 及更高版本支援透過 Identity Center 的受信任身分傳播，且僅適用於 Apache Spark。此外，Amazon EMR 7.8.0 及更高版本支援使用 EMR 執行期角色的透過 Identity Center 的受信任身分傳播功能，且僅適用於 Apache Spark。
+ 若要啟用具有信任身分傳播的 EMR 叢集，您必須使用 AWS CLI 來建立已啟用信任身分傳播的安全組態，並在啟動叢集時使用該安全組態。如需詳細資訊，請參閱[建立已啟用 Identity Center 的安全組態](emr-idc-start.md#emr-idc-start-securityconfig)。
+ 使用受信任身分傳播 AWS Lake Formation 的精細存取控制適用於 EMR 7.2.0 版和更新版本的 Amazon EMR 叢集。在 EMR 6.15.0 和 7.1.0 版之間，只有以 AWS Lake Formation 為基礎的資料表層級存取控制可用。
+ 對於使用受信任身分傳播的 Amazon EMR 叢集，支援以 Lake Formation with Apache Spark 為基礎的存取控制的操作包括 SELECT、ALTER TABLE、INSERT INTO 和 DROP TABLE。
+  使用 的精細存取控制若使用信任的身分傳播 AWS Lake Formation ，將需要透過新增 EMR 受管 IAM Identity 應用程式 Arn 作為授權目標來更新 Lake Formation Identity Center 組態。您可以呼叫 EMR `describe-security-configure` API 並尋找欄位 來尋找 Amazon EMR 受管 IAM Identity 應用程式 ARN`IdCApplicationARN`。更多詳細資訊：[更新如何使用 IAM Identity Center 組態設定 Lake Formation 的 IAM Identity Center 整合](https://docs.aws.amazon.com/lake-formation/latest/dg/update-lf-identity-center-connection.html)。
+  若要使用 使用信任身分傳播 AWS Lake Formation 的精細存取控制，應授予預設資料庫的 Lake Formation 許可給 IAM Identity 使用者。更多詳細資訊：為[啟用 IAM Identity Center 的 EMR 叢集設定 Lake Formation](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-idc-lf.html)。
+ 以下支援使用 Amazon EMR 的受信任身分傳播 AWS 區域：
  + `af-south-1` – 非洲 (開普敦)
  + `ap-east-1` – 亞太區域 (香港)
  + `ap-northeast-1` – 亞太區域 (東京)
  + `ap-northeast-2` – 亞太區域 (首爾)
  + `ap-northeast-3` – 亞太區域 (大阪)
  + `ap-south-1` – 亞太區域 (孟買)
  + `ap-south-2` – 亞太區域 （海德拉巴）
  + `ap-southeast-1` – 亞太區域 (新加坡)
  + `ap-southeast-2` – 亞太區域 (雪梨)
  + `ap-southeast-3` – 亞太區域 (雅加達)
  + `ap-southeast-4` – 亞太區域 （墨爾本）
  + `ca-central-1` – 加拿大 (中部)
  + `eu-central-1` – 歐洲 (法蘭克福)
  + `eu-central-2` – 歐洲 (蘇黎世)
  + `eu-north-1` – 歐洲 (斯德哥爾摩)
  + `eu-south-1` – 歐洲 (米蘭)
  + `eu-south-2` – 歐洲 （西班牙）
  + `eu-west-1` – 歐洲 (愛爾蘭)
  + `eu-west-2` – 歐洲 (倫敦)
  + `eu-west-3` – 歐洲 (巴黎)
  + `il-central-1` – 以色列 （特拉維夫）
  + `me-central-1` – 中東 （阿拉伯聯合大公國）
  + `me-south-1` – 中東 (巴林)
  + `sa-east-1` – 南美洲 (聖保羅)
  + `us-east-1` – 美國東部 (維吉尼亞北部)
  + `us-east-2` – 美國東部 (俄亥俄)
  + `us-west-1` – 美國西部 (加利佛尼亞北部)
  + `us-west-2` – 美國西部 (奧勒岡)