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
Upgrade SDK and test discovery-ec2 credential providers #41732
Upgrade SDK and test discovery-ec2 credential providers #41732
Conversation
Pinging @elastic/es-distributed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we fix the usage of the deprecated new AmazonEC2Client()
constructor in AwsEc2ServiceImpl#buildClient()
too? This is how it was done in S3Service
:
elasticsearch/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java
Lines 139 to 159 in 57823c4
AmazonS3 buildClient(final S3ClientSettings clientSettings) { | |
final AmazonS3ClientBuilder builder = AmazonS3ClientBuilder.standard(); | |
builder.withCredentials(buildCredentials(logger, clientSettings)); | |
builder.withClientConfiguration(buildConfiguration(clientSettings)); | |
final String endpoint = Strings.hasLength(clientSettings.endpoint) ? clientSettings.endpoint : Constants.S3_HOSTNAME; | |
logger.debug("using endpoint [{}]", endpoint); | |
// If the endpoint configuration isn't set on the builder then the default behaviour is to try | |
// and work out what region we are in and use an appropriate endpoint - see AwsClientBuilder#setRegion. | |
// In contrast, directly-constructed clients use s3.amazonaws.com unless otherwise instructed. We currently | |
// use a directly-constructed client, and need to keep the existing behaviour to avoid a breaking change, | |
// so to move to using the builder we must set it explicitly to keep the existing behaviour. | |
// | |
// We do this because directly constructing the client is deprecated (was already deprecated in 1.1.223 too) | |
// so this change removes that usage of a deprecated API. | |
builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, null)) | |
.enablePathStyleAccess(); | |
return builder.build(); | |
} |
I would rather not in this PR, as that entails other changes (namely change in default endpoint, see #27925) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, LGTM
Upgrades the AWS SDK to the same version that we're using for the repository-s3 plugin, providing testing capabilities to override certain SDK endpoints in order to point them to localhost for testing. Adds tests for the various credential providers.
Upgrades the AWS SDK to the same version that we're using for the repository-s3 plugin, providing testing capabilities to override certain SDK endpoints in order to point them to localhost for testing. Adds tests for the various credential providers.
Upgrades the AWS SDK to the same version that we're using for the repository-s3 plugin, providing testing capabilities to override certain SDK endpoints in order to point them to localhost for testing. Adds tests for the various credential providers.
Upgrades the AWS SDK to the same version that we're using for the repository-s3 plugin, providing testing capabilities to override certain SDK endpoints in order to point them to localhost for testing. Adds tests for the various credential providers.
Relates to #41630 (comment)