-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
And event source mapping endpoints and SQS trigger support #2376
Conversation
1bae59e
to
ccceb70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the requested change, and this will be good to go.
moto/awslambda/models.py
Outdated
# optional | ||
self.batch_size = spec.get('BatchSize', 100) | ||
self.starting_position = spec.get('StartingPosition', 'TRIM_HORIZON') | ||
self.batch_size = spec.get('BatchSize', 10) # TODO: Add source type-specific defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BatchSize is currently set to the following https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html:
Amazon Kinesis - Default 100. Max 10,000.
Amazon DynamoDB Streams - Default 100. Max 1,000.
Amazon Simple Queue Service - Default 10. Max 10.
Otherwise, this field should be blank (add a check if it's Kinesis, DynamoDB, or SQS)
Made those changes. |
def get_configuration(self): | ||
return { | ||
'UUID': self.uuid, | ||
'BatchSize': self.batch_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm if BatchSize
is returned for non SQS/Kinesis/DynamoDB events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an example event type you're talking about? Per docs, Kinesis/SQS/DynamoDB are the only valid event source types for Lambda: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.create_event_source_mapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry -- you are right! I was getting confused by how the AWS console presents this (since you can have S3, SNS, Cloudwatch Events, etc.) invoking lambdas.
In that case, should we just assume that if it's not DynamoDB/SQS/Kinesis that it's invalid?
@rwestergren Is this good to merge? |
I think we're good to go - thanks! |
Can this be released, so that those building with specified version numbers can pull it that way? Thanks! |
@thetumper - this is currently available as a dev release. @mikegrima would have more insight into the next stable. |
I actually don't -- that would be determined by @spulec |
@rwestergren Thanks! Didn't see the dev versions, prior to you linking that. The github releases don't contain everything that's shown on pypi.org? |
No description provided.