BM: Baca dalam Bahasa Melayu
World A1: Renting a Unit
The AWS CLI and profiles
You will learn: how the aws command signs in, and how profiles keep accounts apart.
Checked with AWS 2026-11 on 1 Nov 2026
The problem
Kancil has two accounts: a practice one and the real shop. He types a delete command. How does aws know which account he means?
Pick one answer.
Watch
The first habit: ask “who am I?” Read the Arn line. This is the user DevAdmin, in account 123456789012.
Watch
A profile: A named set of settings for the aws command: which account, which role, which Region. is a named set of settings in ~/.aws/config. Tap the line that picks the account.
Tap the account line.
0 of 1 found
Try it
Build the command that signs in with that profile.
Tap the pieces in the right order.
Hint
Tool, then sso login, then the profile.Watch
The browser asks you to approve, with MFA. The CLI then keeps short-lived badges in a cache. No key is saved in a file.
Predict
This terminal has AWS_PROFILE=shop set. Kancil runs a command with --profile practice. Which account does it use?
Pick one answer.
Check
Some files are settings. Some are secrets. Sort them.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now sign in with a profile and check who you are.
Go deeper (optional)
Not using Identity Center? Since AWS CLI 2.32.0, aws login uses your console sign-in instead. It refreshes short-lived badges for up to 12 hours. No access keys needed.
Real rep (no resources, no cost; budget alarm already set):
Real mission
aws --versionaws configure ssoaws loginaws sts get-caller-identityaws configure list-profiles
0 of 6 steps done · Your ticks are saved.
Bahasa Melayu
Kancil ada dua akaun: satu untuk latihan dan satu untuk kedai sebenar. Dia taip arahan padam. Macam mana aws tahu akaun mana yang dimaksudkan?
Tabiat pertama: tanya “saya siapa?” Baca baris Arn. Ini pengguna DevAdmin, dalam akaun 123456789012.
Profil ialah set tetapan bernama dalam ~/.aws/config. Ketik baris yang pilih akaun.
Bina arahan yang log masuk dengan profil itu.
Pelayar minta anda luluskan, dengan MFA. CLI kemudian simpan pas jangka pendek dalam cache. Tiada kunci disimpan dalam fail.
Terminal ini ada AWS_PROFILE=shop. Kancil jalankan arahan dengan --profile practice. Akaun mana yang digunakan?
Ada fail yang berisi tetapan. Ada yang berisi rahsia. Susun mereka.
Kini anda boleh log masuk dengan profil dan semak siapa anda.
You finished this before. Practice is always welcome!
Official docs: Install the AWS CLI · IAM Identity Center with the AWS CLI · aws login (console credentials) · aws sts get-caller-identity · Environment variables (AWS_PROFILE)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?