From 02b4e28534d13436175111aad49500ae8367bb8f Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Fri, 9 Nov 2018 05:07:26 +0100 Subject: [PATCH] #31608 Add S3 Setting to Force Path Type Access (#34721) * SNAPSHOTS: Use Path Style Access in S3 * Use path style access pattern to fix #31608 * closes #31608 --- docs/plugins/repository-s3.asciidoc | 3 +++ docs/reference/migration/migrate_7_0/plugins.asciidoc | 7 +++++++ .../java/org/elasticsearch/repositories/s3/S3Service.java | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/plugins/repository-s3.asciidoc b/docs/plugins/repository-s3.asciidoc index b065951856a..531c5d16467 100644 --- a/docs/plugins/repository-s3.asciidoc +++ b/docs/plugins/repository-s3.asciidoc @@ -304,6 +304,9 @@ You may further restrict the permissions by specifying a prefix within the bucke The bucket needs to exist to register a repository for snapshots. If you did not create the bucket then the repository registration will fail. +Note: Starting in version 7.0, all bucket operations are using the path style access pattern. In previous versions the decision to use virtual hosted style +or path style access was made by the AWS Java SDK. + [[repository-s3-aws-vpc]] [float] ==== AWS VPC Bandwidth Settings diff --git a/docs/reference/migration/migrate_7_0/plugins.asciidoc b/docs/reference/migration/migrate_7_0/plugins.asciidoc index 5fcd2bb9526..f3c4071fec2 100644 --- a/docs/reference/migration/migrate_7_0/plugins.asciidoc +++ b/docs/reference/migration/migrate_7_0/plugins.asciidoc @@ -22,6 +22,13 @@ must now be specified in the client settings instead. See {plugins}/repository-gcs-client.html#repository-gcs-client[Google Cloud Storage Client Settings]. +[float] +==== S3 Repository Plugin + +* The plugin now uses the path style access pattern for all requests. +In previous versions it was automatically determining whether to use virtual hosted style or path style +access. + [float] ==== Analysis Plugin changes diff --git a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java index 95313f90656..837f2ea34c7 100644 --- a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java @@ -107,7 +107,8 @@ class S3Service extends AbstractComponent implements Closeable { // // 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)); + builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, null)) + .enablePathStyleAccess(); return builder.build(); }