AWS Security ChangesHomeSearch

AWS lambda: Clarify S3 bucket policy vs execution role for self-managed storage

Service: lambda · 2026-10-10 · Documentation medium

File: lambda/latest/dg/configuration-self-managed-storage.md · Type: iam

Summary

Adds explanatory text distinguishing the resource-based S3 bucket policy that grants the Lambda service principal access to a code object from the function's execution role, clarifying that the bucket policy does not grant invoke or other runtime permissions.

Security assessment

The added text documents IAM permission boundaries between a resource-based bucket policy and an execution role, helping users avoid over-granting access. It is security guidance but does not address a specific vulnerability or incident.

Evidence

+This S3 bucket policy is separate from your function's execution role. The bucket policy is a resource-based policy that grants the Lambda service principal (`lambda.amazonaws.com`) permission to retrieve a specific code object so that Lambda can optimize your function. It does not grant permissions to any other principal, and it does not grant permission to invoke your function. Your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html) is a separate IAM identity that Lambda assumes when it runs your function; you grant invoke and other runtime permissions through IAM policies attached to that role. Granting the Lambda service principal access to objects in your bucket does not allow other identities to access those objects or to invoke your functions.

Diff

diff --git a/lambda/latest/dg/configuration-self-managed-storage.md b/lambda/latest/dg/configuration-self-managed-storage.md
index a15422c..bbd2c2b 100644
--- a//lambda/latest/dg/configuration-self-managed-storage.md
+++ b//lambda/latest/dg/configuration-self-managed-storage.md
@@ -88,0 +89,2 @@ To use self-managed S3 code storage, grant the Lambda service principal (`lambda
+This S3 bucket policy is separate from your function's execution role. The bucket policy is a resource-based policy that grants the Lambda service principal (`lambda.amazonaws.com`) permission to retrieve a specific code object so that Lambda can optimize your function. It does not grant permissions to any other principal, and it does not grant permission to invoke your function. Your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html) is a separate IAM identity that Lambda assumes when it runs your function; you grant invoke and other runtime permissions through IAM policies attached to that role. Granting the Lambda service principal access to objects in your bucket does not allow other identities to access those objects or to invoke your functions.
+