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

Create a custom provider for AwsRegionProviderChain #100

Closed
5 tasks done
ptirador opened this issue Oct 30, 2020 · 2 comments · Fixed by #182
Closed
5 tasks done

Create a custom provider for AwsRegionProviderChain #100

ptirador opened this issue Oct 30, 2020 · 2 comments · Fixed by #182
Labels
hacktoberfest Pre-selected issues for Hacktoberfest help wanted Extra attention is needed
Milestone

Comments

@ptirador
Copy link
Contributor

ptirador commented Oct 30, 2020

Task Description

The S3Factory class manages the build of a new Amazon S3 instance, which needs a region. This is provided by getting it from a properties file, and, in the case there's no property defined, the region is obtained by using a default region provider chain.

As specified in this Pull Request discussion, although it's highly unlikely, there could be a different region provider chain needed by a consumer of the API (this would have to be custom, as the SDK only has Default). Might want to provide a customization option for this, rather than hard coding new DefaultAwsRegionProviderChain.

Tasks

The following tasks will need to be carried out:

  • Create a custom provider class org.carlspring.cloud.storage.s3fs.S3AwsRegionProviderChain.
  • This class must extend from software.amazon.awssdk.regions.providers.AwsRegionProviderChain.
  • This class must have a constructor which will call its parent constructor to define a list of region providers, which will be (for the moment), in this order:
    software.amazon.awssdk.regions.providers.SystemSettingsRegionProvider
    software.amazon.awssdk.regions.providers.AwsProfileRegionProvider
  • getRegion method should not be overridden, so method from parent will be used.
  • Use this new provider chain in org.carlspring.cloud.storage.s3fs.S3Factory class, getRegionmethod, by replacing the DefaultAwsProviderChain with the new one.

Task Relationships

This task:

Useful Links

Help

@carlspring carlspring added hacktoberfest Pre-selected issues for Hacktoberfest help wanted Extra attention is needed labels Oct 30, 2020
@pyashwanthkumar
Copy link

where should the class AwsRegionProviderChain be created? the only method of this class would be to get the region from user and setting it?

@ptirador
Copy link
Contributor Author

ptirador commented Dec 13, 2020

@pyashwanthkumar I've updated the issue description with a more specific tasks list. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Pre-selected issues for Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants