Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add SourceAccount on S3 Event #2099

Open
LiamNguyenn opened this issue Mar 13, 2024 · 0 comments
Open

Feature Request: Add SourceAccount on S3 Event #2099

LiamNguyenn opened this issue Mar 13, 2024 · 0 comments

Comments

@LiamNguyenn
Copy link

LiamNguyenn commented Mar 13, 2024

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',
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant