Skip to content

Migrate from AWS SDK for Go v1 to v2 - #3

Merged
victoriadrake merged 1 commit into
masterfrom
aws-sdk-v2
Jun 20, 2026
Merged

victoriadrake merged 1 commit into
masterfrom
aws-sdk-v2

Conversation

@victoriadrake

Copy link
Copy Markdown
Owner

What

Migrates the Lambda from aws-sdk-go (v1) to aws-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

  • Clients: session.New() + dynamodb.New/ses.New → config.LoadDefaultConfig + dynamodb.NewFromConfig/ses.NewFromConfig.
  • Calls: *WithContext methods → the v2 GetItem/UpdateItem/DeleteItem/SendEmail (context is the first parameter).
  • Attribute values: *dynamodb.AttributeValue → types.AttributeValue (AttributeValueMemberS/MemberBOOL); ExpressionAttributeNames is now map[string]string.
  • Errors: dropped the v1 awserr code 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.
  • Mocks/tests: the mockable DynamoDBAPI/SESAPI interfaces now match the v2 client method signatures; main_test.go updated to v2 types. No *iface packages (v2 has none).

Verification

CI runs go build, go vet, and go test on this PR. Locally all pass, including the full TestLambdaHandler matrix — behavior is unchanged.

Note: deploys still package the same binary; no infra/permission changes are required.

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.
@victoriadrake
victoriadrake merged commit 70de976 into master Jun 20, 2026
1 check passed
@victoriadrake
victoriadrake deleted the aws-sdk-v2 branch June 20, 2026 01:13
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.

1 participant