Skip to content
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(storage): update AWSS3StoragePlugin to support multiple buckets #2895

Conversation

phantumcode
Copy link
Contributor

@phantumcode phantumcode commented Aug 14, 2024

Multi-bucket support part 1

  • PR title and description conform to Pull Request guidelines.

Issue #, if available:

Description of changes:
This the first part of a series of changes/pull request to support multi-bucket in the S3 Storage Plugin. The series of changes will be reviewed and merged into a feature branch and combined into a single pull request to be reviewed and merged into main branch.

Changes in this pull request includes:

  • Update AmplifyOutputsData to support multi-bucket configuration
  • Add new data structures and update StorageOption to specify S3 bucket
  • Update AWSS3StoragePlugin to support interfacing with unique bucket/region by creating and maintaining multiple AWSS3StorageService instances. Creating multiple AWSS3StorageService at the plugin level is the least invasive change to support multiple buckets/regions; the alternative is to create and maintain multiple S3Client at the operation layer and result in updating every operations in the Storage plugin.
  • Update getUrl API to support multiple buckets. The rest of the Storage plugin API will be updated in subsequent pull requests.
  • Added unit tests to support new behaviors

Integration tests will be added in a separate pull request.

How did you test these changes?

  • verified via unit tests and manual testing

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@phantumcode phantumcode requested review from a team as code owners August 14, 2024 15:25
@phantumcode phantumcode changed the base branch from main to feature/storage_multi-bucket_support August 14, 2024 15:26
Copy link
Member

@tylerjroach tylerjroach left a comment

Choose a reason for hiding this comment

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

There are a few options types in package com.amplifyframework.storage.options that still need updated.

Main concern at the moment is the storage service lookup. I may have additional comments on the AWSS3StoragePlugin once the changes are considered.

If at all possible, can you try to revert the unnecessary formatting changes so its easier to see what has changed due to feature implementation.

@phantumcode
Copy link
Contributor Author

I've resolved the review comments. I've intentionally excluded the other option types in package com.amplifyframework.storage.options to reduce the scope of this review and focus on the service lookup behavior. Once this pull request is reviewed and approved, the other option types will be updated in a separate pull request.

Copy link
Member

@tylerjroach tylerjroach left a comment

Choose a reason for hiding this comment

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

Thanks for addressing. I was not aware about bucket names being unique regardless of region

@phantumcode phantumcode merged commit 9956d53 into feature/storage_multi-bucket_support Aug 15, 2024
@phantumcode phantumcode deleted the phantum/storage_multiple_services branch August 15, 2024 20:18
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.

3 participants