次のコード例は、Amazon EMR on EKS で AWS Command Line Interface を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。
アクションはより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。
各例には、完全なソースコードへのリンクが含まれており、そこからコードの設定方法と実行方法に関する手順を確認できます。
トピック
アクション
次の例は、update-role-trust-policy
を使用する方法を説明しています。
- AWS CLI
-
Amazon EMR on EKS で使用する IAM ロールの信頼ポリシーを更新するには
このコマンド例では、example_iam_role という名前のロールの信頼ポリシーを更新して、example_cluster という名前の EKS クラスターの example_namespace 名前空間で Amazon EMR on 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.
-
API の詳細については、「AWS CLI コマンドリファレンス」の「UpdateRoleTrustPolicy
」を参照してください。
-