Skip to content

Create a custom provider for AwsRegionProviderChain #100

@ptirador

Description

@ptirador

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    hacktoberfestPre-selected issues for Hacktoberfesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions