AWS 文檔 AWS SDK示例 GitHub 回購中有更多SDK示例
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
搭RemoveRoleFromInstanceProfile
配 AWS SDK或使用 CLI
下列程式碼範例會示範如何使用RemoveRoleFromInstanceProfile
。
- CLI
-
- AWS CLI
-
若要從執行個體設定檔移除角色
下列
remove-role-from-instance-profile
命令會從名為的執行個體設定檔Test-Role
中移除名為的角色ExampleInstanceProfile
。aws iam remove-role-from-instance-profile \ --instance-profile-name
ExampleInstanceProfile
\ --role-nameTest-Role
如需詳細資訊,請參閱使用指南中的AWS IAM使用執行個體設定檔。
-
如需詳API細資訊,請參閱AWS CLI 指令參考RemoveRoleFromInstanceProfile
中的。
-
- PowerShell
-
- 適用的工具 PowerShell
-
範例 1:此範例會刪除名為的EC2執行個體設定檔
MyNewRole
中指定的角色MyNewRole
。在IAM主控台中建立的執行個體設定檔永遠與角色具有相同的名稱,如本範例所示。如果您在API或中建立它們CLI,則它們可以有不同的名稱。Remove-IAMRoleFromInstanceProfile -InstanceProfileName MyNewRole -RoleName MyNewRole -Force
-
如需詳API細資訊,請參閱AWS Tools for PowerShell 指令程RemoveRoleFromInstanceProfile式參考中的。
-
RemoveClientIdFromOpenIdConnectProvider
RemoveUserFromGroup