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

Update aws java sdk to support ecs task roles #25552

11 changes: 10 additions & 1 deletion plugins/repository-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ esplugin {
}

versions << [
'aws': '1.10.69'
'aws': '1.11.187'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AWS SDK v2.0 is in beta, but is there a reason that we don't update to the latest version (1.11.211, maybe 1.11.212)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wanted for this PR to use the same version that we have been using for ec2. Not mandatory though that we keep that consistent.
I'm all +1 to move to latest and also move S3 to latest version.

]

dependencies {
Expand Down Expand Up @@ -76,6 +76,15 @@ thirdPartyAudit.excludes = [
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',
'org.apache.log.Logger',
'software/amazon/ion/IonReader',
'software/amazon/ion/IonSystem',
'software/amazon/ion/IonType',
'software/amazon/ion/IonWriter',
'software/amazon/ion/Timestamp',
'software/amazon/ion/system/IonBinaryWriterBuilder',
'software/amazon/ion/system/IonSystemBuilder',
'software/amazon/ion/system/IonTextWriterBuilder',
'software/amazon/ion/system/IonWriterBuilder'
]

// jarhell with jdk (intentionally, because jaxb was removed from default modules in java 9)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6f47fcd3c2917bef69dc36aba203c5ea4af9bf24

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f2f4e9afe15bd6a718ad64716042e52f406e668b

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2647df2408c435289293260dc27f0762ce259c30
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.InstanceProfileCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.http.IdleConnectionReaper;
import com.amazonaws.internal.StaticCredentialsProvider;
import com.amazonaws.services.s3.AmazonS3;
Expand Down Expand Up @@ -166,10 +166,10 @@ protected void doClose() throws ElasticsearchException {
}

static class PrivilegedInstanceProfileCredentialsProvider implements AWSCredentialsProvider {
private final InstanceProfileCredentialsProvider credentials;
private final DefaultAWSCredentialsProviderChain credentials;

private PrivilegedInstanceProfileCredentialsProvider() {
this.credentials = new InstanceProfileCredentialsProvider();
this.credentials = new DefaultAWSCredentialsProviderChain();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. This needs to be turned into a chain over InstanceProfile provider and container credentials provider as I described in #23039 (comment). We will not use the default chain because it exposes insecure methods of passing credentials.

}

@Override
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void assertCredentials(Settings singleRepositorySettings, Settings setti
}

public void testAWSDefaultConfiguration() {
launchAWSConfigurationTest(Settings.EMPTY, Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, 3, false,
launchAWSConfigurationTest(Settings.EMPTY, Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, 3, true,
ClientConfiguration.DEFAULT_SOCKET_TIMEOUT);
}

Expand All @@ -111,15 +111,15 @@ public void testAWSConfigurationWithAwsSettings() {
.put("s3.client.default.read_timeout", "10s")
.build();
launchAWSConfigurationTest(settings, Settings.EMPTY, Protocol.HTTP, "aws_proxy_host", 8080, "aws_proxy_username",
"aws_proxy_password", 3, false, 10000);
"aws_proxy_password", 3, true, 10000);
}

public void testRepositoryMaxRetries() {
Settings settings = Settings.builder()
.put("s3.client.default.max_retries", 5)
.build();
launchAWSConfigurationTest(settings, Settings.EMPTY, Protocol.HTTPS, null, -1, null,
null, 5, false, 50000);
null, 5, true, 50000);
}

public void testRepositoryThrottleRetries() {
Expand Down