BM: Baca dalam Bahasa Melayu
World A2: Keys & Guards
Policies in JSON
You will learn: to read a policy line by line, and to change one line safely.
Checked with AWS 2026-11 on 1 Nov 2026
The problem
Aina’s key card says: “Allow: read the files on the menu shelf.” She tries to change today’s menu. What happens?
Pick one answer.
Watch
That key card is a policy: A key card written in JSON: Effect (Allow or Deny), Action (what) and Resource (on which thing)., written in JSON. Tap the line that says what Aina may do.
Tap the line with the action.
0 of 1 found
Watch
Each statement answers three questions. Allow or Deny? Which action? On which thing? Sort these values.
Drag a card into a box. Or tap the card, then tap the box.
Try it
Aina must also save today’s menu. Change the pink line so AWS says Allow. Don’t open every S3 action.
Change the pink line so AWS says Allow.
The request
- Who
- Aina (IAM user)
arn:aws:iam::111122223333:user/aina - Wants to
s3:PutObject- On
arn:aws:s3:::kedai-menu/today.json
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Resource": "arn:aws:s3:::kedai-menu/*" } ]}Hint
A list in square brackets:["s3:GetObject", "s3:PutObject"].Check
A star is a wildcard. Which actions does s3:Get* allow?
Pick one answer.
Predict
Now Aina opens a file in a different bucket, kedai-orders. Her policy only names kedai-menu. Predict.
Read the request and its policies. Will AWS say Allow or Deny?
The request
- Who
- Aina (IAM user)
arn:aws:iam::111122223333:user/aina - Wants to
s3:GetObject- On
arn:aws:s3:::kedai-orders/today.json
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::kedai-menu/*" } ]}You did it!
You can now read a policy’s Effect, Action and Resource, and change one line.
Go deeper (optional)
"Version": "2012-10-17" is the policy language’s version, not today’s date. Always use it.
Action names ignore upper and lower case. Resource ARNs do not: kedai-menu/Today.json and kedai-menu/today.json are two different files.
Bahasa Melayu
Kad kunci Aina berbunyi: “Allow: baca fail di rak menu.” Dia cuba ubah menu hari ini. Apa jadi?
Kad kunci itu ialah polisi (policy), ditulis dalam JSON. Ketik baris yang kata apa Aina boleh buat.
Setiap statement jawab tiga soalan. Allow atau Deny? Tindakan mana? Pada benda mana? Susun nilai-nilai ini.
Aina juga mesti simpan menu hari ini. Ubah baris merah jambu supaya AWS kata Allow. Jangan buka semua tindakan S3.
["s3:GetObject", "s3:PutObject"].Bintang ialah wildcard. Tindakan mana yang s3:Get* benarkan?
Sekarang Aina buka fail dalam bucket lain, kedai-orders. Polisinya hanya sebut kedai-menu. Ramalkan.
Kini anda boleh baca Effect, Action dan Resource sesuatu polisi, dan ubah satu baris.
You finished this before. Practice is always welcome!
Official docs: Policies and permissions in IAM · IAM JSON policy elements · Action element · Resource element
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?