Feature Request: Add SourceAccount on S3 Event
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
It would be a nice feature if the on_s3_event could receive a param that controls which source account that its pointing to, and this would create X triggers for the specified Lambda. At this time, the only option is to create one trigger by decorator and modify it by hand.
```
@app.on_s3_event(bucket=BUCKET_NAME, source_account="123456789")
def function_name(event: S3Event):
pass
```
the add permission in boto3 lib already support its:
```
response = client.add_permission(
Action='lambda:InvokeFunction',
FunctionName='my-function',
Principal='s3.amazonaws.com',
SourceAccount='123456789012',
SourceArn='arn:aws:s3:::my-bucket-1xpuxmplzrlbh/*',
StatementId='s3',
)
```
Contributor guide
Research direction
Start at the on_s3_event decorator and its S3 trigger and Lambda permission setup; the issue identifies SourceAccount and boto3 add_permission as the relevant entry points. Check how multiple triggers are generated and verify that the requested account is passed through to the resulting permissions and triggers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100