Repository navigation
Migrate from AWS SDK for Go v1 to v2 - #3
Merged
Merged
Conversation
aws-sdk-go v1 is end-of-life. Move dynamodb/ses clients, attribute values, and error handling to aws-sdk-go-v2, including the mockable client interfaces and the full test suite. Behavior is unchanged; all existing tests pass.
This file contains hidden or 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
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.
What
Migrates the Lambda from
aws-sdk-go(v1) toaws-sdk-go-v2.AWS SDK for Go v1 is end-of-life; v2 is the supported SDK and was flagged as deprecated by
go mod tidy.Changes
session.New()+dynamodb.New/ses.New→config.LoadDefaultConfig+dynamodb.NewFromConfig/ses.NewFromConfig.*WithContextmethods → the v2GetItem/UpdateItem/DeleteItem/SendEmail(context is the first parameter).*dynamodb.AttributeValue→types.AttributeValue(AttributeValueMemberS/MemberBOOL);ExpressionAttributeNamesis nowmap[string]string.awserrcode switches (the codes don't exist in v2) in favor of plain logging; the error is still returned to the caller, so behavior is unchanged.DynamoDBAPI/SESAPIinterfaces now match the v2 client method signatures;main_test.goupdated to v2 types. No*ifacepackages (v2 has none).Verification
CI runs
go build,go vet, andgo teston this PR. Locally all pass, including the fullTestLambdaHandlermatrix — behavior is unchanged.