IAM¶
Each Lambda has a dedicated IAM role with least-privilege policies.
IngestFunction Role¶
Typically needs:
s3:PutObjectto raw bucketdynamodb:PutItem/dynamodb:UpdateItem(andDescribeTable) for Events/Dedupe tables- CloudWatch Logs permissions (basic execution role)
- (optional) X-Ray write
ReplayFunction Role¶
Typically needs:
dynamodb:Queryon EventsTable (+ index/*)sqs:SendMessageto ReplayQueue- CloudWatch Logs permissions
- (optional) X-Ray write
ProcessorFunction Role (optional)¶
Typically needs:
s3:GetObjectfrom raw bucketdynamodb:PutItemto AggregatesTablesqs:ReceiveMessage/DeleteMessagevia event source mapping- CloudWatch Logs permissions
- (optional) X-Ray write
Guidance¶
- Avoid wildcard actions/resources unless unavoidable.
- Prefer table ARN +
/index/*where needed. - Treat these roles as the "security contract" for the repo.