Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan GetInstanceProfile
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanGetInstanceProfile
.
- CLI
-
- AWS CLI
-
Untuk mendapatkan informasi tentang profil instance
get-instance-profile
Perintah berikut mendapatkan informasi tentang profil instance bernamaExampleInstanceProfile
.aws iam get-instance-profile \ --instance-profile-name
ExampleInstanceProfile
Output:
{ "InstanceProfile": { "InstanceProfileId": "AID2MAB8DPLSRHEXAMPLE", "Roles": [ { "AssumeRolePolicyDocument": "<URL-encoded-JSON>", "RoleId": "AIDGPMS9RO4H3FEXAMPLE", "CreateDate": "2013-01-09T06:33:26Z", "RoleName": "Test-Role", "Path": "/", "Arn": "arn:aws:iam::336924118301:role/Test-Role" } ], "CreateDate": "2013-06-12T23:52:02Z", "InstanceProfileName": "ExampleInstanceProfile", "Path": "/", "Arn": "arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile" } }
Untuk informasi lebih lanjut, lihat Menggunakan profil instance dalam AWS Panduan Pengguna IAM.
-
Untuk detail API, lihat GetInstanceProfile
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini mengembalikan rincian profil contoh bernama
ec2instancerole
yang didefinisikan dalam AWS akun saat ini.Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
Output:
Arn : arn:aws:iam::123456789012:instance-profile/ec2instancerole CreateDate : 2/17/2015 2:49:04 PM InstanceProfileId : HH36PTZQJUR32EXAMPLE1 InstanceProfileName : ec2instancerole Path : / Roles : {ec2instancerole}
-
Untuk detail API, lihat GetInstanceProfiledi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini mengembalikan rincian profil contoh bernama
ec2instancerole
yang didefinisikan dalam AWS akun saat ini.Get-IAMInstanceProfile -InstanceProfileName ec2instancerole
Output:
Arn : arn:aws:iam::123456789012:instance-profile/ec2instancerole CreateDate : 2/17/2015 2:49:04 PM InstanceProfileId : HH36PTZQJUR32EXAMPLE1 InstanceProfileName : ec2instancerole Path : / Roles : {ec2instancerole}
-
Untuk detail API, lihat GetInstanceProfiledi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-
Untuk daftar lengkap panduan pengembang AWS SDK dan contoh kode, lihatMenggunakan layanan ini dengan AWS SDK. Topik ini juga mencakup informasi tentang memulai dan detail tentang versi SDK sebelumnya.