StudyToCert

All certifications / Developer Associate / Lessons

AWS Certified Developer – Associate DVA-C02 · Domain 2: Security

Resource-based policies: Lambda permissions for S3/SNS/API Gateway, S3 bucket policies, KMS key policies

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

Most permissions in AWS are written on the person or program: 'this role may do these things'. Some permissions are written on the thing being used instead: 'these callers may use me'. That second kind is a resource-based policy. When S3 or SNS wants to start your Lambda function, it does not borrow your function's role, so the function itself must say 'S3 may call me'. An S3 bucket can carry rules like 'only allow HTTPS'. An encryption key in KMS always carries its own rules, and if those rules do not mention you, even an administrator is turned away. Think of a private club: your ID card matters, but so does the guest list at the door.

At Juniper Health Analytics, Sam wires up a new feature before lunch: when a lab report lands in the uploads bucket, a Lambda function should extract the results. He created the trigger with a CloudFormation template, the execution role has every S3 permission he can think of, and the function works perfectly when he tests it by hand. Yet files keep arriving and the function's invocation count stays at zero. Down the hall, Rosa reports a different puzzle: her administrator account cannot decrypt data with a KMS key a contractor created last year. Both of them have generous IAM permissions. What is missing?

Identity-based policies are attached to a user or role and say what that identity can do. Resource-based policies are attached to a resource and say who can access it. The visible difference is the Principal element: a resource-based policy names who is allowed, which can be an AWS account, a specific role, or an AWS service such as s3.amazonaws.com. Many integration errors on the DVA-C02 exam come down to a missing resource-based policy, so whenever one AWS service needs to act on another, ask which side holds the permission.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 7 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study Developer Associate for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the Developer Associate study plan