Skip to content

S3Presigner not considering @ServiceConnection endpoint #1289

@i96751414

Description

@i96751414

Hi!

Considering the below code:

@Bean
@ConditionalOnMissingBean
S3Presigner s3Presigner(S3Properties properties, AwsProperties awsProperties,
AwsCredentialsProvider credentialsProvider, AwsRegionProvider regionProvider,
ObjectProvider<AwsConnectionDetails> connectionDetails) {
S3Presigner.Builder builder = S3Presigner.builder().serviceConfiguration(properties.toS3Configuration())
.credentialsProvider(credentialsProvider).region(AwsClientBuilderConfigurer.resolveRegion(properties,
connectionDetails.getIfAvailable(), regionProvider));
if (properties.getEndpoint() != null) {
builder.endpointOverride(properties.getEndpoint());
}
else if (awsProperties.getEndpoint() != null) {
builder.endpointOverride(awsProperties.getEndpoint());
}
Optional.ofNullable(awsProperties.getFipsEnabled()).ifPresent(builder::fipsEnabled);
Optional.ofNullable(awsProperties.getDualstackEnabled()).ifPresent(builder::dualstackEnabled);
return builder.build();
}

It seems S3Presigner is not being built considering the endpoint coming from ObjectProvider<AwsConnectionDetails> connectionDetails. As such, using @ServiceConnection is not possible as the endpoint is not set accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions