Skip to content

Update s3 java example #391

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

Merged
merged 3 commits into from
Sep 12, 2022
Merged

Update s3 java example #391

merged 3 commits into from
Sep 12, 2022

Conversation

yualexan
Copy link
Contributor

@yualexan yualexan commented Sep 7, 2022

Issue #, if available:
This is part of an ongoing effort to improve the code samples across the Lambda developer guide.

Description of changes:
This pull request updates the s3-java sample to use the latest dependencies, most notably the AWS SDK v2. This change updates all dependencies in build.gradle and pom.xml along with the relevant code. It also generally refactors the code, and adds additional comments in both the code and README to explain more of what the function is doing.

To test these changes, I ran through all 6 of the scripts again from start to finish. All steps succeed, and upon manually checking the resulting scaled down image, the code still does what it's expected to do.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…st notably the AWS SDK for Java 2.x.

- Refactored the Handler and test code to work with version 2.x of the SDK.
- Updated both build.gradle and pom.xml files to use latest dependencies.
- Minor edit to 5-invoke.sh script which was complaining about Invalid base64.
- Tested the tutorial (scripts 1 through 6) end to end and it still works.
…ity and abstraction.

- Pulled out code from main handler into separate private functions.
- Tested the scripts E2E to make sure they're still working.
- Added additional comments in function code to explain steps.
- Updated README with more explanations on what the function is doing, instead of just listing steps.
@yualexan yualexan requested a review from mwunderl September 7, 2022 22:14
Copy link
Member

@mwunderl mwunderl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Gradle 7.5.1 and Java 1.8.0_282 on Ubuntu 20. Works well! Some minor notes.

- Revert changes to 5-invoke.sh script after noting config change
- Update function timeout from 10s -> 30s in CFN stack templates
Copy link
Member

@mwunderl mwunderl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yualexan yualexan merged commit cad20e9 into main Sep 12, 2022
@AWSBen AWSBen deleted the update-s3-java-example branch March 31, 2025 16:37
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.

2 participants