Skip to content

Migrate Go server from AWS SDK v1 to AWS SDK v2#1488

Merged
aka-bo merged 2 commits intomainfrom
go-server-aws-v2
Sep 3, 2025
Merged

Migrate Go server from AWS SDK v1 to AWS SDK v2#1488
aka-bo merged 2 commits intomainfrom
go-server-aws-v2

Conversation

@aka-bo
Copy link
Copy Markdown
Contributor

@aka-bo aka-bo commented Aug 21, 2025

What's new?

This PR migrates the Go server (server/go) from AWS SDK v1 to AWS SDK v2, completing the modernization of AWS dependencies across the Asherah project. The server now uses the same AWS SDK v2 plugins already available in the appencryption library.

Changes

  • Dependencies: Removed github.com/aws/aws-sdk-go v1.55.7 and added AWS SDK v2 dependencies
  • Configuration: Replaced awssession.Options with config.LoadDefaultConfig pattern
  • Metastore: Updated DynamoDB metastore initialization to use plugins/aws-v2/dynamodb/metastore
  • Imports: Migrated all AWS-related imports to AWS SDK v2 equivalents

Backward Compatibility

All existing server configuration options remain functional:

  • --dynamodb-endpoint
  • --dynamodb-region
  • --dynamodb-table-name
  • --enable-region-suffix

Technical Details

The core changes are in pkg/server/server.go where the NewMetastore function was updated to:

  1. Use config.LoadDefaultConfig instead of awssession.NewSessionWithOptions
  2. Create DynamoDB client with dynamodb.NewFromConfig
  3. Initialize metastore with metastore.NewDynamoDB from the aws-v2 plugin

Error handling patterns and panic recovery behavior are preserved to maintain operational consistency.

Update server/go to use AWS SDK v2 for DynamoDB metastore operations,
eliminating the last aws-sdk-go v1 dependency in the Go server implementation.

- Replace awssession.Options with config.LoadDefaultConfig pattern
- Update DynamoDB metastore initialization to use aws-v2 plugin
- Migrate import statements from aws-sdk-go to aws-sdk-go-v2
- Maintain backward compatibility for all configuration options
- Preserve existing error handling and panic recovery patterns
@aka-bo aka-bo merged commit 03007b9 into main Sep 3, 2025
20 checks passed
@aka-bo aka-bo deleted the go-server-aws-v2 branch September 3, 2025 20:21
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