[英]How can I know the Name of the “IAM role” attached to EC2 using PowerShell from EC2 Instance itself?
I have an EC2 instance (EC2_Windows_2019_Server_Test) which is attached to an "IAM role".我有一个附加到“IAM 角色”的 EC2 实例 (EC2_Windows_2019_Server_Test)。
How can I know the Name of the "IAM role" attached to EC2 using PowerShell from EC2 Instance itself?如何使用 EC2 实例本身的 PowerShell 知道附加到 EC2 的“IAM 角色”的名称?
Thanks to @maafk.感谢@maafk。
$instanceRole = (New-Object System.Net.WebClient).DownloadString("http://169.254.169.254/latest/meta-data/iam/security-credentials/")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.