Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWIldcard in `on_s3_event objectcreated` deploys a non-working trigger #1209
Comments
|
Can you say what specifically isn't working? One thing I noticed is that the prefix has With that change, everything is working when I try it out: from chalice import Chalice
app = Chalice(app_name='s3-events-test')
app.debug = True
@app.on_s3_event(bucket='dfasdjfhasjhasdf', events=['s3:ObjectCreated:*'],
prefix='uploads/', suffix='.txt')
def index(event):
app.log.debug('Handler called.')
app.log.debug(event.key)
Then verify the handler was called:
It might be nice to add some warnings if the prefix/suffix has |
|
Thank you James, you were right, using the * wildcard does not work with Chalice while it is supported by the AWS Management Console. Dropping it solves the issue, you can close this now. The idea of the lint command or to support wildcards might be an interesting feature, I'll let you decide on that Thanks! |
|
Closing out old issue, a note was added in the docs about wildcards in #1210. |
Creating a trigger with
@app.on_s3_event(bucket=S3_BUCKET, events=['s3:ObjectCreated:*'], prefix='uploads/*', suffix='.txt')generates a trigger in a Lambda which does not work. in particular, the problem should be related to the Notification, since from time to time
chalice deploywould generate aPutBucketNotificationConfiguration operation: Unable to validate the following destination configurations- when it creates it succesfully, it generates a strangeNotificationName, for example:Notification name: NWRhNTM3MDItNWI5YS00OTEyLWJkNDgtZGI2ZWNiNDk4ZDljwhile it should be
Notification name: b67905c9-6073-4fca-9c22-30c45100f558.It can either be a Chalice problem or a Lambda problem. Haven't tested s3_event source before, so i can't know for sure.