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

And event source mapping endpoints and SQS trigger support #2376

Merged
merged 4 commits into from
Aug 22, 2019

Conversation

rwestergren
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Aug 21, 2019

Coverage Status

Coverage increased (+0.1%) to 93.31% when pulling 1efd9ee on rwestergren:event_source_mappings into 94fd5c4 on spulec:master.

Copy link
Collaborator

@mikegrima mikegrima left a 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.

# 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
Copy link
Collaborator

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)

@rwestergren
Copy link
Contributor Author

rwestergren commented Aug 22, 2019

Made those changes.

def get_configuration(self):
return {
'UUID': self.uuid,
'BatchSize': self.batch_size,
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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?

@mikegrima
Copy link
Collaborator

@rwestergren Is this good to merge?

@rwestergren
Copy link
Contributor Author

I think we're good to go - thanks!

@mikegrima mikegrima merged commit 3a5d857 into getmoto:master Aug 22, 2019
@thetumper
Copy link

Can this be released, so that those building with specified version numbers can pull it that way? Thanks!

@rwestergren
Copy link
Contributor Author

@thetumper - this is currently available as a dev release. @mikegrima would have more insight into the next stable.

@mikegrima
Copy link
Collaborator

I actually don't -- that would be determined by @spulec

@thetumper
Copy link

@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?

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

Successfully merging this pull request may close these issues.

4 participants