選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

使用 的 Amazon EMR on EKS 範例 AWS CLI - AWS SDK 程式碼範例

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 AWS SDK 範例

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

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 AWS SDK 範例

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

使用 的 Amazon EMR on EKS 範例 AWS CLI

下列程式碼範例示範如何使用 AWS Command Line Interface 搭配 Amazon EMR on EKS 來執行動作和實作常見案例。

Actions 是大型程式的程式碼摘錄,必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數,但您可以在其相關情境中查看內容中的動作。

每個範例都包含完整原始程式碼的連結,您可以在其中找到如何在內容中設定和執行程式碼的指示。

主題

動作

下列程式碼範例示範如何使用 update-role-trust-policy

AWS CLI

更新要與 Amazon EMR on EKS 搭配使用之 IAM 角色的信任政策

此範例命令會更新名為 example_iam_role 之角色的信任政策,以便與 Amazon EMR on EKS 搭配 example_namespace 命名空間搭配使用,該命名為 example_cluster 的 EKS 叢集。

命令:

aws emr-containers update-role-trust-policy \ --cluster example_cluster \ --namespace example_namespace \ --role-name example_iam_role

輸出:

If the trust policy has already been updated, then the output will be: Trust policy statement already exists for role example_iam_role. No changes were made! If the trust policy has not been updated yet, then the output will be: Successfully updated trust policy of role example_iam_role.

下列程式碼範例示範如何使用 update-role-trust-policy

AWS CLI

更新要與 Amazon EMR on EKS 搭配使用之 IAM 角色的信任政策

此範例命令會更新名為 example_iam_role 之角色的信任政策,以便與 Amazon EMR on EKS 搭配 example_namespace 命名空間搭配使用,該命名為 example_cluster 的 EKS 叢集。

命令:

aws emr-containers update-role-trust-policy \ --cluster example_cluster \ --namespace example_namespace \ --role-name example_iam_role

輸出:

If the trust policy has already been updated, then the output will be: Trust policy statement already exists for role example_iam_role. No changes were made! If the trust policy has not been updated yet, then the output will be: Successfully updated trust policy of role example_iam_role.

下一個主題:

EventBridge

上一個主題:

Amazon EMR
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。