Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Added the ability to inject a custom AmazonS3 client #3699

Merged
merged 2 commits into from Jul 23, 2023

Conversation

PavelShahoiko
Copy link

@PavelShahoiko PavelShahoiko commented Jul 19, 2023

Pull Request type

  • Bugfix
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

I've added ability to initialize AmazonS3 Client as a separate Bean.

If someone use a S3 compatible storage (e.g. Pure Storage), they will be able to initialize AmazonS3 in their @configuration like in the example below and this client will be used for initializing S3PayloadStorage

Disable default client:

conductor.external-payload-storage.s3.use_default_client: false

Initialisation my own client:

    @Bean
    public AmazonS3 amazonS3Client(S3StorageProperties s3StorageProperties) {
        AWSCredentials credentials = new BasicAWSCredentials(s3StorageProperties.getAccessKey(), s3StorageProperties.getSecretKey());

        return AmazonS3ClientBuilder
            .standard()
            .withCredentials(new AWSStaticCredentialsProvider(credentials))
            .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3StorageProperties.getEndpoint(), s3StorageProperties.getRegion()))
            .withPathStyleAccessEnabled(s3StorageProperties.getPathStyleEnabled())
            .withClientConfiguration(new ClientConfiguration().withProtocol(Protocol.HTTPS))
            .build();
    }

Discussion: #3693

Alternatives considered

Describe alternative implementation you have considered

@v1r3n v1r3n merged commit 728925f into Netflix:main Jul 23, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants