-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: Add remote invoke implementation for Kinesis stream service for put_record API #6063
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 tasks
mndeveci
reviewed
Oct 10, 2023
mndeveci
approved these changes
Oct 12, 2023
hawflau
approved these changes
Oct 12, 2023
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.
LGTM. just one minor typo
Co-authored-by: Wing Fung Lau <[email protected]>
moelasmar
pushed a commit
to moelasmar/aws-sam-cli
that referenced
this pull request
Oct 22, 2023
… put_record API (aws#6063) * Add mypy-boto3 stubs for kinesis * Add remote invoke implementation for kinesis service * unit tests * fix typo in comment Co-authored-by: Wing Fung Lau <[email protected]> --------- Co-authored-by: Wing Fung Lau <[email protected]>
This was referenced Jan 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue(s) does this change fix?
N/A
Why is this change necessary?
This PR adds the implementation for remote invoke support for Kinesis stream service. The boto3 API put_record is called when sam remote invoke is run to put a record to the provided kinesis stream name using event or event-file.
How does it address the issue?
Data
of the record which is a required field can be provided usingevent
orevent-file
parameters which will get encoded as base64 and put into Kinesis stream. If no event or event-file is provided,{}
is used asData
for putting a record. The event is loaded using json before passing to boto3 API and the event-file is read and directly passed to boto3 API.PartitionKey
is a required field for boto3 API and so it is randomly generated if not provided as input. This is just used to determine which Shard does the record get added to using a MD5 hash function.ExplicitHashKey
,SequenceNumberForOrdering
, andStreamARN
can be provided as strings using the--parameter
fieldUse cases:
sam remote invoke KinesisStreamLogicalId --stack-name sam-app --event '{"hello": "world", "foo": 1, "bar": {}}'
: Puts a record with provided event as data to theKinesisStreamLogicalId
Kinesis stream.sam remote invoke arn:aws:kinesis:us-east-1:12345678910:stream/kinesis-stream-name --event "hello world"
: Kinesis stream Arn used as resource-id to put a recordsam remote invoke kinesis-stream-name --event "hello world" --output json
: Kinesis stream name used as resource-id to put a recordWhat side effects does this change have?
No side effects.
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make pr
passesmake update-reproducible-reqs
if dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.