> R getReader(final byte b) {
- return (R) READER_REGISTRY.get(b);
- }
- }
-
- /**
- * Write this into the {@linkplain BaseStreamOutput}.
- */
- void writeTo(final S out) throws IOException;
-
- /**
- * Reference to a method that can write some object to a {@link BaseStreamOutput}.
- *
- * By convention this is a method from {@link BaseStreamOutput} itself (e.g., {@code StreamOutput#writeString}). If the value can be
- * {@code null}, then the "optional" variant of methods should be used!
- *
- * Most classes should implement {@code Writeable} and the {@code Writeable#writeTo(BaseStreamOutput)} method should use
- * {@link BaseStreamOutput} methods directly or this indirectly:
- *
- * public void writeTo(StreamOutput out) throws IOException {
- * out.writeVInt(someValue);
- * out.writeMapOfLists(someMap, StreamOutput::writeString, StreamOutput::writeString);
- * }
- *
- */
- @FunctionalInterface
- interface Writer {
-
- /**
- * Write {@code V}-type {@code value} to the {@code out}put stream.
- *
- * @param out Output to write the {@code value} too
- * @param value The value to add
- */
- void write(final S out, V value) throws IOException;
- }
-
- /**
- * Reference to a method that can read some object from a stream. By convention this is a constructor that takes
- * {@linkplain BaseStreamInput} as an argument for most classes and a static method for things like enums. Returning null from one of these
- * is always wrong - for that we use methods like {@code StreamInput#readOptionalWriteable(Reader)}.
- *
- * As most classes will implement this via a constructor (or a static method in the case of enumerations), it's something that should
- * look like:
- *
- * public MyClass(final StreamInput in) throws IOException {
- * this.someValue = in.readVInt();
- * this.someMap = in.readMapOfLists(StreamInput::readString, StreamInput::readString);
- * }
- *
- */
- @FunctionalInterface
- interface Reader {
-
- /**
- * Read {@code V}-type value from a stream.
- *
- * @param in Input to read the value from
- */
- V read(final S in) throws IOException;
- }
-}
diff --git a/server/src/main/java/org/opensearch/index/Index.java b/libs/core/src/main/java/org/opensearch/index/Index.java
similarity index 100%
rename from server/src/main/java/org/opensearch/index/Index.java
rename to libs/core/src/main/java/org/opensearch/index/Index.java
diff --git a/libs/core/src/main/java/org/opensearch/index/package-info.java b/libs/core/src/main/java/org/opensearch/index/package-info.java
new file mode 100644
index 0000000000000..bcb93e8c78856
--- /dev/null
+++ b/libs/core/src/main/java/org/opensearch/index/package-info.java
@@ -0,0 +1,10 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/** Classes for core index module */
+package org.opensearch.index;
diff --git a/server/src/main/java/org/opensearch/index/shard/ShardId.java b/libs/core/src/main/java/org/opensearch/index/shard/ShardId.java
similarity index 96%
rename from server/src/main/java/org/opensearch/index/shard/ShardId.java
rename to libs/core/src/main/java/org/opensearch/index/shard/ShardId.java
index 9f226cd2df76a..ac24130ed90c9 100644
--- a/server/src/main/java/org/opensearch/index/shard/ShardId.java
+++ b/libs/core/src/main/java/org/opensearch/index/shard/ShardId.java
@@ -32,7 +32,7 @@
package org.opensearch.index.shard;
-import org.opensearch.cluster.metadata.IndexMetadata;
+import org.opensearch.core.common.Strings;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.io.stream.Writeable;
@@ -109,7 +109,7 @@ public static ShardId fromString(String shardIdString) {
}
String indexName = shardIdString.substring(1, splitPosition);
int shardId = Integer.parseInt(shardIdString.substring(splitPosition + 2, shardIdString.length() - 1));
- return new ShardId(new Index(indexName, IndexMetadata.INDEX_UUID_NA_VALUE), shardId);
+ return new ShardId(new Index(indexName, Strings.UNKNOWN_UUID_VALUE), shardId);
}
@Override
diff --git a/libs/core/src/main/java/org/opensearch/index/shard/package-info.java b/libs/core/src/main/java/org/opensearch/index/shard/package-info.java
new file mode 100644
index 0000000000000..3ae1d95494bd6
--- /dev/null
+++ b/libs/core/src/main/java/org/opensearch/index/shard/package-info.java
@@ -0,0 +1,10 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/** Classes for core index/shard module */
+package org.opensearch.index.shard;
diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java b/libs/core/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java
similarity index 100%
rename from server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java
rename to libs/core/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java
diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java b/libs/core/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java
similarity index 100%
rename from server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java
rename to libs/core/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java
diff --git a/libs/core/src/main/java/org/opensearch/index/snapshots/package-info.java b/libs/core/src/main/java/org/opensearch/index/snapshots/package-info.java
new file mode 100644
index 0000000000000..7102459987dbf
--- /dev/null
+++ b/libs/core/src/main/java/org/opensearch/index/snapshots/package-info.java
@@ -0,0 +1,10 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/** Classes for core snapshots module */
+package org.opensearch.index.snapshots;
diff --git a/server/src/main/java/org/opensearch/rest/RestStatus.java b/libs/core/src/main/java/org/opensearch/rest/RestStatus.java
similarity index 100%
rename from server/src/main/java/org/opensearch/rest/RestStatus.java
rename to libs/core/src/main/java/org/opensearch/rest/RestStatus.java
diff --git a/libs/core/src/main/java/org/opensearch/rest/package-info.java b/libs/core/src/main/java/org/opensearch/rest/package-info.java
new file mode 100644
index 0000000000000..a629540e3858c
--- /dev/null
+++ b/libs/core/src/main/java/org/opensearch/rest/package-info.java
@@ -0,0 +1,10 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/** Classes for core REST module */
+package org.opensearch.rest;
diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle
index 2e3cf8d45ceab..97cf68a7971fa 100644
--- a/libs/grok/build.gradle
+++ b/libs/grok/build.gradle
@@ -29,7 +29,7 @@
*/
dependencies {
- api 'org.jruby.joni:joni:2.1.48'
+ api 'org.jruby.joni:joni:2.2.1'
// joni dependencies:
api 'org.jruby.jcodings:jcodings:1.0.58'
diff --git a/libs/grok/licenses/joni-2.1.48.jar.sha1 b/libs/grok/licenses/joni-2.1.48.jar.sha1
deleted file mode 100644
index 4ac2f3842559b..0000000000000
--- a/libs/grok/licenses/joni-2.1.48.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-552f95e640553de15243c02bd97a6c0c3dd7a78f
\ No newline at end of file
diff --git a/libs/grok/licenses/joni-2.2.1.jar.sha1 b/libs/grok/licenses/joni-2.2.1.jar.sha1
new file mode 100644
index 0000000000000..d0338540f5512
--- /dev/null
+++ b/libs/grok/licenses/joni-2.2.1.jar.sha1
@@ -0,0 +1 @@
+23d2f2eff7fa0cda465d86ec9d8bab53e496d9e6
\ No newline at end of file
diff --git a/libs/grok/src/main/java/org/opensearch/grok/Grok.java b/libs/grok/src/main/java/org/opensearch/grok/Grok.java
index e80bde02360ed..2585916aae38b 100644
--- a/libs/grok/src/main/java/org/opensearch/grok/Grok.java
+++ b/libs/grok/src/main/java/org/opensearch/grok/Grok.java
@@ -214,8 +214,8 @@ private String groupMatch(String name, Region region, String pattern) {
name.getBytes(StandardCharsets.UTF_8).length,
region
);
- int begin = region.beg[number];
- int end = region.end[number];
+ int begin = region.getBeg(number);
+ int end = region.getEnd(number);
return new String(pattern.getBytes(StandardCharsets.UTF_8), begin, end - begin, StandardCharsets.UTF_8);
} catch (StringIndexOutOfBoundsException e) {
return null;
@@ -270,7 +270,12 @@ protected String toRegex(String grokPattern) {
grokPart = String.format(Locale.US, "(?<%s>%s)", patternName + "_" + result, pattern);
}
String start = new String(grokPatternBytes, 0, result, StandardCharsets.UTF_8);
- String rest = new String(grokPatternBytes, region.end[0], grokPatternBytes.length - region.end[0], StandardCharsets.UTF_8);
+ String rest = new String(
+ grokPatternBytes,
+ region.getEnd(0),
+ grokPatternBytes.length - region.getEnd(0),
+ StandardCharsets.UTF_8
+ );
grokPattern = grokPart + rest;
res.append(start);
}
diff --git a/libs/grok/src/main/java/org/opensearch/grok/GrokCaptureType.java b/libs/grok/src/main/java/org/opensearch/grok/GrokCaptureType.java
index f5898414827ff..7f9555d01e386 100644
--- a/libs/grok/src/main/java/org/opensearch/grok/GrokCaptureType.java
+++ b/libs/grok/src/main/java/org/opensearch/grok/GrokCaptureType.java
@@ -105,9 +105,9 @@ protected final GrokCaptureExtracter rawExtracter(int[] backRefs, Consumer sup
@Override
void extract(byte[] utf8Bytes, int offset, Region region) {
for (int number : backRefs) {
- if (region.beg[number] >= 0) {
- int matchOffset = offset + region.beg[number];
- int matchLength = region.end[number] - region.beg[number];
+ if (region.getBeg(number) >= 0) {
+ int matchOffset = offset + region.getBeg(number);
+ int matchLength = region.getEnd(number) - region.getBeg(number);
emit.accept(new String(utf8Bytes, matchOffset, matchLength, StandardCharsets.UTF_8));
return; // Capture only the first value.
}
diff --git a/libs/x-content/licenses/jackson-core-2.15.1.jar.sha1 b/libs/x-content/licenses/jackson-core-2.15.1.jar.sha1
deleted file mode 100644
index c05879d55296a..0000000000000
--- a/libs/x-content/licenses/jackson-core-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-241c054ba8503de092a12acad9f083dd39935cc0
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-core-2.15.2.jar.sha1 b/libs/x-content/licenses/jackson-core-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..ec6781b968eed
--- /dev/null
+++ b/libs/x-content/licenses/jackson-core-2.15.2.jar.sha1
@@ -0,0 +1 @@
+a6fe1836469a69b3ff66037c324d75fc66ef137c
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-dataformat-cbor-2.15.1.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-cbor-2.15.1.jar.sha1
deleted file mode 100644
index 096265b896013..0000000000000
--- a/libs/x-content/licenses/jackson-dataformat-cbor-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c1c88d6050bbfbfb040e1036e1cfb8f82e00df7b
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-dataformat-cbor-2.15.2.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-cbor-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..0022265a84b68
--- /dev/null
+++ b/libs/x-content/licenses/jackson-dataformat-cbor-2.15.2.jar.sha1
@@ -0,0 +1 @@
+baafc85c70765594add14bd93f3efd68e1945b76
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-dataformat-smile-2.15.1.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-smile-2.15.1.jar.sha1
deleted file mode 100644
index 6bff8b0b8dba9..0000000000000
--- a/libs/x-content/licenses/jackson-dataformat-smile-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-46d5f70e4ebb2e4c329701c45226a78978601e04
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-dataformat-smile-2.15.2.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-smile-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..2b8caad846fec
--- /dev/null
+++ b/libs/x-content/licenses/jackson-dataformat-smile-2.15.2.jar.sha1
@@ -0,0 +1 @@
+16d1dd22f7d641459ed056399d4f7df0220f1176
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-dataformat-yaml-2.15.1.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-yaml-2.15.1.jar.sha1
deleted file mode 100644
index 66e20ea31c7f0..0000000000000
--- a/libs/x-content/licenses/jackson-dataformat-yaml-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-97a9c5867fbacd44a1791c2d0a00bd4f3f061b77
\ No newline at end of file
diff --git a/libs/x-content/licenses/jackson-dataformat-yaml-2.15.2.jar.sha1 b/libs/x-content/licenses/jackson-dataformat-yaml-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..4ad7255e2318f
--- /dev/null
+++ b/libs/x-content/licenses/jackson-dataformat-yaml-2.15.2.jar.sha1
@@ -0,0 +1 @@
+58194ff9f51915ad6bf6b6f24818232d7566418a
\ No newline at end of file
diff --git a/modules/aggs-matrix-stats/src/main/java/org/opensearch/search/aggregations/matrix/stats/MatrixStatsAggregator.java b/modules/aggs-matrix-stats/src/main/java/org/opensearch/search/aggregations/matrix/stats/MatrixStatsAggregator.java
index 142e7ca3dbc15..eaf8a3bc6fe43 100644
--- a/modules/aggs-matrix-stats/src/main/java/org/opensearch/search/aggregations/matrix/stats/MatrixStatsAggregator.java
+++ b/modules/aggs-matrix-stats/src/main/java/org/opensearch/search/aggregations/matrix/stats/MatrixStatsAggregator.java
@@ -33,9 +33,9 @@
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.search.ScoreMode;
-import org.opensearch.common.lease.Releasables;
import org.opensearch.common.util.BigArrays;
import org.opensearch.common.util.ObjectArray;
+import org.opensearch.common.lease.Releasables;
import org.opensearch.index.fielddata.NumericDoubleValues;
import org.opensearch.search.MultiValueMode;
import org.opensearch.search.aggregations.Aggregator;
diff --git a/modules/analysis-common/src/main/java/org/opensearch/analysis/common/MappingCharFilterFactory.java b/modules/analysis-common/src/main/java/org/opensearch/analysis/common/MappingCharFilterFactory.java
index d6d9f8975f2fc..bd241de749f11 100644
--- a/modules/analysis-common/src/main/java/org/opensearch/analysis/common/MappingCharFilterFactory.java
+++ b/modules/analysis-common/src/main/java/org/opensearch/analysis/common/MappingCharFilterFactory.java
@@ -54,7 +54,7 @@ public class MappingCharFilterFactory extends AbstractCharFilterFactory implemen
MappingCharFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
super(indexSettings, name);
- List> rules = Analysis.parseWordList(env, settings, "mappings", this::parse);
+ List> rules = Analysis.parseWordList(env, settings, "mappings", this::parse, false);
if (rules == null) {
throw new IllegalArgumentException("mapping requires either `mappings` or `mappings_path` to be configured");
}
diff --git a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/MappingCharFilterFactoryTests.java b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/MappingCharFilterFactoryTests.java
index 7d059ff9ce1da..387eb4a377007 100644
--- a/modules/analysis-common/src/test/java/org/opensearch/analysis/common/MappingCharFilterFactoryTests.java
+++ b/modules/analysis-common/src/test/java/org/opensearch/analysis/common/MappingCharFilterFactoryTests.java
@@ -37,11 +37,11 @@ public static CharFilterFactory create(String... rules) throws IOException {
public void testRulesOk() throws IOException {
MappingCharFilterFactory mappingCharFilterFactory = (MappingCharFilterFactory) create(
- "# This is a comment",
+ "# => _hashtag_",
":) => _happy_",
":( => _sad_"
);
- CharFilter inputReader = (CharFilter) mappingCharFilterFactory.create(new StringReader("I'm so :)"));
+ CharFilter inputReader = (CharFilter) mappingCharFilterFactory.create(new StringReader("I'm so :), I'm so :( #confused"));
char[] tempBuff = new char[14];
StringBuilder output = new StringBuilder();
while (true) {
@@ -49,7 +49,7 @@ public void testRulesOk() throws IOException {
if (length == -1) break;
output.append(tempBuff, 0, length);
}
- assertEquals("I'm so _happy_", output.toString());
+ assertEquals("I'm so _happy_, I'm so _sad_ _hashtag_confused", output.toString());
}
public void testRuleError() {
@@ -64,7 +64,7 @@ public void testRuleError() {
}
public void testRulePartError() {
- RuntimeException ex = expectThrows(RuntimeException.class, () -> create("# This is a comment", ":) => _happy_", "a:b"));
+ RuntimeException ex = expectThrows(RuntimeException.class, () -> create("# => _hashtag_", ":) => _happy_", "a:b"));
assertEquals("Line [3]: Invalid mapping rule : [a:b]", ex.getMessage());
}
}
diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/50_char_filters.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/50_char_filters.yml
index 67e68428c07c7..0078575ae8e57 100644
--- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/50_char_filters.yml
+++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/50_char_filters.yml
@@ -57,3 +57,21 @@
- match: { detail.tokenizer.tokens.0.start_offset: 0 }
- match: { detail.tokenizer.tokens.0.end_offset: 15 }
- match: { detail.tokenizer.tokens.0.position: 0 }
+---
+"mapping_with_hashtag":
+ - do:
+ indices.analyze:
+ body:
+ text: 'test #test @test'
+ tokenizer: standard
+ filter:
+ - lowercase
+ char_filter:
+ - type: mapping
+ mappings:
+ - "# => _hashsign_"
+ - "@ => _atsign_"
+ - length: { tokens: 3 }
+ - match: { tokens.0.token: test }
+ - match: { tokens.1.token: _hashsign_test }
+ - match: { tokens.2.token: _atsign_test }
diff --git a/modules/geo/src/main/java/org/opensearch/geo/search/aggregations/metrics/AbstractGeoBoundsAggregator.java b/modules/geo/src/main/java/org/opensearch/geo/search/aggregations/metrics/AbstractGeoBoundsAggregator.java
index 4a39fa1da04eb..2f013b76d5a67 100644
--- a/modules/geo/src/main/java/org/opensearch/geo/search/aggregations/metrics/AbstractGeoBoundsAggregator.java
+++ b/modules/geo/src/main/java/org/opensearch/geo/search/aggregations/metrics/AbstractGeoBoundsAggregator.java
@@ -8,9 +8,9 @@
package org.opensearch.geo.search.aggregations.metrics;
-import org.opensearch.common.lease.Releasables;
import org.opensearch.common.util.BigArrays;
import org.opensearch.common.util.DoubleArray;
+import org.opensearch.common.lease.Releasables;
import org.opensearch.search.aggregations.Aggregator;
import org.opensearch.search.aggregations.InternalAggregation;
import org.opensearch.search.aggregations.metrics.MetricsAggregator;
diff --git a/modules/geo/src/test/java/org/opensearch/geo/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java b/modules/geo/src/test/java/org/opensearch/geo/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java
index a39f66f571d0a..0bf41f37c45a7 100644
--- a/modules/geo/src/test/java/org/opensearch/geo/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java
+++ b/modules/geo/src/test/java/org/opensearch/geo/search/aggregations/bucket/geogrid/GeoTileGridParserTests.java
@@ -31,7 +31,7 @@
package org.opensearch.geo.search.aggregations.bucket.geogrid;
-import org.opensearch.BaseExceptionsHelper;
+import org.opensearch.ExceptionsHelper;
import org.opensearch.core.xcontent.XContentParseException;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.common.xcontent.json.JsonXContent;
@@ -77,7 +77,7 @@ public void testParseErrorOnBooleanPrecision() throws Exception {
() -> GeoTileGridAggregationBuilder.PARSER.parse(stParser, "geotile_grid")
);
assertThat(
- BaseExceptionsHelper.detailedMessage(e),
+ ExceptionsHelper.detailedMessage(e),
containsString("[geotile_grid] precision doesn't support values of type: VALUE_BOOLEAN")
);
}
diff --git a/modules/ingest-geoip/licenses/jackson-annotations-2.15.1.jar.sha1 b/modules/ingest-geoip/licenses/jackson-annotations-2.15.1.jar.sha1
deleted file mode 100644
index a3ade4ff8dadc..0000000000000
--- a/modules/ingest-geoip/licenses/jackson-annotations-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-092a90d3739e970e03b5971839e4fe51f13c1fa3
\ No newline at end of file
diff --git a/modules/ingest-geoip/licenses/jackson-annotations-2.15.2.jar.sha1 b/modules/ingest-geoip/licenses/jackson-annotations-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f63416ddb8ceb
--- /dev/null
+++ b/modules/ingest-geoip/licenses/jackson-annotations-2.15.2.jar.sha1
@@ -0,0 +1 @@
+4724a65ac8e8d156a24898d50fd5dbd3642870b8
\ No newline at end of file
diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.15.1.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.15.1.jar.sha1
deleted file mode 100644
index 47405b86d4a51..0000000000000
--- a/modules/ingest-geoip/licenses/jackson-databind-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ac9ba74d208faf356e4719a49e59c6ea9237c01d
\ No newline at end of file
diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.15.2.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f16d80af8dce6
--- /dev/null
+++ b/modules/ingest-geoip/licenses/jackson-databind-2.15.2.jar.sha1
@@ -0,0 +1 @@
+9353b021f10c307c00328f52090de2bdb4b6ff9c
\ No newline at end of file
diff --git a/modules/lang-expression/licenses/lucene-expressions-9.7.0-snapshot-204acc3.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..f70c327ab5f6b
--- /dev/null
+++ b/modules/lang-expression/licenses/lucene-expressions-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+c31671978777d97c026b13decfbef1d7eeed4410
\ No newline at end of file
diff --git a/modules/lang-expression/licenses/lucene-expressions-9.7.0-snapshot-4d1ed9e.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 805927269dcdc..0000000000000
--- a/modules/lang-expression/licenses/lucene-expressions-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-441c6341e75f06b834c992084f21556681963ea6
\ No newline at end of file
diff --git a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/MultiSearchTemplateResponse.java b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/MultiSearchTemplateResponse.java
index 5b6102d1a3ad4..449e89cdc5f3c 100644
--- a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/MultiSearchTemplateResponse.java
+++ b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/MultiSearchTemplateResponse.java
@@ -32,7 +32,7 @@
package org.opensearch.script.mustache;
-import org.opensearch.BaseOpenSearchException;
+import org.opensearch.OpenSearchException;
import org.opensearch.action.ActionResponse;
import org.opensearch.action.search.MultiSearchResponse;
import org.opensearch.common.Nullable;
@@ -166,7 +166,7 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par
for (Item item : items) {
if (item.isFailure()) {
builder.startObject();
- BaseOpenSearchException.generateFailureXContent(builder, params, item.getFailure(), true);
+ OpenSearchException.generateFailureXContent(builder, params, item.getFailure(), true);
builder.endObject();
} else {
item.getResponse().toXContent(builder, params);
diff --git a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/71_context_api.yml b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/71_context_api.yml
index 0413661fc586c..478ca9ae8abf4 100644
--- a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/71_context_api.yml
+++ b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/71_context_api.yml
@@ -2,7 +2,7 @@
- do:
scripts_painless_context: {}
- match: { contexts.0: aggregation_selector}
- - match: { contexts.22: update}
+ - match: { contexts.23: update}
---
"Action to get all API values for score context":
diff --git a/modules/parent-join/src/main/java/org/opensearch/join/aggregations/ParentJoinAggregator.java b/modules/parent-join/src/main/java/org/opensearch/join/aggregations/ParentJoinAggregator.java
index 4e1016a596874..0b0ff2b0a382e 100644
--- a/modules/parent-join/src/main/java/org/opensearch/join/aggregations/ParentJoinAggregator.java
+++ b/modules/parent-join/src/main/java/org/opensearch/join/aggregations/ParentJoinAggregator.java
@@ -41,11 +41,11 @@
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Weight;
import org.apache.lucene.util.Bits;
-import org.opensearch.common.lease.Releasable;
-import org.opensearch.common.lease.Releasables;
import org.opensearch.common.lucene.Lucene;
import org.opensearch.common.util.BigArrays;
import org.opensearch.common.util.BitArray;
+import org.opensearch.common.lease.Releasable;
+import org.opensearch.common.lease.Releasables;
import org.opensearch.search.aggregations.Aggregator;
import org.opensearch.search.aggregations.AggregatorFactories;
import org.opensearch.search.aggregations.CardinalityUpperBound;
diff --git a/modules/rank-eval/src/internalClusterTest/java/org/opensearch/index/rankeval/RankEvalRequestIT.java b/modules/rank-eval/src/internalClusterTest/java/org/opensearch/index/rankeval/RankEvalRequestIT.java
index 35ceb60dec7ed..6eb974c77a5f3 100644
--- a/modules/rank-eval/src/internalClusterTest/java/org/opensearch/index/rankeval/RankEvalRequestIT.java
+++ b/modules/rank-eval/src/internalClusterTest/java/org/opensearch/index/rankeval/RankEvalRequestIT.java
@@ -32,7 +32,7 @@
package org.opensearch.index.rankeval;
-import org.opensearch.BaseOpenSearchException;
+import org.opensearch.OpenSearchException;
import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.support.IndicesOptions;
@@ -274,7 +274,7 @@ public void testBadQuery() {
RankEvalResponse response = client().execute(RankEvalAction.INSTANCE, builder.request()).actionGet();
assertEquals(1, response.getFailures().size());
- BaseOpenSearchException[] rootCauses = BaseOpenSearchException.guessRootCauses(response.getFailures().get("broken_query"));
+ OpenSearchException[] rootCauses = OpenSearchException.guessRootCauses(response.getFailures().get("broken_query"));
assertEquals("java.lang.NumberFormatException: For input string: \"noStringOnNumericFields\"", rootCauses[0].getCause().toString());
}
diff --git a/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/RankEvalResponse.java b/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/RankEvalResponse.java
index 58a940e1618da..180069ab91bd6 100644
--- a/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/RankEvalResponse.java
+++ b/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/RankEvalResponse.java
@@ -32,7 +32,6 @@
package org.opensearch.index.rankeval;
-import org.opensearch.BaseOpenSearchException;
import org.opensearch.OpenSearchException;
import org.opensearch.action.ActionResponse;
import org.opensearch.core.ParseField;
@@ -137,7 +136,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.startObject("failures");
for (String key : failures.keySet()) {
builder.startObject(key);
- BaseOpenSearchException.generateFailureXContent(builder, params, failures.get(key), true);
+ OpenSearchException.generateFailureXContent(builder, params, failures.get(key), true);
builder.endObject();
}
builder.endObject();
diff --git a/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java b/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java
index b1e4d53c90d92..5a4674e146585 100644
--- a/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java
+++ b/modules/reindex/src/main/java/org/opensearch/index/reindex/remote/RemoteResponseParsers.java
@@ -35,9 +35,9 @@
import org.apache.lucene.search.TotalHits;
import org.opensearch.LegacyESVersion;
import org.opensearch.Version;
+import org.opensearch.common.bytes.BytesReference;
import org.opensearch.core.ParseField;
import org.opensearch.common.ParsingException;
-import org.opensearch.common.bytes.BytesReference;
import org.opensearch.common.collect.Tuple;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.core.xcontent.ConstructingObjectParser;
diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java
index e11ad3b5013c1..61336156a83d0 100644
--- a/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java
+++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java
@@ -33,7 +33,6 @@
package org.opensearch.index.reindex;
import org.apache.lucene.search.TotalHits;
-import org.opensearch.BaseExceptionsHelper;
import org.opensearch.OpenSearchException;
import org.opensearch.ExceptionsHelper;
import org.opensearch.Version;
@@ -216,7 +215,7 @@ public void testStartRetriesOnRejectionButFailsOnTooManyRejections() throws Exce
assertBusy(() -> assertEquals(testRequest.getMaxRetries() + 1, client.searchAttempts.get()));
assertBusy(() -> assertTrue(listener.isDone()));
ExecutionException e = expectThrows(ExecutionException.class, () -> listener.get());
- assertThat(BaseExceptionsHelper.stackTrace(e), containsString(OpenSearchRejectedExecutionException.class.getSimpleName()));
+ assertThat(ExceptionsHelper.stackTrace(e), containsString(OpenSearchRejectedExecutionException.class.getSimpleName()));
assertNull("There shouldn't be a search attempt pending that we didn't reject", client.lastSearch.get());
assertEquals(testRequest.getMaxRetries(), testTask.getStatus().getSearchRetries());
}
diff --git a/modules/search-pipeline-common/build.gradle b/modules/search-pipeline-common/build.gradle
index cc655e10ada92..fe3c097ff6886 100644
--- a/modules/search-pipeline-common/build.gradle
+++ b/modules/search-pipeline-common/build.gradle
@@ -15,9 +15,11 @@ apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Module for search pipeline processors that do not require additional security permissions or have large dependencies and resources'
classname 'org.opensearch.search.pipeline.common.SearchPipelineCommonModulePlugin'
+ extendedPlugins = ['lang-painless']
}
dependencies {
+ compileOnly project(':modules:lang-painless')
}
restResources {
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/FilterQueryRequestProcessor.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/FilterQueryRequestProcessor.java
index 81c00012daec6..7deb8faa03af6 100644
--- a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/FilterQueryRequestProcessor.java
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/FilterQueryRequestProcessor.java
@@ -40,6 +40,11 @@ public class FilterQueryRequestProcessor extends AbstractProcessor implements Se
final QueryBuilder filterQuery;
+ /**
+ * Returns the type of the processor.
+ *
+ * @return The processor type.
+ */
@Override
public String getType() {
return TYPE;
@@ -57,6 +62,14 @@ public FilterQueryRequestProcessor(String tag, String description, QueryBuilder
this.filterQuery = filterQuery;
}
+ /**
+ * Modifies the search request by adding a filtered query to the existing query, if any, and sets it as the new query
+ * in the search request's SearchSourceBuilder.
+ *
+ * @param request The search request to be processed.
+ * @return The modified search request.
+ * @throws Exception if an error occurs while processing the request.
+ */
@Override
public SearchRequest processRequest(SearchRequest request) throws Exception {
QueryBuilder originalQuery = null;
@@ -75,7 +88,7 @@ public SearchRequest processRequest(SearchRequest request) throws Exception {
return request;
}
- static class Factory implements Processor.Factory {
+ static class Factory implements Processor.Factory {
private final NamedXContentRegistry namedXContentRegistry;
public static final ParseField QUERY_FIELD = new ParseField("query");
@@ -85,7 +98,7 @@ static class Factory implements Processor.Factory {
@Override
public FilterQueryRequestProcessor create(
- Map processorFactories,
+ Map> processorFactories,
String tag,
String description,
Map config
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/RenameFieldResponseProcessor.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/RenameFieldResponseProcessor.java
index 3a2f0e9fb2492..4c40dda5928f0 100644
--- a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/RenameFieldResponseProcessor.java
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/RenameFieldResponseProcessor.java
@@ -128,7 +128,7 @@ public SearchResponse processResponse(SearchRequest request, SearchResponse resp
/**
* This is a factor that creates the RenameResponseProcessor
*/
- public static final class Factory implements Processor.Factory {
+ public static final class Factory implements Processor.Factory {
/**
* Constructor for factory
@@ -137,7 +137,7 @@ public static final class Factory implements Processor.Factory {
@Override
public RenameFieldResponseProcessor create(
- Map processorFactories,
+ Map> processorFactories,
String tag,
String description,
Map config
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/ScriptRequestProcessor.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/ScriptRequestProcessor.java
new file mode 100644
index 0000000000000..015411e0701a4
--- /dev/null
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/ScriptRequestProcessor.java
@@ -0,0 +1,182 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.search.pipeline.common;
+
+import org.opensearch.action.search.SearchRequest;
+
+import org.opensearch.common.Nullable;
+import org.opensearch.common.bytes.BytesReference;
+import org.opensearch.common.xcontent.LoggingDeprecationHandler;
+import org.opensearch.core.xcontent.NamedXContentRegistry;
+import org.opensearch.core.xcontent.XContentBuilder;
+import org.opensearch.core.xcontent.XContentParser;
+import org.opensearch.common.xcontent.XContentType;
+import org.opensearch.common.xcontent.json.JsonXContent;
+
+import org.opensearch.script.Script;
+import org.opensearch.script.ScriptException;
+import org.opensearch.script.ScriptService;
+import org.opensearch.script.ScriptType;
+import org.opensearch.script.SearchScript;
+import org.opensearch.search.pipeline.Processor;
+import org.opensearch.search.pipeline.SearchRequestProcessor;
+import org.opensearch.search.pipeline.common.helpers.SearchRequestMap;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Map;
+
+import static org.opensearch.ingest.ConfigurationUtils.newConfigurationException;
+
+/**
+ * Processor that evaluates a script with a search request in its context
+ * and then returns the modified search request.
+ */
+public final class ScriptRequestProcessor extends AbstractProcessor implements SearchRequestProcessor {
+ /**
+ * Key to reference this processor type from a search pipeline.
+ */
+ public static final String TYPE = "script";
+
+ private final Script script;
+ private final ScriptService scriptService;
+ private final SearchScript precompiledSearchScript;
+
+ /**
+ * Processor that evaluates a script with a search request in its context
+ *
+ * @param tag The processor's tag.
+ * @param description The processor's description.
+ * @param script The {@link Script} to execute.
+ * @param precompiledSearchScript The {@link Script} precompiled
+ * @param scriptService The {@link ScriptService} used to execute the script.
+ */
+ ScriptRequestProcessor(
+ String tag,
+ String description,
+ Script script,
+ @Nullable SearchScript precompiledSearchScript,
+ ScriptService scriptService
+ ) {
+ super(tag, description);
+ this.script = script;
+ this.precompiledSearchScript = precompiledSearchScript;
+ this.scriptService = scriptService;
+ }
+
+ /**
+ * Executes the script with the search request in context.
+ *
+ * @param request The search request passed into the script context.
+ * @return The modified search request.
+ * @throws Exception if an error occurs while processing the request.
+ */
+ @Override
+ public SearchRequest processRequest(SearchRequest request) throws Exception {
+ // assert request is not null and source is not null
+ if (request == null || request.source() == null) {
+ throw new IllegalArgumentException("search request must not be null");
+ }
+ final SearchScript searchScript;
+ if (precompiledSearchScript == null) {
+ SearchScript.Factory factory = scriptService.compile(script, SearchScript.CONTEXT);
+ searchScript = factory.newInstance(script.getParams());
+ } else {
+ searchScript = precompiledSearchScript;
+ }
+ // execute the script with the search request in context
+ searchScript.execute(Map.of("_source", new SearchRequestMap(request)));
+ return request;
+ }
+
+ /**
+ * Returns the type of the processor.
+ *
+ * @return The processor type.
+ */
+ @Override
+ public String getType() {
+ return TYPE;
+ }
+
+ /**
+ * Returns the script used by the processor.
+ *
+ * @return The script.
+ */
+ Script getScript() {
+ return script;
+ }
+
+ /**
+ * Returns the precompiled search script used by the processor.
+ *
+ * @return The precompiled search script.
+ */
+ SearchScript getPrecompiledSearchScript() {
+ return precompiledSearchScript;
+ }
+
+ /**
+ * Factory class for creating {@link ScriptRequestProcessor}.
+ */
+ public static final class Factory implements Processor.Factory {
+ private final ScriptService scriptService;
+
+ /**
+ * Constructs a new Factory instance with the specified {@link ScriptService}.
+ *
+ * @param scriptService The {@link ScriptService} used to execute scripts.
+ */
+ public Factory(ScriptService scriptService) {
+ this.scriptService = scriptService;
+ }
+
+ /**
+ * Creates a new instance of {@link ScriptRequestProcessor}.
+ *
+ * @param registry The registry of processor factories.
+ * @param processorTag The processor's tag.
+ * @param description The processor's description.
+ * @param config The configuration options for the processor.
+ * @return The created {@link ScriptRequestProcessor} instance.
+ * @throws Exception if an error occurs during the creation process.
+ */
+ @Override
+ public ScriptRequestProcessor create(
+ Map> registry,
+ String processorTag,
+ String description,
+ Map config
+ ) throws Exception {
+ try (
+ XContentBuilder builder = XContentBuilder.builder(JsonXContent.jsonXContent).map(config);
+ InputStream stream = BytesReference.bytes(builder).streamInput();
+ XContentParser parser = XContentType.JSON.xContent()
+ .createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, stream)
+ ) {
+ Script script = Script.parse(parser);
+
+ Arrays.asList("id", "source", "inline", "lang", "params", "options").forEach(config::remove);
+
+ // verify script is able to be compiled before successfully creating processor.
+ SearchScript searchScript = null;
+ try {
+ final SearchScript.Factory factory = scriptService.compile(script, SearchScript.CONTEXT);
+ if (ScriptType.INLINE.equals(script.getType())) {
+ searchScript = factory.newInstance(script.getParams());
+ }
+ } catch (ScriptException e) {
+ throw newConfigurationException(TYPE, processorTag, null, e);
+ }
+ return new ScriptRequestProcessor(processorTag, description, script, searchScript, scriptService);
+ }
+ }
+ }
+}
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/SearchPipelineCommonModulePlugin.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/SearchPipelineCommonModulePlugin.java
index a0e5182f71443..dc25de460fdba 100644
--- a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/SearchPipelineCommonModulePlugin.java
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/SearchPipelineCommonModulePlugin.java
@@ -11,6 +11,8 @@
import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.SearchPipelinePlugin;
import org.opensearch.search.pipeline.Processor;
+import org.opensearch.search.pipeline.SearchRequestProcessor;
+import org.opensearch.search.pipeline.SearchResponseProcessor;
import java.util.Map;
@@ -24,13 +26,24 @@ public class SearchPipelineCommonModulePlugin extends Plugin implements SearchPi
*/
public SearchPipelineCommonModulePlugin() {}
+ /**
+ * Returns a map of processor factories.
+ *
+ * @param parameters The parameters required for creating the processor factories.
+ * @return A map of processor factories, where the keys are the processor types and the values are the corresponding factory instances.
+ */
@Override
- public Map getProcessors(Processor.Parameters parameters) {
+ public Map> getRequestProcessors(Processor.Parameters parameters) {
return Map.of(
FilterQueryRequestProcessor.TYPE,
new FilterQueryRequestProcessor.Factory(parameters.namedXContentRegistry),
- RenameFieldResponseProcessor.TYPE,
- new RenameFieldResponseProcessor.Factory()
+ ScriptRequestProcessor.TYPE,
+ new ScriptRequestProcessor.Factory(parameters.scriptService)
);
}
+
+ @Override
+ public Map> getResponseProcessors(Processor.Parameters parameters) {
+ return Map.of(RenameFieldResponseProcessor.TYPE, new RenameFieldResponseProcessor.Factory());
+ }
}
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMap.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMap.java
new file mode 100644
index 0000000000000..7af3ac66be146
--- /dev/null
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMap.java
@@ -0,0 +1,395 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.search.pipeline.common.helpers;
+
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.search.builder.SearchSourceBuilder;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+
+/**
+ * A custom implementation of {@link Map} that provides access to the properties of a {@link SearchRequest}'s
+ * {@link SearchSourceBuilder}. The class allows retrieving and modifying specific properties of the search request.
+ */
+public class SearchRequestMap implements Map {
+ private static final String UNSUPPORTED_OP_ERR = " Method not supported in Search pipeline script";
+
+ private final SearchSourceBuilder source;
+
+ /**
+ * Constructs a new instance of the {@link SearchRequestMap} with the provided {@link SearchRequest}.
+ *
+ * @param searchRequest The SearchRequest containing the SearchSourceBuilder to be accessed.
+ */
+ public SearchRequestMap(SearchRequest searchRequest) {
+ source = searchRequest.source();
+ }
+
+ /**
+ * Retrieves the number of properties in the SearchSourceBuilder.
+ *
+ * @return The number of properties in the SearchSourceBuilder.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public int size() {
+ throw new UnsupportedOperationException("size" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Checks if the SearchSourceBuilder is empty.
+ *
+ * @return {@code true} if the SearchSourceBuilder is empty, {@code false} otherwise.
+ */
+ @Override
+ public boolean isEmpty() {
+ return source == null;
+ }
+
+ /**
+ * Checks if the SearchSourceBuilder contains the specified property.
+ *
+ * @param key The property to check for.
+ * @return {@code true} if the SearchSourceBuilder contains the specified property, {@code false} otherwise.
+ */
+ @Override
+ public boolean containsKey(Object key) {
+ return get(key) != null;
+ }
+
+ /**
+ * Checks if the SearchSourceBuilder contains the specified value.
+ *
+ * @param value The value to check for.
+ * @return {@code true} if the SearchSourceBuilder contains the specified value, {@code false} otherwise.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public boolean containsValue(Object value) {
+ throw new UnsupportedOperationException("containsValue" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Retrieves the value associated with the specified property from the SearchSourceBuilder.
+ *
+ * @param key The SearchSourceBuilder property whose value is to be retrieved.
+ * @return The value associated with the specified property or null if the property has not been initialized.
+ * @throws IllegalArgumentException if the property name is not a String.
+ * @throws SearchRequestMapProcessingException if the property is not supported.
+ */
+ @Override
+ public Object get(Object key) {
+ if (!(key instanceof String)) {
+ throw new IllegalArgumentException("key must be a String");
+ }
+ // This is the explicit implementation of fetch value from source
+ switch ((String) key) {
+ case "from":
+ return source.from();
+ case "size":
+ return source.size();
+ case "explain":
+ return source.explain();
+ case "version":
+ return source.version();
+ case "seq_no_primary_term":
+ return source.seqNoAndPrimaryTerm();
+ case "track_scores":
+ return source.trackScores();
+ case "track_total_hits":
+ return source.trackTotalHitsUpTo();
+ case "min_score":
+ return source.minScore();
+ case "terminate_after":
+ return source.terminateAfter();
+ case "profile":
+ return source.profile();
+ default:
+ throw new SearchRequestMapProcessingException("Unsupported key: " + key);
+ }
+ }
+
+ /**
+ * Sets the value for the specified property in the SearchSourceBuilder.
+ *
+ * @param key The property whose value is to be set.
+ * @param value The value to be set for the specified property.
+ * @return The original value associated with the property, or null if none existed.
+ * @throws IllegalArgumentException if the property is not a String.
+ * @throws SearchRequestMapProcessingException if the property is not supported or an error occurs during the setting.
+ */
+ @Override
+ public Object put(String key, Object value) {
+ Object originalValue = get(key);
+ try {
+ switch (key) {
+ case "from":
+ source.from((Integer) value);
+ break;
+ case "size":
+ source.size((Integer) value);
+ break;
+ case "explain":
+ source.explain((Boolean) value);
+ break;
+ case "version":
+ source.version((Boolean) value);
+ break;
+ case "seq_no_primary_term":
+ source.seqNoAndPrimaryTerm((Boolean) value);
+ break;
+ case "track_scores":
+ source.trackScores((Boolean) value);
+ break;
+ case "track_total_hits":
+ source.trackTotalHitsUpTo((Integer) value);
+ break;
+ case "min_score":
+ source.minScore((Float) value);
+ break;
+ case "terminate_after":
+ source.terminateAfter((Integer) value);
+ break;
+ case "profile":
+ source.profile((Boolean) value);
+ break;
+ case "stats": // Not modifying stats, sorts, docvalue_fields, etc. as they require more complex handling
+ case "sort":
+ case "timeout":
+ case "docvalue_fields":
+ case "indices_boost":
+ default:
+ throw new SearchRequestMapProcessingException("Unsupported SearchRequest source property: " + key);
+ }
+ } catch (Exception e) {
+ throw new SearchRequestMapProcessingException("Error while setting value for SearchRequest source property: " + key, e);
+ }
+ return originalValue;
+ }
+
+ /**
+ * Removes the specified property from the SearchSourceBuilder.
+ *
+ * @param key The name of the property that will be removed.
+ * @return The value associated with the property before it was removed, or null if the property was not found.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object remove(Object key) {
+ throw new UnsupportedOperationException("remove" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Sets all the properties from the specified map to the SearchSourceBuilder.
+ *
+ * @param m The map containing the properties to be set.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public void putAll(Map extends String, ?> m) {
+ throw new UnsupportedOperationException("putAll" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Removes all properties from the SearchSourceBuilder.
+ *
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException("clear" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Returns a set view of the property names in the SearchSourceBuilder.
+ *
+ * @return A set view of the property names in the SearchSourceBuilder.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Set keySet() {
+ throw new UnsupportedOperationException("keySet" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Returns a collection view of the property values in the SearchSourceBuilder.
+ *
+ * @return A collection view of the property values in the SearchSourceBuilder.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Collection values() {
+ throw new UnsupportedOperationException("values" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Returns a set view of the properties in the SearchSourceBuilder.
+ *
+ * @return A set view of the properties in the SearchSourceBuilder.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Set> entrySet() {
+ throw new UnsupportedOperationException("entrySet" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Returns the value to which the specified property has, or the defaultValue if the property is not present in the
+ * SearchSourceBuilder.
+ *
+ * @param key The property whose associated value is to be returned.
+ * @param defaultValue The default value to be returned if the property is not present.
+ * @return The value to which the specified property has, or the defaultValue if the property is not present.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object getOrDefault(Object key, Object defaultValue) {
+ throw new UnsupportedOperationException("getOrDefault" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Performs the given action for each property in the SearchSourceBuilder until all properties have been processed or the
+ * action throws an exception
+ *
+ * @param action The action to be performed for each property.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public void forEach(BiConsumer super String, ? super Object> action) {
+ throw new UnsupportedOperationException("forEach" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Replaces each property's value with the result of invoking the given function on that property until all properties have
+ * been processed or the function throws an exception.
+ *
+ * @param function The function to apply to each property.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public void replaceAll(BiFunction super String, ? super Object, ?> function) {
+ throw new UnsupportedOperationException("replaceAll" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * If the specified property is not already associated with a value, associates it with the given value and returns null,
+ * else returns the current value.
+ *
+ * @param key The property whose value is to be set if absent.
+ * @param value The value to be associated with the specified property.
+ * @return The current value associated with the property, or null if the property is not present.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object putIfAbsent(String key, Object value) {
+ throw new UnsupportedOperationException("putIfAbsent" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Removes the property only if it has the given value.
+ *
+ * @param key The property to be removed.
+ * @param value The value expected to be associated with the property.
+ * @return {@code true} if the entry was removed, {@code false} otherwise.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public boolean remove(Object key, Object value) {
+ throw new UnsupportedOperationException("remove" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Replaces the specified property only if it has the given value.
+ *
+ * @param key The property to be replaced.
+ * @param oldValue The value expected to be associated with the property.
+ * @param newValue The value to be associated with the property.
+ * @return {@code true} if the property was replaced, {@code false} otherwise.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public boolean replace(String key, Object oldValue, Object newValue) {
+ throw new UnsupportedOperationException("replace" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * Replaces the specified property only if it has the given value.
+ *
+ * @param key The property to be replaced.
+ * @param value The value to be associated with the property.
+ * @return The previous value associated with the property, or null if the property was not found.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object replace(String key, Object value) {
+ throw new UnsupportedOperationException("replace" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * The computed value associated with the property, or null if the property is not present.
+ *
+ * @param key The property whose value is to be computed if absent.
+ * @param mappingFunction The function to compute a value based on the property.
+ * @return The computed value associated with the property, or null if the property is not present.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object computeIfAbsent(String key, Function super String, ?> mappingFunction) {
+ throw new UnsupportedOperationException("computeIfAbsent" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * If the value for the specified property is present, attempts to compute a new mapping given the property and its current
+ * mapped value.
+ *
+ * @param key The property for which the mapping is to be computed.
+ * @param remappingFunction The function to compute a new mapping.
+ * @return The new value associated with the property, or null if the property is not present.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object computeIfPresent(String key, BiFunction super String, ? super Object, ?> remappingFunction) {
+ throw new UnsupportedOperationException("computeIfPresent" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * If the value for the specified property is present, attempts to compute a new mapping given the property and its current
+ * mapped value, or removes the property if the computed value is null.
+ *
+ * @param key The property for which the mapping is to be computed.
+ * @param remappingFunction The function to compute a new mapping.
+ * @return The new value associated with the property, or null if the property is not present.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object compute(String key, BiFunction super String, ? super Object, ?> remappingFunction) {
+ throw new UnsupportedOperationException("compute" + UNSUPPORTED_OP_ERR);
+ }
+
+ /**
+ * If the specified property is not already associated with a value or is associated with null, associates it with the
+ * given non-null value. Otherwise, replaces the associated value with the results of applying the given
+ * remapping function to the current and new values.
+ *
+ * @param key The property for which the mapping is to be merged.
+ * @param value The non-null value to be merged with the existing value.
+ * @param remappingFunction The function to merge the existing and new values.
+ * @return The new value associated with the property, or null if the property is not present.
+ * @throws UnsupportedOperationException always, as the method is not supported.
+ */
+ @Override
+ public Object merge(String key, Object value, BiFunction super Object, ? super Object, ?> remappingFunction) {
+ throw new UnsupportedOperationException("merge" + UNSUPPORTED_OP_ERR);
+ }
+}
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMapProcessingException.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMapProcessingException.java
new file mode 100644
index 0000000000000..cb1e45a20b624
--- /dev/null
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMapProcessingException.java
@@ -0,0 +1,39 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.search.pipeline.common.helpers;
+
+import org.opensearch.OpenSearchException;
+import org.opensearch.OpenSearchWrapperException;
+
+/**
+ * An exception that indicates an error occurred while processing a {@link SearchRequestMap}.
+ */
+public class SearchRequestMapProcessingException extends OpenSearchException implements OpenSearchWrapperException {
+
+ /**
+ * Constructs a new SearchRequestMapProcessingException with the specified message.
+ *
+ * @param msg The error message.
+ * @param args Arguments to substitute in the error message.
+ */
+ public SearchRequestMapProcessingException(String msg, Object... args) {
+ super(msg, args);
+ }
+
+ /**
+ * Constructs a new SearchRequestMapProcessingException with the specified message and cause.
+ *
+ * @param msg The error message.
+ * @param cause The cause of the exception.
+ * @param args Arguments to substitute in the error message.
+ */
+ public SearchRequestMapProcessingException(String msg, Throwable cause, Object... args) {
+ super(msg, cause, args);
+ }
+}
diff --git a/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/package-info.java b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/package-info.java
new file mode 100644
index 0000000000000..b960ff72a9e2b
--- /dev/null
+++ b/modules/search-pipeline-common/src/main/java/org/opensearch/search/pipeline/common/helpers/package-info.java
@@ -0,0 +1,12 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+/**
+ * Provides helper classes and utilities for working with search pipeline processors.
+ */
+package org.opensearch.search.pipeline.common.helpers;
diff --git a/modules/search-pipeline-common/src/test/java/org/opensearch/search/pipeline/common/ScriptRequestProcessorTests.java b/modules/search-pipeline-common/src/test/java/org/opensearch/search/pipeline/common/ScriptRequestProcessorTests.java
new file mode 100644
index 0000000000000..2fb3b2345e7e2
--- /dev/null
+++ b/modules/search-pipeline-common/src/test/java/org/opensearch/search/pipeline/common/ScriptRequestProcessorTests.java
@@ -0,0 +1,131 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.search.pipeline.common;
+
+import org.junit.Before;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.common.unit.TimeValue;
+import org.opensearch.common.settings.Settings;
+import org.opensearch.script.MockScriptEngine;
+import org.opensearch.script.Script;
+import org.opensearch.script.ScriptModule;
+import org.opensearch.script.ScriptService;
+import org.opensearch.script.SearchScript;
+import org.opensearch.script.ScriptType;
+import org.opensearch.search.builder.SearchSourceBuilder;
+import org.opensearch.search.pipeline.common.helpers.SearchRequestMap;
+import org.opensearch.test.OpenSearchTestCase;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.HashMap;
+
+import static org.hamcrest.core.Is.is;
+import java.util.concurrent.TimeUnit;
+
+public class ScriptRequestProcessorTests extends OpenSearchTestCase {
+
+ private ScriptService scriptService;
+ private Script script;
+ private SearchScript searchScript;
+
+ @Before
+ public void setupScripting() {
+ String scriptName = "search_script";
+ scriptService = new ScriptService(
+ Settings.builder().build(),
+ Map.of(Script.DEFAULT_SCRIPT_LANG, new MockScriptEngine(Script.DEFAULT_SCRIPT_LANG, Map.of(scriptName, ctx -> {
+ Object sourceObj = ctx.get("_source");
+ if (sourceObj instanceof Map) {
+ Map source = (SearchRequestMap) sourceObj;
+
+ // Update all modifiable source fields
+ Integer from = (Integer) source.get("from");
+ source.put("from", from + 10);
+
+ Integer size = (Integer) source.get("size");
+ source.put("size", size + 10);
+
+ Boolean explain = (Boolean) source.get("explain");
+ source.put("explain", !explain);
+
+ Boolean version = (Boolean) source.get("version");
+ source.put("version", !version);
+
+ Boolean seqNoAndPrimaryTerm = (Boolean) source.get("seq_no_primary_term");
+ source.put("seq_no_primary_term", !seqNoAndPrimaryTerm);
+
+ Boolean trackScores = (Boolean) source.get("track_scores");
+ source.put("track_scores", !trackScores);
+
+ Integer trackTotalHitsUpTo = (Integer) source.get("track_total_hits");
+ source.put("track_total_hits", trackTotalHitsUpTo + 1);
+
+ Float minScore = (Float) source.get("min_score");
+ source.put("min_score", minScore + 1.0f);
+
+ Integer terminateAfter = (Integer) source.get("terminate_after");
+ source.put("terminate_after", terminateAfter + 1);
+ }
+ return null;
+ }), Collections.emptyMap())),
+ new HashMap<>(ScriptModule.CORE_CONTEXTS)
+ );
+ script = new Script(ScriptType.INLINE, Script.DEFAULT_SCRIPT_LANG, scriptName, Collections.emptyMap());
+ searchScript = scriptService.compile(script, SearchScript.CONTEXT).newInstance(script.getParams());
+ }
+
+ public void testScriptingWithoutPrecompiledScriptFactory() throws Exception {
+ ScriptRequestProcessor processor = new ScriptRequestProcessor(randomAlphaOfLength(10), null, script, null, scriptService);
+ SearchRequest searchRequest = new SearchRequest();
+ searchRequest.source(createSearchSourceBuilder());
+
+ assertNotNull(searchRequest);
+ processor.processRequest(searchRequest);
+ assertSearchRequest(searchRequest);
+ }
+
+ public void testScriptingWithPrecompiledIngestScript() throws Exception {
+ ScriptRequestProcessor processor = new ScriptRequestProcessor(randomAlphaOfLength(10), null, script, searchScript, scriptService);
+ SearchRequest searchRequest = new SearchRequest();
+ searchRequest.source(createSearchSourceBuilder());
+
+ assertNotNull(searchRequest);
+ processor.processRequest(searchRequest);
+ assertSearchRequest(searchRequest);
+ }
+
+ private SearchSourceBuilder createSearchSourceBuilder() {
+ SearchSourceBuilder source = new SearchSourceBuilder();
+ source.from(10);
+ source.size(20);
+ source.explain(true);
+ source.version(true);
+ source.seqNoAndPrimaryTerm(true);
+ source.trackScores(true);
+ source.trackTotalHitsUpTo(3);
+ source.minScore(1.0f);
+ source.timeout(new TimeValue(60, TimeUnit.SECONDS));
+ source.terminateAfter(5);
+ return source;
+ }
+
+ private void assertSearchRequest(SearchRequest searchRequest) {
+ assertThat(searchRequest.source().from(), is(20));
+ assertThat(searchRequest.source().size(), is(30));
+ assertThat(searchRequest.source().explain(), is(false));
+ assertThat(searchRequest.source().version(), is(false));
+ assertThat(searchRequest.source().seqNoAndPrimaryTerm(), is(false));
+ assertThat(searchRequest.source().trackScores(), is(false));
+ assertThat(searchRequest.source().trackTotalHitsUpTo(), is(4));
+ assertThat(searchRequest.source().minScore(), is(2.0f));
+ assertThat(searchRequest.source().timeout(), is(new TimeValue(60, TimeUnit.SECONDS)));
+ assertThat(searchRequest.source().terminateAfter(), is(6));
+ }
+}
diff --git a/modules/search-pipeline-common/src/test/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMapTests.java b/modules/search-pipeline-common/src/test/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMapTests.java
new file mode 100644
index 0000000000000..5572f28335e1c
--- /dev/null
+++ b/modules/search-pipeline-common/src/test/java/org/opensearch/search/pipeline/common/helpers/SearchRequestMapTests.java
@@ -0,0 +1,149 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+package org.opensearch.search.pipeline.common.helpers;
+
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.search.builder.SearchSourceBuilder;
+import org.opensearch.test.AbstractBuilderTestCase;
+
+public class SearchRequestMapTests extends AbstractBuilderTestCase {
+
+ public void testEmptyMap() {
+ SearchRequest searchRequest = new SearchRequest();
+ SearchRequestMap map = new SearchRequestMap(searchRequest);
+
+ assertTrue(map.isEmpty());
+ }
+
+ public void testGet() {
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder source = new SearchSourceBuilder();
+ source.from(10);
+ source.size(20);
+ source.explain(true);
+ source.version(true);
+ source.seqNoAndPrimaryTerm(true);
+ source.trackScores(true);
+ source.trackTotalHitsUpTo(3);
+ source.minScore(1.0f);
+ source.terminateAfter(5);
+ searchRequest.source(source);
+
+ SearchRequestMap map = new SearchRequestMap(searchRequest);
+
+ assertEquals(10, map.get("from"));
+ assertEquals(20, map.get("size"));
+ assertEquals(true, map.get("explain"));
+ assertEquals(true, map.get("version"));
+ assertEquals(true, map.get("seq_no_primary_term"));
+ assertEquals(true, map.get("track_scores"));
+ assertEquals(3, map.get("track_total_hits"));
+ assertEquals(1.0f, map.get("min_score"));
+ assertEquals(5, map.get("terminate_after"));
+ }
+
+ public void testPut() {
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder source = new SearchSourceBuilder();
+ searchRequest.source(source);
+
+ SearchRequestMap map = new SearchRequestMap(searchRequest);
+
+ assertEquals(-1, map.put("from", 10));
+ assertEquals(10, map.get("from"));
+
+ assertEquals(-1, map.put("size", 20));
+ assertEquals(20, map.get("size"));
+
+ assertNull(map.put("explain", true));
+ assertEquals(true, map.get("explain"));
+
+ assertNull(map.put("version", true));
+ assertEquals(true, map.get("version"));
+
+ assertNull(map.put("seq_no_primary_term", true));
+ assertEquals(true, map.get("seq_no_primary_term"));
+
+ assertEquals(false, map.put("track_scores", true));
+ assertEquals(true, map.get("track_scores"));
+
+ assertNull(map.put("track_total_hits", 3));
+ assertEquals(3, map.get("track_total_hits"));
+
+ assertNull(map.put("min_score", 1.0f));
+ assertEquals(1.0f, map.get("min_score"));
+
+ assertEquals(0, map.put("terminate_after", 5));
+ assertEquals(5, map.get("terminate_after"));
+ }
+
+ public void testUnsupportedOperationException() {
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder source = new SearchSourceBuilder();
+ searchRequest.source(source);
+
+ SearchRequestMap map = new SearchRequestMap(searchRequest);
+
+ assertThrows(UnsupportedOperationException.class, () -> map.size());
+ assertThrows(UnsupportedOperationException.class, () -> map.containsValue(null));
+ assertThrows(UnsupportedOperationException.class, () -> map.remove(null));
+ assertThrows(UnsupportedOperationException.class, () -> map.putAll(null));
+ assertThrows(UnsupportedOperationException.class, map::clear);
+ assertThrows(UnsupportedOperationException.class, map::keySet);
+ assertThrows(UnsupportedOperationException.class, map::values);
+ assertThrows(UnsupportedOperationException.class, map::entrySet);
+ assertThrows(UnsupportedOperationException.class, () -> map.getOrDefault(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.forEach(null));
+ assertThrows(UnsupportedOperationException.class, () -> map.replaceAll(null));
+ assertThrows(UnsupportedOperationException.class, () -> map.putIfAbsent(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.remove(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.replace(null, null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.replace(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.computeIfAbsent(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.computeIfPresent(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.compute(null, null));
+ assertThrows(UnsupportedOperationException.class, () -> map.merge(null, null, null));
+ }
+
+ public void testIllegalArgumentException() {
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder source = new SearchSourceBuilder();
+ searchRequest.source(source);
+
+ SearchRequestMap map = new SearchRequestMap(searchRequest);
+
+ try {
+ map.get(1);
+ fail("Expected IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ public void testSearchRequestMapProcessingException() {
+ SearchRequest searchRequest = new SearchRequest();
+ SearchSourceBuilder source = new SearchSourceBuilder();
+ searchRequest.source(source);
+
+ SearchRequestMap map = new SearchRequestMap(searchRequest);
+
+ try {
+ map.get("unsupported_key");
+ fail("Expected SearchRequestMapProcessingException");
+ } catch (SearchRequestMapProcessingException e) {
+ // expected
+ }
+
+ try {
+ map.put("unsupported_key", 10);
+ fail("Expected SearchRequestMapProcessingException");
+ } catch (SearchRequestMapProcessingException e) {
+ // expected
+ }
+ }
+}
diff --git a/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/10_basic.yml b/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/10_basic.yml
index 0d931f8587664..ca53f6cd6a7e8 100644
--- a/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/10_basic.yml
+++ b/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/10_basic.yml
@@ -12,5 +12,6 @@
nodes.info: {}
- contains: { nodes.$cluster_manager.modules: { name: search-pipeline-common } }
- - contains: { nodes.$cluster_manager.search_pipelines.processors: { type: filter_query } }
- - contains: { nodes.$cluster_manager.search_pipelines.processors: { type: rename_field } }
+ - contains: { nodes.$cluster_manager.search_pipelines.request_processors: { type: filter_query } }
+ - contains: { nodes.$cluster_manager.search_pipelines.request_processors: { type: script } }
+ - contains: { nodes.$cluster_manager.search_pipelines.response_processors: { type: rename_field } }
diff --git a/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/30_filter_query.yml b/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/30_filter_query.yml
index 730b10d87e6a8..d5fe91aab5378 100644
--- a/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/30_filter_query.yml
+++ b/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/30_filter_query.yml
@@ -122,3 +122,27 @@ teardown:
index: test
body: { }
- match: { hits.total.value: 2 }
+---
+"Test invalid inline query":
+ - do:
+ catch: bad_request
+ search:
+ index: test
+ body: {
+ search_pipeline: {
+ "request_processors": [
+ {
+ "filter_query": {
+ "query": {
+ "woozlewuzzle": {
+ "field": "foo"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ - match: { status: 400 }
+ - match: { error.type: "parsing_exception"}
+ - match: { error.reason: "unknown query [woozlewuzzle]"}
diff --git a/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/50_script_processor.yml b/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/50_script_processor.yml
new file mode 100644
index 0000000000000..9b2dc0c41ff31
--- /dev/null
+++ b/modules/search-pipeline-common/src/yamlRestTest/resources/rest-api-spec/test/search_pipeline/50_script_processor.yml
@@ -0,0 +1,92 @@
+---
+teardown:
+ - do:
+ search_pipeline.delete:
+ id: "my_pipeline"
+ ignore: 404
+
+---
+"Test empty script in script processor":
+ - do:
+ catch: bad_request
+ search_pipeline.put:
+ id: "my_pipeline"
+ body: >
+ {
+ "description": "_description",
+ "request_processors": [
+ {
+ "script" : {
+ "lang": "painless",
+ "source" : ""
+ }
+ }
+ ]
+ }
+
+ - match: { status: 400 }
+ - match: { error.root_cause.0.type: "script_exception" }
+
+---
+"Test supported search source builder fields":
+ - do:
+ search_pipeline.put:
+ id: "my_pipeline"
+ body: >
+ {
+ "description": "_description",
+ "request_processors": [
+ {
+ "script" : {
+ "lang" : "painless",
+ "source" : "ctx._source['size'] += 10; ctx._source['from'] -= 1; ctx._source['explain'] = !ctx._source['explain']; ctx._source['version'] = !ctx._source['version']; ctx._source['seq_no_primary_term'] = !ctx._source['seq_no_primary_term']; ctx._source['track_scores'] = !ctx._source['track_scores']; ctx._source['track_total_hits'] = 1; ctx._source['min_score'] -= 0.9; ctx._source['terminate_after'] += 2; ctx._source['profile'] = !ctx._source['profile'];"
+ }
+ }
+ ]
+ }
+ - match: { acknowledged: true }
+
+ - do:
+ index:
+ index: test
+ id: 1
+ body: {
+ "field": 2
+ }
+ - do:
+ index:
+ index: test
+ id: 2
+ body: {
+ "field": 3
+ }
+
+ - do:
+ indices.refresh:
+ index: test
+
+ - do:
+ search:
+ index: test
+ search_pipeline: "my_pipeline"
+ body: {
+ "from": 1,
+ "size": 1,
+ "explain": true,
+ "version": true,
+ "seq_no_primary_term": true,
+ "track_scores": true,
+ "track_total_hits": true,
+ "min_score": 1.0,
+ "timeout": "60s",
+ "terminate_after": 2,
+ "profile": true
+ }
+ - length: { hits.hits: 2 }
+ - is_false: hits.hits.0._explanation
+ - is_false: hits.hits.1._explanation
+ - is_false: hits.hits.0._seq_no
+ - is_false: hits.hits.1._seq_no
+ - is_false: hits.hits.0._primary_term
+ - is_false: hits.hits.1._primary_term
+ - is_false: profile
diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle
index ba3ea044139a8..e0a491ab63d7b 100644
--- a/modules/transport-netty4/build.gradle
+++ b/modules/transport-netty4/build.gradle
@@ -185,13 +185,8 @@ thirdPartyAudit {
'org.slf4j.LoggerFactory',
'org.slf4j.spi.LocationAwareLogger',
- 'com.github.luben.zstd.Zstd',
'com.google.protobuf.nano.CodedOutputByteBufferNano',
'com.google.protobuf.nano.MessageNano',
- 'com.jcraft.jzlib.Deflater',
- 'com.jcraft.jzlib.Inflater',
- 'com.jcraft.jzlib.JZlib$WrapperType',
- 'com.jcraft.jzlib.JZlib',
'com.ning.compress.BufferRecycler',
'com.ning.compress.lzf.ChunkDecoder',
'com.ning.compress.lzf.ChunkEncoder',
diff --git a/modules/transport-netty4/licenses/netty-buffer-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-buffer-4.1.91.Final.jar.sha1
deleted file mode 100644
index 158024bc892d5..0000000000000
--- a/modules/transport-netty4/licenses/netty-buffer-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d8f180291c3501e931968ca7e40ae0323c4eacee
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-buffer-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-buffer-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..5c5a17a9466f1
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-buffer-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+87fac21f4ef95157866b07b48e3c707a2f13c581
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-codec-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-codec-4.1.91.Final.jar.sha1
deleted file mode 100644
index 764a03d3d73d1..0000000000000
--- a/modules/transport-netty4/licenses/netty-codec-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-3044b8e325e33f72c96ac1ea51dda85bef090cc0
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-codec-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-codec-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..2b12a111335a2
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-codec-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+503badb458b6586632be8d1f81aa4e5ab99a80fc
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-codec-http-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-codec-http-4.1.91.Final.jar.sha1
deleted file mode 100644
index ca956129d98c1..0000000000000
--- a/modules/transport-netty4/licenses/netty-codec-http-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4519d2ff470941f0086214b19c9acf992868112f
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-codec-http-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-codec-http-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..6719e882e40fe
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-codec-http-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+36acf0c94d03eb6ecef78a749a32cbb7dc0c57b4
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-codec-http2-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-codec-http2-4.1.91.Final.jar.sha1
deleted file mode 100644
index d57336af7f414..0000000000000
--- a/modules/transport-netty4/licenses/netty-codec-http2-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4ee7027e1653c6ee3f843191e0d932f29e8e14e1
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-codec-http2-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..02423842d6244
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+0f1625b43bde13ec057da0d2fe381ded2547a70e
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-common-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-common-4.1.91.Final.jar.sha1
deleted file mode 100644
index deaad405402f2..0000000000000
--- a/modules/transport-netty4/licenses/netty-common-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-93e5056462a242718e7689d81180d125c79d7723
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-common-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-common-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..2324a54dc5735
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-common-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+1cfc49b91b0d3ddb30c9f7d8467e5d02ae8babdf
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-handler-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-handler-4.1.91.Final.jar.sha1
deleted file mode 100644
index 3e121e5de16b8..0000000000000
--- a/modules/transport-netty4/licenses/netty-handler-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-444cf41e4fe28c47ffebba5e77b9458a12f938a1
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-handler-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-handler-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..54e5b22047812
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-handler-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+10f7ed9d8e1bfcba416074c70e5388be96116bfc
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-resolver-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-resolver-4.1.91.Final.jar.sha1
deleted file mode 100644
index bc57e2d01a2bf..0000000000000
--- a/modules/transport-netty4/licenses/netty-resolver-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-04725d117d4b71ef0e743aa79062489b45472b26
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-resolver-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-resolver-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..c795762c2d7f1
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-resolver-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+3860e99075f9e078364ed38f6d6fc8825b7a168a
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-transport-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-transport-4.1.91.Final.jar.sha1
deleted file mode 100644
index 2562ece34790b..0000000000000
--- a/modules/transport-netty4/licenses/netty-transport-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c2f6bd7143194ca842b535546a405c06aa993934
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-transport-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-transport-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..687cade3c7b3a
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-transport-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+1a0894915c8027ce83b4d6a811c4e765955efd15
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.91.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.91.Final.jar.sha1
deleted file mode 100644
index 6f45d642c8c0d..0000000000000
--- a/modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-80990b5885b8b67be096d7090cba18f05c67120e
\ No newline at end of file
diff --git a/modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1 b/modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..0f0acb2eccddf
--- /dev/null
+++ b/modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+f4fb8b4c8da539091f43abcbb9f0389e48807eea
\ No newline at end of file
diff --git a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4MessageChannelHandler.java b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4MessageChannelHandler.java
index ad2e287f7a28d..5e01823bf808c 100644
--- a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4MessageChannelHandler.java
+++ b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4MessageChannelHandler.java
@@ -42,8 +42,8 @@
import org.opensearch.ExceptionsHelper;
import org.opensearch.common.bytes.BytesReference;
import org.opensearch.common.bytes.ReleasableBytesReference;
-import org.opensearch.common.lease.Releasables;
import org.opensearch.common.util.PageCacheRecycler;
+import org.opensearch.common.lease.Releasables;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.InboundPipeline;
import org.opensearch.transport.Transport;
diff --git a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java
index 444cf420e4110..5bf515548eb54 100644
--- a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java
+++ b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Transport.java
@@ -53,7 +53,6 @@
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.io.stream.NamedWriteableRegistry;
-import org.opensearch.common.lease.Releasables;
import org.opensearch.common.network.NetworkService;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Setting.Property;
@@ -63,6 +62,7 @@
import org.opensearch.common.util.PageCacheRecycler;
import org.opensearch.common.util.concurrent.OpenSearchExecutors;
import org.opensearch.common.util.net.NetUtils;
+import org.opensearch.common.lease.Releasables;
import org.opensearch.indices.breaker.CircuitBreakerService;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Netty4NioSocketChannel;
diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..b5c59c8f5ed8c
--- /dev/null
+++ b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+e31f7c161ad2b7652b1ac9100b4fa67d52be86eb
\ No newline at end of file
diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 36207cb3ba7de..0000000000000
--- a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5da04f8baf0d0961eee28fc1ca0dde93f58bd3e5
\ No newline at end of file
diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..e3f1d7afdc72a
--- /dev/null
+++ b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+ed13aaa5843c76ba8bb9fcd1cac6de8855ea7f1c
\ No newline at end of file
diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 3d7e75eca8126..0000000000000
--- a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c5307fbb67bd0901e07d2987d4c3e33dc7d9dd62
\ No newline at end of file
diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..12210d41b4e6f
--- /dev/null
+++ b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+f8673a2b86d3868e9ef2745d1d3fa9ad5a63e84f
\ No newline at end of file
diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 82f1d60f1970a..0000000000000
--- a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-668dd1d3506840f6a258efda8a4f5e0ae0f069eb
\ No newline at end of file
diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..307d90ca834b6
--- /dev/null
+++ b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+f7a585d5f62033f19a5ec79b66a74cc24c9e9d10
\ No newline at end of file
diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 96e07339bbebe..0000000000000
--- a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-df49e950d6463df63546b0989b46a717424b48c0
\ No newline at end of file
diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..b4e595a07ffda
--- /dev/null
+++ b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+40ba622c3aa91a0a8f2747617fef8f59bf212345
\ No newline at end of file
diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 62fbf8fd39c73..0000000000000
--- a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-06abcf12423dc8f115f2bb4c269b6ba2202245c2
\ No newline at end of file
diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..9b6dcc21465fa
--- /dev/null
+++ b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+e08432a3db0bde29f425812896bd695c5477b05f
\ No newline at end of file
diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index b038010aa271f..0000000000000
--- a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0c2f7b681c54ff2f174a894c0bcc26030d1644c2
\ No newline at end of file
diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.7.0-snapshot-204acc3.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.7.0-snapshot-204acc3.jar.sha1
new file mode 100644
index 0000000000000..b70b4e8d6c35b
--- /dev/null
+++ b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.7.0-snapshot-204acc3.jar.sha1
@@ -0,0 +1 @@
+a44008e83286060f0265a32f9a9b586e86ec03b1
\ No newline at end of file
diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.7.0-snapshot-4d1ed9e.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.7.0-snapshot-4d1ed9e.jar.sha1
deleted file mode 100644
index 8a60f1eb31e08..0000000000000
--- a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.7.0-snapshot-4d1ed9e.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ac785becbaf914830deeb950626b850cd89efadf
\ No newline at end of file
diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle
index c88d19f0e2806..1fed446016647 100644
--- a/plugins/discovery-azure-classic/build.gradle
+++ b/plugins/discovery-azure-classic/build.gradle
@@ -53,7 +53,7 @@ dependencies {
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
api "commons-lang:commons-lang:2.6"
- api "commons-io:commons-io:2.11.0"
+ api "commons-io:commons-io:2.13.0"
api 'javax.mail:mail:1.4.7'
api 'javax.inject:javax.inject:1'
api "com.sun.jersey:jersey-client:${versions.jersey}"
diff --git a/plugins/discovery-azure-classic/licenses/commons-io-2.11.0.jar.sha1 b/plugins/discovery-azure-classic/licenses/commons-io-2.11.0.jar.sha1
deleted file mode 100644
index 8adec30bade49..0000000000000
--- a/plugins/discovery-azure-classic/licenses/commons-io-2.11.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a2503f302b11ebde7ebc3df41daebe0e4eea3689
\ No newline at end of file
diff --git a/plugins/discovery-azure-classic/licenses/commons-io-2.13.0.jar.sha1 b/plugins/discovery-azure-classic/licenses/commons-io-2.13.0.jar.sha1
new file mode 100644
index 0000000000000..c165136eb5822
--- /dev/null
+++ b/plugins/discovery-azure-classic/licenses/commons-io-2.13.0.jar.sha1
@@ -0,0 +1 @@
+8bb2bc9b4df17e2411533a0708a69f983bf5e83b
\ No newline at end of file
diff --git a/plugins/discovery-ec2/README.md b/plugins/discovery-ec2/README.md
new file mode 100644
index 0000000000000..6daeb6305b988
--- /dev/null
+++ b/plugins/discovery-ec2/README.md
@@ -0,0 +1,94 @@
+# discovery-ec2
+
+The discovery-ec2 plugin allows OpenSearch to find the master-eligible nodes in a cluster running on AWS EC2 by querying the AWS Instance Metadata Service ([IMDS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)) API for the addresses of the EC2 instances running these nodes.
+
+This is typically configured as follows in `opensearch.yml`.
+
+```yml
+cluster.initial_cluster_manager_nodes: ["seed"]
+discovery.seed_providers: ec2
+discovery.ec2.tag.role: my-cluster-manager
+```
+
+The implementation in the discovery-ec2 plugin queries for instances of a given type (e.g. private or public IP), with a tag, or running in a specific availability zone.
+
+## Testing
+
+### Unit and Integration Tests
+
+```
+./gradlew :plugins:discovery-ec2:check
+```
+
+### Manual Testing
+
+The following instructions manually exercise the plugin.
+
+Setup a 5-node (Ubuntu) cluster on EC2, with 3 of them tagged with `role: my-cluster-manager`, and a custom TCP rule to expose ports 9200 to 9300 to allow TCP traffic. Default EC2 configuration only allows SSH TCP traffic and hence only exposes port 22.
+
+Set the following properties.
+
+- `network.host`: Set this to the IP of the eth0 network adapter, can be fetched by `ipconfig` or by running `hostname -I` on Linux hosts.
+- `discovery.seed_hosts`: List of all nodes in the cluster.
+- `cluster.initial_cluster_manager_nodes`: List of all initial cluster manager nodes.
+- `discovery.seed_providers`: Set this to `ec2` for EC2 IMDS based discovery.
+- `discovery.ec2.tag.role: my-cluster-manager`: Filter out only those nodes with value `my-cluster-manager` for the `role` tag.
+- `discovery.ec2.region`: Optionally set to your region, e.g. `us-east-1`, by default the plugin uses the region of the current EC2 instance.
+
+While sending the request to IMDS, specified discovery settings for finding master-eligible nodes are being set. You will see the following in the logs.
+
+```
+[2023-05-31T15:22:39,274][DEBUG][o.o.d.e.AwsEc2SeedHostsProvider] [ip-172-31-73-184] using host_type [private_ip], tags [{role=[my-cluster-manager]}], groups [[]] with any_group [true], availability_zones [[]]
+```
+
+The nodes getting added as eligible masters are ones with the role tag set to `my-cluster-manager`.
+
+```
+[2023-05-31T15:23:03,676][TRACE][o.o.d.e.AwsEc2SeedHostsProvider] [ip-172-31-73-184] finding seed nodes...
+[2023-05-31T15:23:03,677][TRACE][o.o.d.e.AwsEc2SeedHostsProvider] [ip-172-31-73-184] adding i-01fa1736e8566c693, address 172.31.73.184, transport_address 172.31.73.184:9300
+[2023-05-31T15:23:03,677][TRACE][o.o.d.e.AwsEc2SeedHostsProvider] [ip-172-31-73-184] adding i-03d70a4521045cc3b, address 172.31.74.169, transport_address 172.31.74.169:9300
+[2023-05-31T15:23:03,677][TRACE][o.o.d.e.AwsEc2SeedHostsProvider] [ip-172-31-73-184] adding i-0c6ffdd10ebd3c2f1, address 172.31.74.156, transport_address 172.31.74.156:9300
+```
+
+## Troubleshooting
+
+### Trace Level Logs
+
+Enable `TRACE`-level logging in `opensearch.yml` to see more output.
+
+```yml
+logger.org.opensearch.discovery.ec2: trace
+```
+
+### Sample IMDS Query
+
+You may need to query IMDS without running OpenSearch. Use [this sample](https://github.com/dblock/aws-imds-sample) or copy the following code that makes a query to IMDS that looks for `running`, `pending` or `stopped` instances.
+
+```java
+DefaultCredentialsProvider credentialsProviderChain = DefaultCredentialsProvider.create();
+
+RetryPolicy retryPolicy = RetryPolicy.builder()
+ .numRetries(10)
+ .build();
+
+Ec2Client client = Ec2Client.builder()
+ .httpClientBuilder(ApacheHttpClient.builder())
+ .credentialsProvider(credentialsProviderChain)
+ .build();
+
+DescribeInstancesRequest describeInstancesRequest = DescribeInstancesRequest.builder()
+ .filters(
+ Filter.builder()
+ .name("instance-state-name")
+ .values("running", "pending", "stopped")
+ .build()
+ ).build();
+
+DescribeInstancesResponse describeInstancesResponse = client.describeInstances(describeInstancesRequest);
+for (final Reservation reservation : describeInstancesResponse.reservations()) {
+ System.out.println(reservation.reservationId());
+ for (final Instance instance : reservation.instances()) {
+ System.out.println("\t" + instance.publicDnsName());
+ }
+}
+```
diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle
index 1766aa14ea9e9..9c9f64f09b915 100644
--- a/plugins/discovery-ec2/build.gradle
+++ b/plugins/discovery-ec2/build.gradle
@@ -39,15 +39,32 @@ opensearchplugin {
}
dependencies {
- api "com.amazonaws:aws-java-sdk-ec2:${versions.aws}"
- api "com.amazonaws:aws-java-sdk-core:${versions.aws}"
+ api "software.amazon.awssdk:sdk-core:${versions.aws}"
+ api "software.amazon.awssdk:aws-core:${versions.aws}"
+ api "software.amazon.awssdk:utils:${versions.aws}"
+ api "software.amazon.awssdk:auth:${versions.aws}"
+ api "software.amazon.awssdk:ec2:${versions.aws}"
+ api "software.amazon.awssdk:http-client-spi:${versions.aws}"
+ api "software.amazon.awssdk:apache-client:${versions.aws}"
+ api "software.amazon.awssdk:regions:${versions.aws}"
+ api "software.amazon.awssdk:profiles:${versions.aws}"
+ api "software.amazon.awssdk:endpoints-spi:${versions.aws}"
+ api "software.amazon.awssdk:annotations:${versions.aws}"
+ api "software.amazon.awssdk:metrics-spi:${versions.aws}"
+ api "software.amazon.awssdk:json-utils:${versions.aws}"
+ api "software.amazon.awssdk:protocol-core:${versions.aws}"
+ api "software.amazon.awssdk:aws-query-protocol:${versions.aws}"
+ api "software.amazon.awssdk:aws-json-protocol:${versions.aws}"
+ api "software.amazon.awssdk:third-party-jackson-core:${versions.aws}"
api "org.apache.httpcomponents:httpclient:${versions.httpclient}"
api "org.apache.httpcomponents:httpcore:${versions.httpcore}"
api "commons-logging:commons-logging:${versions.commonslogging}"
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
+ api "org.slf4j:slf4j-api:${versions.slf4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
+ api "org.reactivestreams:reactive-streams:${versions.reactivestreams}"
}
restResources {
@@ -57,7 +74,7 @@ restResources {
}
tasks.named("dependencyLicenses").configure {
- mapping from: /aws-java-sdk-.*/, to: 'aws-java-sdk'
+ mapping from: /software.amazon.awssdk-.*/, to: 'software.amazon.awssdk'
mapping from: /jackson-.*/, to: 'jackson'
}
@@ -90,7 +107,8 @@ tasks.register("writeTestJavaPolicy") {
" permission org.bouncycastle.crypto.CryptoServicesPermission \"exportSecretKey\";",
" permission org.bouncycastle.crypto.CryptoServicesPermission \"exportPrivateKey\";",
" permission java.io.FilePermission \"\${javax.net.ssl.trustStore}\", \"read\";",
- " permission java.util.PropertyPermission \"com.amazonaws.sdk.ec2MetadataServiceEndpointOverride\", \"write\";",
+ " permission java.util.PropertyPermission \"aws.ec2MetadataServiceEndpoint\", \"write\";",
+ " permission java.io.FilePermission \"config\", \"read\";",
"};"
].join("\n")
)
@@ -98,7 +116,8 @@ tasks.register("writeTestJavaPolicy") {
javaPolicy.write(
[
"grant {",
- " permission java.util.PropertyPermission \"com.amazonaws.sdk.ec2MetadataServiceEndpointOverride\", \"write\";",
+ " permission java.util.PropertyPermission \"aws.ec2MetadataServiceEndpoint\", \"write\";",
+ " permission java.io.FilePermission \"config\", \"read\";",
"};"
].join("\n"))
}
@@ -110,7 +129,7 @@ tasks.named("test").configure {
// this is needed for insecure plugins, remove if possible!
systemProperty 'tests.artifact', project.name
- // Setting a custom policy to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property
+ // Setting a custom policy to manipulate aws.ec2MetadataServiceEndpoint system property
// it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'`
if (BuildParams.inFipsJvm){
// Using the key==value format to override default JVM security settings and policy
@@ -128,30 +147,17 @@ tasks.named("check").configure {
tasks.named("thirdPartyAudit").configure {
ignoreMissingClasses(
- // classes are missing
- 'javax.jms.Message',
- 'com.amazonaws.jmespath.JmesPathExpression',
- 'com.amazonaws.jmespath.ObjectMapperSingleton',
- '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',
- 'javax.servlet.ServletContextEvent',
- 'javax.servlet.ServletContextListener',
- 'org.apache.avalon.framework.logger.Logger',
- 'org.apache.log.Hierarchy',
- 'org.apache.log.Logger'
+ 'javax.jms.Message',
+ 'javax.servlet.ServletContextEvent',
+ 'javax.servlet.ServletContextListener',
+ 'org.apache.avalon.framework.logger.Logger',
+ 'org.apache.log.Hierarchy',
+ 'org.apache.log.Logger',
+ 'org.slf4j.impl.StaticLoggerBinder',
+ 'org.slf4j.impl.StaticMDCBinder',
+ 'org.slf4j.impl.StaticMarkerBinder',
+ 'software.amazon.eventstream.HeaderValue',
+ 'software.amazon.eventstream.Message',
+ 'software.amazon.eventstream.MessageDecoder'
)
-
- if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) {
- ignoreMissingClasses(
- 'javax.xml.bind.DatatypeConverter',
- 'javax.xml.bind.JAXBContext'
- )
- }
}
diff --git a/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties b/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties
index 7263bbcba521c..ceb9a546b9b08 100644
--- a/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties
+++ b/plugins/discovery-ec2/config/discovery-ec2/log4j2.properties
@@ -9,17 +9,17 @@
# GitHub history for details.
#
-logger.com_amazonaws.name = com.amazonaws
+logger.com_amazonaws.name = software.amazon.awssdk
logger.com_amazonaws.level = warn
-logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.name = com.amazonaws.jmx.SdkMBeanRegistrySupport
+logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.name = software.amazon.awssdk.jmx.SdkMBeanRegistrySupport
logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.level = error
-logger.com_amazonaws_metrics_AwsSdkMetrics.name = com.amazonaws.metrics.AwsSdkMetrics
+logger.com_amazonaws_metrics_AwsSdkMetrics.name = software.amazon.awssdk.metrics.AwsSdkMetrics
logger.com_amazonaws_metrics_AwsSdkMetrics.level = error
-logger.com_amazonaws_auth_profile_internal_BasicProfileConfigFileLoader.name = com.amazonaws.auth.profile.internal.BasicProfileConfigFileLoader
+logger.com_amazonaws_auth_profile_internal_BasicProfileConfigFileLoader.name = software.amazon.awssdk.auth.profile.internal.BasicProfileConfigFileLoader
logger.com_amazonaws_auth_profile_internal_BasicProfileConfigFileLoader.level = error
-logger.com_amazonaws_services_s3_internal_UseArnRegionResolver.name = com.amazonaws.services.s3.internal.UseArnRegionResolver
+logger.com_amazonaws_services_s3_internal_UseArnRegionResolver.name = software.amazon.awssdk.services.s3.internal.UseArnRegionResolver
logger.com_amazonaws_services_s3_internal_UseArnRegionResolver.level = error
diff --git a/plugins/discovery-ec2/licenses/annotations-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/annotations-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..5a626eeb5725b
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/annotations-2.20.55.jar.sha1
@@ -0,0 +1 @@
+330e9d0e5f2401fffba5afe30f3740f400e8308d
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/annotations-LICENSE.txt b/plugins/discovery-ec2/licenses/annotations-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/annotations-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/annotations-NOTICE.txt b/plugins/discovery-ec2/licenses/annotations-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/annotations-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/apache-client-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/apache-client-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..3ee96bb6e4076
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/apache-client-2.20.55.jar.sha1
@@ -0,0 +1 @@
+5c149885667d41a306769505cfa481cfddf6f113
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/apache-client-LICENSE.txt b/plugins/discovery-ec2/licenses/apache-client-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/apache-client-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/apache-client-NOTICE.txt b/plugins/discovery-ec2/licenses/apache-client-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/apache-client-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/auth-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/auth-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..010464bdf9fd1
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/auth-2.20.55.jar.sha1
@@ -0,0 +1 @@
+e21f00a8a2096d5044f3eff176944256e01a175e
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/auth-LICENSE.txt b/plugins/discovery-ec2/licenses/auth-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/auth-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/auth-NOTICE.txt b/plugins/discovery-ec2/licenses/auth-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/auth-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/aws-core-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/aws-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..4b4ee1db864a8
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+734427c2cece98a8cb90871b78d2311e4a7ef746
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/aws-core-LICENSE.txt b/plugins/discovery-ec2/licenses/aws-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/aws-core-NOTICE.txt b/plugins/discovery-ec2/licenses/aws-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/aws-java-sdk-LICENSE.txt b/plugins/discovery-ec2/licenses/aws-java-sdk-LICENSE.txt
deleted file mode 100644
index 98d1f9319f374..0000000000000
--- a/plugins/discovery-ec2/licenses/aws-java-sdk-LICENSE.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Apache License
-Version 2.0, January 2004
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
- 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
- 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
- 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
- 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-Note: Other license terms may apply to certain, identified software files contained within or distributed with the accompanying software if such terms are included in the directory containing the accompanying software. Such other license terms will then apply in lieu of the terms of the software license above.
-
-JSON processing code subject to the JSON License from JSON.org:
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/plugins/discovery-ec2/licenses/aws-java-sdk-NOTICE.txt b/plugins/discovery-ec2/licenses/aws-java-sdk-NOTICE.txt
deleted file mode 100644
index 565bd6085c71a..0000000000000
--- a/plugins/discovery-ec2/licenses/aws-java-sdk-NOTICE.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-AWS SDK for Java
-Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-
-This product includes software developed by
-Amazon Technologies, Inc (http://www.amazon.com/).
-
-**********************
-THIRD PARTY COMPONENTS
-**********************
-This software includes third party software subject to the following copyrights:
-- XML parsing and utility functions from JetS3t - Copyright 2006-2009 James Murty.
-- JSON parsing and utility functions from JSON.org - Copyright 2002 JSON.org.
-- PKCS#1 PEM encoded private key parsing and utility functions from oauth.googlecode.com - Copyright 1998-2010 AOL Inc.
-
-The licenses for these third party components are included in LICENSE.txt
diff --git a/plugins/discovery-ec2/licenses/aws-java-sdk-core-1.12.270.jar.sha1 b/plugins/discovery-ec2/licenses/aws-java-sdk-core-1.12.270.jar.sha1
deleted file mode 100644
index ce40f68b3e229..0000000000000
--- a/plugins/discovery-ec2/licenses/aws-java-sdk-core-1.12.270.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-8f0cc2cc1b41c51e2117f5b1ce6530febf99d4ba
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/aws-java-sdk-ec2-1.12.270.jar.sha1 b/plugins/discovery-ec2/licenses/aws-java-sdk-ec2-1.12.270.jar.sha1
deleted file mode 100644
index ac00f6d4e8038..0000000000000
--- a/plugins/discovery-ec2/licenses/aws-java-sdk-ec2-1.12.270.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-6d0ce44b33006e163c25f394f869e6b3a51aefc5
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/aws-json-protocol-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/aws-json-protocol-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..45a88305c1928
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-json-protocol-2.20.55.jar.sha1
@@ -0,0 +1 @@
+a52731c86b974aefa5bbb1c545f407811a0163b1
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/aws-json-protocol-LICENSE.txt b/plugins/discovery-ec2/licenses/aws-json-protocol-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-json-protocol-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/aws-json-protocol-NOTICE.txt b/plugins/discovery-ec2/licenses/aws-json-protocol-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-json-protocol-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/aws-query-protocol-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/aws-query-protocol-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..ba5f43378730c
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-query-protocol-2.20.55.jar.sha1
@@ -0,0 +1 @@
+ac116215cc85366f0bdffee53b4c21e7a7fe03ef
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/aws-query-protocol-LICENSE.txt b/plugins/discovery-ec2/licenses/aws-query-protocol-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-query-protocol-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/aws-query-protocol-NOTICE.txt b/plugins/discovery-ec2/licenses/aws-query-protocol-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/aws-query-protocol-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/ec2-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/ec2-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..f123343bfe27e
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/ec2-2.20.55.jar.sha1
@@ -0,0 +1 @@
+c095e527442835130b18387da6b1d01f365a6dbf
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/ec2-LICENSE.txt b/plugins/discovery-ec2/licenses/ec2-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/ec2-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/ec2-NOTICE.txt b/plugins/discovery-ec2/licenses/ec2-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/ec2-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/endpoints-spi-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/endpoints-spi-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..5bc0e31166c77
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/endpoints-spi-2.20.55.jar.sha1
@@ -0,0 +1 @@
+085f82038ee86a7d6cd568fe7edd842978d92de3
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/endpoints-spi-LICENSE.txt b/plugins/discovery-ec2/licenses/endpoints-spi-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/endpoints-spi-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/endpoints-spi-NOTICE.txt b/plugins/discovery-ec2/licenses/endpoints-spi-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/endpoints-spi-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/http-client-spi-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/http-client-spi-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..523cf43dcb2e9
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/http-client-spi-2.20.55.jar.sha1
@@ -0,0 +1 @@
+34f9b10c1a46038a0ceebdd750ba3a413a862ceb
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/http-client-spi-LICENSE.txt b/plugins/discovery-ec2/licenses/http-client-spi-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/http-client-spi-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/http-client-spi-NOTICE.txt b/plugins/discovery-ec2/licenses/http-client-spi-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/http-client-spi-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/jackson-annotations-2.15.1.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-annotations-2.15.1.jar.sha1
deleted file mode 100644
index a3ade4ff8dadc..0000000000000
--- a/plugins/discovery-ec2/licenses/jackson-annotations-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-092a90d3739e970e03b5971839e4fe51f13c1fa3
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/jackson-annotations-2.15.2.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-annotations-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f63416ddb8ceb
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/jackson-annotations-2.15.2.jar.sha1
@@ -0,0 +1 @@
+4724a65ac8e8d156a24898d50fd5dbd3642870b8
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.15.1.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.15.1.jar.sha1
deleted file mode 100644
index 47405b86d4a51..0000000000000
--- a/plugins/discovery-ec2/licenses/jackson-databind-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ac9ba74d208faf356e4719a49e59c6ea9237c01d
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.15.2.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f16d80af8dce6
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/jackson-databind-2.15.2.jar.sha1
@@ -0,0 +1 @@
+9353b021f10c307c00328f52090de2bdb4b6ff9c
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/json-utils-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/json-utils-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..a19b00e62f8b5
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/json-utils-2.20.55.jar.sha1
@@ -0,0 +1 @@
+cd6710900e3190eac4c4496ae529ce08680dd320
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/json-utils-LICENSE.txt b/plugins/discovery-ec2/licenses/json-utils-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/json-utils-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/json-utils-NOTICE.txt b/plugins/discovery-ec2/licenses/json-utils-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/json-utils-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/metrics-spi-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/metrics-spi-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..db6701d87892a
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/metrics-spi-2.20.55.jar.sha1
@@ -0,0 +1 @@
+8a0eae705b27465516f3b09cc9918e40963d534d
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/metrics-spi-LICENSE.txt b/plugins/discovery-ec2/licenses/metrics-spi-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/metrics-spi-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/metrics-spi-NOTICE.txt b/plugins/discovery-ec2/licenses/metrics-spi-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/metrics-spi-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/profiles-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/profiles-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..b7104cf0939e6
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/profiles-2.20.55.jar.sha1
@@ -0,0 +1 @@
+959aad08b2f24057bf286c761b49e3af31a0a623
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/profiles-LICENSE.txt b/plugins/discovery-ec2/licenses/profiles-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/profiles-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/profiles-NOTICE.txt b/plugins/discovery-ec2/licenses/profiles-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/profiles-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/protocol-core-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/protocol-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..4dee45f4d9dd3
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/protocol-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+0935e3ab32962a890f1d13bf39ba2167d9d692f9
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/protocol-core-LICENSE.txt b/plugins/discovery-ec2/licenses/protocol-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/protocol-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/protocol-core-NOTICE.txt b/plugins/discovery-ec2/licenses/protocol-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/protocol-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/reactive-streams-1.0.4.jar.sha1 b/plugins/discovery-ec2/licenses/reactive-streams-1.0.4.jar.sha1
new file mode 100644
index 0000000000000..45a80e3f7e361
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/reactive-streams-1.0.4.jar.sha1
@@ -0,0 +1 @@
+3864a1320d97d7b045f729a326e1e077661f31b7
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/reactive-streams-LICENSE.txt b/plugins/discovery-ec2/licenses/reactive-streams-LICENSE.txt
new file mode 100644
index 0000000000000..1e3c7e7c77495
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/reactive-streams-LICENSE.txt
@@ -0,0 +1,21 @@
+MIT No Attribution
+
+Copyright 2014 Reactive Streams
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/reactive-streams-NOTICE.txt b/plugins/discovery-ec2/licenses/reactive-streams-NOTICE.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/plugins/discovery-ec2/licenses/regions-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/regions-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..993fc2f97de62
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/regions-2.20.55.jar.sha1
@@ -0,0 +1 @@
+a117c19b4a30e902f4f1cc4bef6b5c10cc9aef31
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/regions-LICENSE.txt b/plugins/discovery-ec2/licenses/regions-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/regions-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/regions-NOTICE.txt b/plugins/discovery-ec2/licenses/regions-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/regions-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/sdk-core-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/sdk-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..5f12be9c08c5b
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/sdk-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+8f2347feaf2575560ca89a2caa8d0243dbeb17a9
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/sdk-core-LICENSE.txt b/plugins/discovery-ec2/licenses/sdk-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/sdk-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/sdk-core-NOTICE.txt b/plugins/discovery-ec2/licenses/sdk-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/sdk-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/slf4j-api-1.7.36.jar.sha1 b/plugins/discovery-ec2/licenses/slf4j-api-1.7.36.jar.sha1
new file mode 100644
index 0000000000000..77b9917528382
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/slf4j-api-1.7.36.jar.sha1
@@ -0,0 +1 @@
+6c62681a2f655b49963a5983b8b0950a6120ae14
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/slf4j-api-LICENSE.txt b/plugins/discovery-ec2/licenses/slf4j-api-LICENSE.txt
new file mode 100644
index 0000000000000..2be7689435062
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/slf4j-api-LICENSE.txt
@@ -0,0 +1,21 @@
+Copyright (c) 2004-2022 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/slf4j-api-NOTICE.txt b/plugins/discovery-ec2/licenses/slf4j-api-NOTICE.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/plugins/discovery-ec2/licenses/third-party-jackson-core-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/third-party-jackson-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..e7eebbb98f1fe
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/third-party-jackson-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+956912f26056fc7d46b2db566362fe5f7a8c0e14
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/third-party-jackson-core-LICENSE.txt b/plugins/discovery-ec2/licenses/third-party-jackson-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/third-party-jackson-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/third-party-jackson-core-NOTICE.txt b/plugins/discovery-ec2/licenses/third-party-jackson-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/third-party-jackson-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/licenses/utils-2.20.55.jar.sha1 b/plugins/discovery-ec2/licenses/utils-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..fc4cde604e33c
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/utils-2.20.55.jar.sha1
@@ -0,0 +1 @@
+d3e1bbbc19795eadbeb4dd963a94647576644097
\ No newline at end of file
diff --git a/plugins/discovery-ec2/licenses/utils-LICENSE.txt b/plugins/discovery-ec2/licenses/utils-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/utils-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/discovery-ec2/licenses/utils-NOTICE.txt b/plugins/discovery-ec2/licenses/utils-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/discovery-ec2/licenses/utils-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle
index d63015f25b408..a844576d67ece 100644
--- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle
+++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle
@@ -67,7 +67,7 @@ yamlRestTest.enabled = false
* Test using various credential providers (see also https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/credentials.html):
* - Elasticsearch Keystore (secure settings discovery.ec2.access_key and discovery.ec2.secret_key)
* - Java system properties (aws.accessKeyId and aws.secretAccessKey)
- * - Environment variables (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
+ * - Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION)
* - ECS container credentials (loaded from ECS if the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is set)
* - Instance profile credentials (delivered through the EC2 metadata service)
*
@@ -100,8 +100,9 @@ yamlRestTest.enabled = false
setting 'discovery.seed_providers', 'ec2'
setting 'network.host', '_ec2_'
setting 'discovery.ec2.endpoint', { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE
+ setting 'discovery.ec2.region', 'us-east-1'
- systemProperty "com.amazonaws.sdk.ec2MetadataServiceEndpointOverride", { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE
+ systemProperty "aws.ec2MetadataServiceEndpoint", { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE
}
}
@@ -115,12 +116,14 @@ testClusters.yamlRestTestKeyStore {
testClusters.yamlRestTestEnvVariables {
environment 'AWS_ACCESS_KEY_ID', 'ec2_integration_test_access_key'
environment 'AWS_SECRET_ACCESS_KEY', 'ec2_integration_test_secret_key'
+ environment 'AWS_REGION', 'ec2_integration_test_region'
}
// Extra config for SystemProperties
testClusters.yamlRestTestSystemProperties {
systemProperty 'aws.accessKeyId', 'ec2_integration_test_access_key'
- systemProperty 'aws.secretKey', 'ec2_integration_test_secret_key'
+ systemProperty 'aws.secretAccessKey', 'ec2_integration_test_secret_key'
+ systemProperty 'aws.region', 'ec2_integration_test_region'
}
// Extra config for ContainerCredentials
diff --git a/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/opensearch/discovery/ec2/AmazonEC2Fixture.java b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/opensearch/discovery/ec2/AmazonEC2Fixture.java
index 7ff6a0f0ec16a..21ff9ef0e104b 100644
--- a/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/opensearch/discovery/ec2/AmazonEC2Fixture.java
+++ b/plugins/discovery-ec2/qa/amazon-ec2/src/yamlRestTest/java/org/opensearch/discovery/ec2/AmazonEC2Fixture.java
@@ -31,7 +31,7 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.util.DateUtils;
+import software.amazon.awssdk.utils.DateUtils;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
@@ -138,7 +138,7 @@ protected Response handle(final Request request) throws IOException {
+ "ec2_integration_test_access_key"
+ "\","
+ "\"Expiration\": \""
- + DateUtils.formatISO8601Date(expiration)
+ + DateUtils.formatIso8601Date(expiration.toInstant())
+ "\","
+ "\"RoleArn\": \""
+ "test"
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AmazonEc2Reference.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AmazonEc2ClientReference.java
similarity index 80%
rename from plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AmazonEc2Reference.java
rename to plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AmazonEc2ClientReference.java
index 2686c376213f3..7d1004122c13b 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AmazonEc2Reference.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AmazonEc2ClientReference.java
@@ -32,16 +32,16 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.services.ec2.AmazonEC2;
import org.opensearch.common.concurrent.RefCountedReleasable;
+import software.amazon.awssdk.services.ec2.Ec2Client;
/**
- * Handles the shutdown of the wrapped {@link AmazonEC2} using reference
+ * Handles the shutdown of the wrapped {@link Ec2Client} using reference
* counting.
*/
-public class AmazonEc2Reference extends RefCountedReleasable {
+public class AmazonEc2ClientReference extends RefCountedReleasable {
- AmazonEc2Reference(AmazonEC2 client) {
- super("AWS_EC2_CLIENT", client, client::shutdown);
+ AmazonEc2ClientReference(Ec2Client client) {
+ super("AWS_EC2_CLIENT", client, client::close);
}
}
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2SeedHostsProvider.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2SeedHostsProvider.java
index f26ecfab501f8..4afdff7d2c272 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2SeedHostsProvider.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2SeedHostsProvider.java
@@ -32,14 +32,15 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.AmazonClientException;
-import com.amazonaws.services.ec2.model.DescribeInstancesRequest;
-import com.amazonaws.services.ec2.model.DescribeInstancesResult;
-import com.amazonaws.services.ec2.model.Filter;
-import com.amazonaws.services.ec2.model.GroupIdentifier;
-import com.amazonaws.services.ec2.model.Instance;
-import com.amazonaws.services.ec2.model.Reservation;
-import com.amazonaws.services.ec2.model.Tag;
+import software.amazon.awssdk.core.exception.SdkException;
+import software.amazon.awssdk.services.ec2.model.DescribeInstancesRequest;
+import software.amazon.awssdk.services.ec2.model.DescribeInstancesResponse;
+import software.amazon.awssdk.services.ec2.model.Instance;
+import software.amazon.awssdk.services.ec2.model.Reservation;
+import software.amazon.awssdk.services.ec2.model.Filter;
+
+import software.amazon.awssdk.services.ec2.model.GroupIdentifier;
+import software.amazon.awssdk.services.ec2.model.Tag;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -85,6 +86,8 @@ class AwsEc2SeedHostsProvider implements SeedHostsProvider {
private final TransportAddressesCache dynamicHosts;
+ private final Set instanceStates;
+
AwsEc2SeedHostsProvider(Settings settings, TransportService transportService, AwsEc2Service awsEc2Service) {
this.transportService = transportService;
this.awsEc2Service = awsEc2Service;
@@ -101,6 +104,10 @@ class AwsEc2SeedHostsProvider implements SeedHostsProvider {
this.availabilityZones = new HashSet<>();
availabilityZones.addAll(AwsEc2Service.AVAILABILITY_ZONES_SETTING.get(settings));
+ this.instanceStates = new HashSet<>();
+ instanceStates.add("running");
+ instanceStates.add("pending");
+
if (logger.isDebugEnabled()) {
logger.debug(
"using host_type [{}], tags [{}], groups [{}] with any_group [{}], availability_zones [{}]",
@@ -119,41 +126,47 @@ public List getSeedAddresses(HostsResolver hostsResolver) {
}
protected List fetchDynamicNodes() {
+ logger.info(
+ "fetching nodes from IMDS (instance-states={}, availability-zones={}, tags={}) ...",
+ instanceStates,
+ availabilityZones,
+ tags
+ );
final List dynamicHosts = new ArrayList<>();
- final DescribeInstancesResult descInstances;
- try (AmazonEc2Reference clientReference = awsEc2Service.client()) {
+ final DescribeInstancesResponse descInstances;
+ try (AmazonEc2ClientReference clientReference = awsEc2Service.client()) {
// Query EC2 API based on AZ, instance state, and tag.
// NOTE: we don't filter by security group during the describe instances request for two reasons:
// 1. differences in VPCs require different parameters during query (ID vs Name)
// 2. We want to use two different strategies: (all security groups vs. any security groups)
- descInstances = SocketAccess.doPrivileged(() -> clientReference.get().describeInstances(buildDescribeInstancesRequest()));
- } catch (final AmazonClientException e) {
- logger.info("Exception while retrieving instance list from AWS API: {}", e.getMessage());
- logger.debug("Full exception:", e);
+ DescribeInstancesRequest instancesRequest = buildDescribeInstancesRequest();
+ descInstances = SocketAccess.doPrivileged(() -> clientReference.get().describeInstances(instancesRequest));
+ } catch (final SdkException e) {
+ logger.warn("error retrieving instance list from IMDS", e);
return dynamicHosts;
}
- logger.trace("finding seed nodes...");
- for (final Reservation reservation : descInstances.getReservations()) {
- for (final Instance instance : reservation.getInstances()) {
+ logger.trace("finding seed nodes ...");
+ for (final Reservation reservation : descInstances.reservations()) {
+ for (final Instance instance : reservation.instances()) {
// lets see if we can filter based on groups
if (!groups.isEmpty()) {
- final List instanceSecurityGroups = instance.getSecurityGroups();
+ final List instanceSecurityGroups = instance.securityGroups();
final List securityGroupNames = new ArrayList<>(instanceSecurityGroups.size());
final List securityGroupIds = new ArrayList<>(instanceSecurityGroups.size());
for (final GroupIdentifier sg : instanceSecurityGroups) {
- securityGroupNames.add(sg.getGroupName());
- securityGroupIds.add(sg.getGroupId());
+ securityGroupNames.add(sg.groupName());
+ securityGroupIds.add(sg.groupId());
}
if (bindAnyGroup) {
// We check if we can find at least one group name or one group id in groups.
if (disjoint(securityGroupNames, groups) && disjoint(securityGroupIds, groups)) {
logger.trace(
"filtering out instance {} based on groups {}, not part of {}",
- instance.getInstanceId(),
+ instance.instanceId(),
instanceSecurityGroups,
groups
);
@@ -165,7 +178,7 @@ protected List fetchDynamicNodes() {
if (!(securityGroupNames.containsAll(groups) || securityGroupIds.containsAll(groups))) {
logger.trace(
"filtering out instance {} based on groups {}, does not include all of {}",
- instance.getInstanceId(),
+ instance.instanceId(),
instanceSecurityGroups,
groups
);
@@ -177,21 +190,21 @@ protected List fetchDynamicNodes() {
String address = null;
if (hostType.equals(PRIVATE_DNS)) {
- address = instance.getPrivateDnsName();
+ address = instance.privateDnsName();
} else if (hostType.equals(PRIVATE_IP)) {
- address = instance.getPrivateIpAddress();
+ address = instance.privateIpAddress();
} else if (hostType.equals(PUBLIC_DNS)) {
- address = instance.getPublicDnsName();
+ address = instance.publicDnsName();
} else if (hostType.equals(PUBLIC_IP)) {
- address = instance.getPublicIpAddress();
+ address = instance.publicIpAddress();
} else if (hostType.startsWith(TAG_PREFIX)) {
// Reading the node host from its metadata
final String tagName = hostType.substring(TAG_PREFIX.length());
logger.debug("reading hostname from [{}] instance tag", tagName);
- final List tags = instance.getTags();
+ final List tags = instance.tags();
for (final Tag tag : tags) {
- if (tag.getKey().equals(tagName)) {
- address = tag.getValue();
+ if (tag.key().equals(tagName)) {
+ address = tag.value();
logger.debug("using [{}] as the instance address", address);
}
}
@@ -202,7 +215,7 @@ protected List fetchDynamicNodes() {
try {
final TransportAddress[] addresses = transportService.addressesFromString(address);
for (int i = 0; i < addresses.length; i++) {
- logger.trace("adding {}, address {}, transport_address {}", instance.getInstanceId(), address, addresses[i]);
+ logger.debug("adding {}, address {}, transport_address {}", instance.instanceId(), address, addresses[i]);
dynamicHosts.add(addresses[i]);
}
} catch (final Exception e) {
@@ -210,39 +223,38 @@ protected List fetchDynamicNodes() {
logger.warn(
(Supplier>) () -> new ParameterizedMessage(
"failed to add {}, address {}",
- instance.getInstanceId(),
+ instance.instanceId(),
finalAddress
),
e
);
}
} else {
- logger.trace("not adding {}, address is null, host_type {}", instance.getInstanceId(), hostType);
+ logger.warn("not adding {}, address is null, host_type {}", instance.instanceId(), hostType);
}
}
}
- logger.debug("using dynamic transport addresses {}", dynamicHosts);
+ logger.info("using dynamic transport addresses {}", dynamicHosts);
return dynamicHosts;
}
private DescribeInstancesRequest buildDescribeInstancesRequest() {
- final DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest().withFilters(
- new Filter("instance-state-name").withValues("running", "pending")
- );
+ ArrayList filters = new ArrayList();
+ filters.add(Filter.builder().name("instance-state-name").values(instanceStates).build());
for (final Map.Entry> tagFilter : tags.entrySet()) {
// for a given tag key, OR relationship for multiple different values
- describeInstancesRequest.withFilters(new Filter("tag:" + tagFilter.getKey()).withValues(tagFilter.getValue()));
+ filters.add(Filter.builder().name("tag:" + tagFilter.getKey()).values(tagFilter.getValue()).build());
}
if (!availabilityZones.isEmpty()) {
// OR relationship amongst multiple values of the availability-zone filter
- describeInstancesRequest.withFilters(new Filter("availability-zone").withValues(availabilityZones));
+ filters.add(Filter.builder().name("availability-zone").values(availabilityZones).build());
}
- return describeInstancesRequest;
+ return DescribeInstancesRequest.builder().filters(filters).build();
}
private final class TransportAddressesCache extends SingleObjectCache> {
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2Service.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2Service.java
index c3ed4340467bd..58d0cdb5e87aa 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2Service.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2Service.java
@@ -43,6 +43,7 @@
import java.util.function.Function;
interface AwsEc2Service extends Closeable {
+
Setting AUTO_ATTRIBUTE_SETTING = Setting.boolSetting("cloud.node.auto_attributes", false, Property.NodeScope);
class HostType {
@@ -115,7 +116,7 @@ class HostType {
* settings. Returns an {@code AmazonEc2Reference} wrapper which should be
* released as soon as it is not required anymore.
*/
- AmazonEc2Reference client();
+ AmazonEc2ClientReference client();
/**
* Updates the settings for building the client and releases the cached one.
@@ -125,5 +126,4 @@ class HostType {
* @param clientSettings the new refreshed settings
*/
void refreshAndClearCache(Ec2ClientSettings clientSettings);
-
}
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2ServiceImpl.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2ServiceImpl.java
index e824e2463d906..2a142b841b713 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2ServiceImpl.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/AwsEc2ServiceImpl.java
@@ -32,82 +32,139 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.AWSStaticCredentialsProvider;
-import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
-import com.amazonaws.client.builder.AwsClientBuilder;
-import com.amazonaws.http.IdleConnectionReaper;
-import com.amazonaws.services.ec2.AmazonEC2;
-import com.amazonaws.services.ec2.AmazonEC2ClientBuilder;
+import java.net.URI;
+import java.net.URISyntaxException;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.OpenSearchException;
import org.opensearch.common.util.LazyInitializable;
import org.opensearch.core.common.Strings;
-
+import org.opensearch.common.SuppressForbidden;
+import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.core.exception.SdkException;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.services.ec2.Ec2Client;
+import software.amazon.awssdk.services.ec2.Ec2ClientBuilder;
+import software.amazon.awssdk.core.retry.RetryPolicy;
+
+import java.time.Duration;
import java.util.concurrent.atomic.AtomicReference;
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.profiles.ProfileFileSystemSetting;
+import software.amazon.awssdk.regions.Region;
class AwsEc2ServiceImpl implements AwsEc2Service {
-
private static final Logger logger = LogManager.getLogger(AwsEc2ServiceImpl.class);
- private final AtomicReference> lazyClientReference = new AtomicReference<>();
-
- private AmazonEC2 buildClient(Ec2ClientSettings clientSettings) {
- final AWSCredentialsProvider credentials = buildCredentials(logger, clientSettings);
- final ClientConfiguration configuration = buildConfiguration(logger, clientSettings);
- return buildClient(credentials, configuration, clientSettings.endpoint);
+ private final AtomicReference> lazyClientReference =
+ new AtomicReference<>();
+
+ private Ec2Client buildClient(Ec2ClientSettings clientSettings) {
+ SocketAccess.doPrivilegedVoid(AwsEc2ServiceImpl::setDefaultAwsProfilePath);
+ final AwsCredentialsProvider awsCredentialsProvider = buildCredentials(logger, clientSettings);
+ final ClientOverrideConfiguration overrideConfiguration = buildOverrideConfiguration(logger, clientSettings);
+ final ProxyConfiguration proxyConfiguration = SocketAccess.doPrivileged(() -> buildProxyConfiguration(logger, clientSettings));
+ return buildClient(
+ awsCredentialsProvider,
+ proxyConfiguration,
+ overrideConfiguration,
+ clientSettings.endpoint,
+ clientSettings.region,
+ clientSettings.readTimeoutMillis
+ );
}
// proxy for testing
- AmazonEC2 buildClient(AWSCredentialsProvider credentials, ClientConfiguration configuration, String endpoint) {
- final AmazonEC2ClientBuilder builder = AmazonEC2ClientBuilder.standard()
- .withCredentials(credentials)
- .withClientConfiguration(configuration);
+ protected Ec2Client buildClient(
+ AwsCredentialsProvider awsCredentialsProvider,
+ ProxyConfiguration proxyConfiguration,
+ ClientOverrideConfiguration overrideConfiguration,
+ String endpoint,
+ String region,
+ long readTimeoutMillis
+ ) {
+ ApacheHttpClient.Builder clientBuilder = ApacheHttpClient.builder()
+ .proxyConfiguration(proxyConfiguration)
+ .socketTimeout(Duration.ofMillis(readTimeoutMillis));
+
+ Ec2ClientBuilder builder = Ec2Client.builder()
+ .overrideConfiguration(overrideConfiguration)
+ .httpClientBuilder(clientBuilder)
+ .credentialsProvider(awsCredentialsProvider);
+
if (Strings.hasText(endpoint)) {
logger.debug("using explicit ec2 endpoint [{}]", endpoint);
- builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, null));
+ builder.endpointOverride(URI.create(endpoint));
}
+
+ if (Strings.hasText(region)) {
+ logger.debug("using explicit ec2 region [{}]", region);
+ builder.region(Region.of(region));
+ }
+
return SocketAccess.doPrivileged(builder::build);
}
- // pkg private for tests
- static ClientConfiguration buildConfiguration(Logger logger, Ec2ClientSettings clientSettings) {
- final ClientConfiguration clientConfiguration = new ClientConfiguration();
- // the response metadata cache is only there for diagnostics purposes,
- // but can force objects from every response to the old generation.
- clientConfiguration.setResponseMetadataCacheSize(0);
- clientConfiguration.setProtocol(clientSettings.protocol);
+ static ProxyConfiguration buildProxyConfiguration(Logger logger, Ec2ClientSettings clientSettings) {
if (Strings.hasText(clientSettings.proxyHost)) {
- // TODO: remove this leniency, these settings should exist together and be validated
- clientConfiguration.setProxyHost(clientSettings.proxyHost);
- clientConfiguration.setProxyPort(clientSettings.proxyPort);
- clientConfiguration.setProxyUsername(clientSettings.proxyUsername);
- clientConfiguration.setProxyPassword(clientSettings.proxyPassword);
+ try {
+ // TODO: remove this leniency, these settings should exist together and be validated
+ return ProxyConfiguration.builder()
+ .endpoint(
+ new URI(
+ clientSettings.protocol.toString(),
+ null,
+ clientSettings.proxyHost,
+ clientSettings.proxyPort,
+ null,
+ null,
+ null
+ )
+ )
+ .username(clientSettings.proxyUsername)
+ .password(clientSettings.proxyPassword)
+ .build();
+ } catch (URISyntaxException e) {
+ throw SdkException.create("Invalid proxy URL", e);
+ }
+ } else {
+ return ProxyConfiguration.builder().build();
}
- // Increase the number of retries in case of 5xx API responses
- clientConfiguration.setMaxErrorRetry(10);
- clientConfiguration.setSocketTimeout(clientSettings.readTimeoutMillis);
- return clientConfiguration;
+ }
+
+ static ClientOverrideConfiguration buildOverrideConfiguration(Logger logger, Ec2ClientSettings clientSettings) {
+ return ClientOverrideConfiguration.builder().retryPolicy(buildRetryPolicy(logger, clientSettings)).build();
}
// pkg private for tests
- static AWSCredentialsProvider buildCredentials(Logger logger, Ec2ClientSettings clientSettings) {
- final AWSCredentials credentials = clientSettings.credentials;
+ static RetryPolicy buildRetryPolicy(Logger logger, Ec2ClientSettings clientSettings) {
+ // Increase the number of retries in case of 5xx API responses.
+ // Note that AWS SDK v2 introduced a concept of TokenBucketRetryCondition, which effectively limits retries for
+ // APIs that have been failing continuously. It allocates tokens (default is 500), which means that once 500
+ // retries fail for any API on a bucket, new retries will only be allowed once some retries are rejected.
+ // https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/retry/conditions/TokenBucketRetryCondition.html
+ RetryPolicy.Builder retryPolicy = RetryPolicy.builder().numRetries(10);
+ return retryPolicy.build();
+ }
+
+ static AwsCredentialsProvider buildCredentials(Logger logger, Ec2ClientSettings clientSettings) {
+ final AwsCredentials credentials = clientSettings.credentials;
if (credentials == null) {
- logger.debug("Using default provider chain");
- return DefaultAWSCredentialsProviderChain.getInstance();
+ logger.debug("Using default credentials provider");
+ return DefaultCredentialsProvider.create();
} else {
logger.debug("Using basic key/secret credentials");
- return new AWSStaticCredentialsProvider(credentials);
+ return StaticCredentialsProvider.create(credentials);
}
}
@Override
- public AmazonEc2Reference client() {
- final LazyInitializable clientReference = this.lazyClientReference.get();
+ public AmazonEc2ClientReference client() {
+ final LazyInitializable clientReference = this.lazyClientReference.get();
if (clientReference == null) {
throw new IllegalStateException("Missing ec2 client configs");
}
@@ -121,12 +178,12 @@ public AmazonEc2Reference client() {
*/
@Override
public void refreshAndClearCache(Ec2ClientSettings clientSettings) {
- final LazyInitializable newClient = new LazyInitializable<>(
- () -> new AmazonEc2Reference(buildClient(clientSettings)),
+ final LazyInitializable newClient = new LazyInitializable<>(
+ () -> new AmazonEc2ClientReference(buildClient(clientSettings)),
clientReference -> clientReference.incRef(),
clientReference -> clientReference.decRef()
);
- final LazyInitializable oldClient = this.lazyClientReference.getAndSet(newClient);
+ final LazyInitializable oldClient = this.lazyClientReference.getAndSet(newClient);
if (oldClient != null) {
oldClient.reset();
}
@@ -134,13 +191,22 @@ public void refreshAndClearCache(Ec2ClientSettings clientSettings) {
@Override
public void close() {
- final LazyInitializable clientReference = this.lazyClientReference.getAndSet(null);
+ final LazyInitializable clientReference = this.lazyClientReference.getAndSet(null);
if (clientReference != null) {
clientReference.reset();
}
- // shutdown IdleConnectionReaper background thread
- // it will be restarted on new client usage
- IdleConnectionReaper.shutdown();
}
+ // By default, AWS v2 SDK loads a default profile from $USER_HOME, which is restricted. Use the OpenSearch configuration path instead.
+ @SuppressForbidden(reason = "Prevent AWS SDK v2 from using ~/.aws/config and ~/.aws/credentials.")
+ static void setDefaultAwsProfilePath() {
+ if (ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE.getStringValue().isEmpty()) {
+ logger.info("setting aws.sharedCredentialsFile={}", System.getProperty("opensearch.path.conf"));
+ System.setProperty(ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE.property(), System.getProperty("opensearch.path.conf"));
+ }
+ if (ProfileFileSystemSetting.AWS_CONFIG_FILE.getStringValue().isEmpty()) {
+ logger.info("setting aws.sharedCredentialsFile={}", System.getProperty("opensearch.path.conf"));
+ System.setProperty(ProfileFileSystemSetting.AWS_CONFIG_FILE.property(), System.getProperty("opensearch.path.conf"));
+ }
+ }
}
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2ClientSettings.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2ClientSettings.java
index 406be47503be2..8f09276e6a627 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2ClientSettings.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2ClientSettings.java
@@ -32,11 +32,6 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.Protocol;
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.BasicAWSCredentials;
-import com.amazonaws.auth.BasicSessionCredentials;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.common.logging.DeprecationLogger;
@@ -47,6 +42,10 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.SettingsException;
import org.opensearch.common.unit.TimeValue;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
+import software.amazon.awssdk.core.Protocol;
import java.util.Locale;
@@ -78,7 +77,16 @@ final class Ec2ClientSettings {
Property.NodeScope
);
- /** The protocol to use to connect to to ec2. */
+ /** An override for the scoping region for authentication. */
+ static final Setting REGION_SETTING = new Setting<>(
+ "discovery.ec2.region",
+ "",
+ s -> s.toLowerCase(Locale.ROOT),
+ Property.NodeScope
+ );
+
+ /** The protocol to use to connect to ec2. AWS SDKv2 only supports HTTPs, deprecated in 3.0. */
+ @Deprecated
static final Setting PROTOCOL_SETTING = new Setting<>(
"discovery.ec2.protocol",
"https",
@@ -95,7 +103,7 @@ final class Ec2ClientSettings {
/** The socket timeout for connecting to s3. */
static final Setting READ_TIMEOUT_SETTING = Setting.timeSetting(
"discovery.ec2.read_timeout",
- TimeValue.timeValueMillis(ClientConfiguration.DEFAULT_SOCKET_TIMEOUT),
+ TimeValue.timeValueMillis(50_000),
Property.NodeScope
);
@@ -104,7 +112,7 @@ final class Ec2ClientSettings {
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(Ec2ClientSettings.class);
/** Credentials to authenticate with ec2. */
- final AWSCredentials credentials;
+ final AwsCredentials credentials;
/**
* The ec2 endpoint the client should talk to, or empty string to use the
@@ -112,6 +120,11 @@ final class Ec2ClientSettings {
*/
final String endpoint;
+ /**
+ * The ec2 signing region.
+ */
+ final String region;
+
/** The protocol to use to talk to ec2. Defaults to https. */
final Protocol protocol;
@@ -134,8 +147,9 @@ final class Ec2ClientSettings {
final int readTimeoutMillis;
protected Ec2ClientSettings(
- AWSCredentials credentials,
+ AwsCredentials credentials,
String endpoint,
+ String region,
Protocol protocol,
String proxyHost,
int proxyPort,
@@ -145,6 +159,7 @@ protected Ec2ClientSettings(
) {
this.credentials = credentials;
this.endpoint = endpoint;
+ this.region = region;
this.protocol = protocol;
this.proxyHost = proxyHost;
this.proxyPort = proxyPort;
@@ -153,7 +168,7 @@ protected Ec2ClientSettings(
this.readTimeoutMillis = readTimeoutMillis;
}
- static AWSCredentials loadCredentials(Settings settings) {
+ static AwsCredentials loadCredentials(Settings settings) {
try (
SecureString key = ACCESS_KEY_SETTING.get(settings);
SecureString secret = SECRET_KEY_SETTING.get(settings);
@@ -173,39 +188,37 @@ static AWSCredentials loadCredentials(Settings settings) {
return null;
} else {
if (key.length() == 0) {
- deprecationLogger.deprecate(
- "ec2_invalid_key_settings",
- "Setting [{}] is set but [{}] is not, which will be unsupported in future",
+ throw new SettingsException(
+ "Setting [{}] is set but [{}] is not",
SECRET_KEY_SETTING.getKey(),
- ACCESS_KEY_SETTING.getKey()
+ ACCESS_KEY_SETTING.getKey(),
+ SECRET_KEY_SETTING.getKey()
);
}
if (secret.length() == 0) {
- deprecationLogger.deprecate(
- "ec2_invalid_settings",
- "Setting [{}] is set but [{}] is not, which will be unsupported in future",
+ throw new SettingsException(
+ "Setting [{}] is set but [{}] is not",
ACCESS_KEY_SETTING.getKey(),
SECRET_KEY_SETTING.getKey()
);
}
- final AWSCredentials credentials;
+ final AwsCredentials credentials;
if (sessionToken.length() == 0) {
logger.debug("Using basic key/secret credentials");
- credentials = new BasicAWSCredentials(key.toString(), secret.toString());
+ credentials = AwsBasicCredentials.create(key.toString(), secret.toString());
} else {
logger.debug("Using basic session credentials");
- credentials = new BasicSessionCredentials(key.toString(), secret.toString(), sessionToken.toString());
+ credentials = AwsSessionCredentials.create(key.toString(), secret.toString(), sessionToken.toString());
}
return credentials;
}
}
}
- // pkg private for tests
/** Parse settings for a single client. */
static Ec2ClientSettings getClientSettings(Settings settings) {
- final AWSCredentials credentials = loadCredentials(settings);
+ final AwsCredentials credentials = loadCredentials(settings);
try (
SecureString proxyUsername = PROXY_USERNAME_SETTING.get(settings);
SecureString proxyPassword = PROXY_PASSWORD_SETTING.get(settings)
@@ -213,6 +226,7 @@ static Ec2ClientSettings getClientSettings(Settings settings) {
return new Ec2ClientSettings(
credentials,
ENDPOINT_SETTING.get(settings),
+ REGION_SETTING.get(settings),
PROTOCOL_SETTING.get(settings),
PROXY_HOST_SETTING.get(settings),
PROXY_PORT_SETTING.get(settings),
@@ -222,5 +236,4 @@ static Ec2ClientSettings getClientSettings(Settings settings) {
);
}
}
-
}
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2DiscoveryPlugin.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2DiscoveryPlugin.java
index ef89a351e5767..e1979d9af8352 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2DiscoveryPlugin.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2DiscoveryPlugin.java
@@ -32,8 +32,6 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.util.EC2MetadataUtils;
-import com.amazonaws.util.json.Jackson;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.SpecialPermission;
@@ -47,6 +45,7 @@
import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.ReloadablePlugin;
import org.opensearch.transport.TransportService;
+import software.amazon.awssdk.core.SdkSystemSetting;
import java.io.BufferedReader;
import java.io.IOException;
@@ -56,12 +55,11 @@
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.function.Supplier;
public class Ec2DiscoveryPlugin extends Plugin implements DiscoveryPlugin, ReloadablePlugin {
@@ -71,20 +69,6 @@ public class Ec2DiscoveryPlugin extends Plugin implements DiscoveryPlugin, Reloa
static {
SpecialPermission.check();
- // Initializing Jackson requires RuntimePermission accessDeclaredMembers
- // The ClientConfiguration class requires RuntimePermission getClassLoader
- AccessController.doPrivileged((PrivilegedAction) () -> {
- try {
- // kick jackson to do some static caching of declared members info
- Jackson.jsonNodeOf("{}");
- // ClientConfiguration clinit has some classloader problems
- // TODO: fix that
- Class.forName("com.amazonaws.ClientConfiguration");
- } catch (final ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- return null;
- });
}
private final Settings settings;
@@ -121,6 +105,7 @@ public List> getSettings() {
Ec2ClientSettings.SECRET_KEY_SETTING,
Ec2ClientSettings.SESSION_TOKEN_SETTING,
Ec2ClientSettings.ENDPOINT_SETTING,
+ Ec2ClientSettings.REGION_SETTING,
Ec2ClientSettings.PROTOCOL_SETTING,
Ec2ClientSettings.PROXY_HOST_SETTING,
Ec2ClientSettings.PROXY_PORT_SETTING,
@@ -143,9 +128,15 @@ public Settings additionalSettings() {
final Settings.Builder builder = Settings.builder();
// Adds a node attribute for the ec2 availability zone
- final String azMetadataUrl = EC2MetadataUtils.getHostAddressForEC2MetadataService()
- + "/latest/meta-data/placement/availability-zone";
- builder.put(getAvailabilityZoneNodeAttributes(settings, azMetadataUrl));
+ Optional ec2MetadataServiceEndpoint = SdkSystemSetting.AWS_EC2_METADATA_SERVICE_ENDPOINT.getStringValue();
+ if (ec2MetadataServiceEndpoint.isPresent()) {
+ builder.put(
+ getAvailabilityZoneNodeAttributes(
+ settings,
+ ec2MetadataServiceEndpoint.get() + "/latest/meta-data/placement/availability-zone"
+ )
+ );
+ }
return builder.build();
}
@@ -161,6 +152,9 @@ static Settings getAvailabilityZoneNodeAttributes(Settings settings, String azMe
final URLConnection urlConnection;
try {
url = new URL(azMetadataUrl);
+ // Obtain the current EC2 instance availability zone from IMDS.
+ // Same as curl http://169.254.169.254/latest/meta-data/placement/availability-zone/.
+ // TODO: use EC2MetadataUtils::getAvailabilityZone that was added in AWS SDK v2 instead of rolling our own
logger.debug("obtaining ec2 [placement/availability-zone] from ec2 meta-data url {}", url);
urlConnection = SocketAccess.doPrivilegedIOException(url::openConnection);
urlConnection.setConnectTimeout(2000);
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java
index 093ea1eef3ab3..3f7a8e1e03353 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/Ec2NameResolver.java
@@ -32,13 +32,12 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.util.EC2MetadataUtils;
-
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.network.NetworkService.CustomNameResolver;
import org.opensearch.common.util.io.IOUtils;
+import software.amazon.awssdk.core.SdkSystemSetting;
import java.io.BufferedReader;
import java.io.IOException;
@@ -48,6 +47,7 @@
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
+import java.util.Optional;
/**
* Resolves certain ec2 related 'meta' hostnames into an actual hostname
@@ -104,25 +104,31 @@ private enum Ec2HostnameType {
@SuppressForbidden(reason = "We call getInputStream in doPrivileged and provide SocketPermission")
public InetAddress[] resolve(Ec2HostnameType type) throws IOException {
InputStream in = null;
- String metadataUrl = EC2MetadataUtils.getHostAddressForEC2MetadataService() + "/latest/meta-data/" + type.ec2Name;
- try {
- URL url = new URL(metadataUrl);
- logger.debug("obtaining ec2 hostname from ec2 meta-data url {}", url);
- URLConnection urlConnection = SocketAccess.doPrivilegedIOException(url::openConnection);
- urlConnection.setConnectTimeout(2000);
- in = SocketAccess.doPrivilegedIOException(urlConnection::getInputStream);
- BufferedReader urlReader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
-
- String metadataResult = urlReader.readLine();
- if (metadataResult == null || metadataResult.length() == 0) {
- throw new IOException("no gce metadata returned from [" + url + "] for [" + type.configName + "]");
+ Optional ec2MetadataServiceEndpoint = SdkSystemSetting.AWS_EC2_METADATA_SERVICE_ENDPOINT.getStringValue();
+ if (ec2MetadataServiceEndpoint.isPresent()) {
+ String metadataUrl = ec2MetadataServiceEndpoint.get() + "/latest/meta-data/" + type.ec2Name;
+ try {
+ URL url = new URL(metadataUrl);
+ logger.debug("obtaining ec2 hostname from ec2 meta-data url {}", url);
+ URLConnection urlConnection = SocketAccess.doPrivilegedIOException(url::openConnection);
+ urlConnection.setConnectTimeout(2000);
+ in = SocketAccess.doPrivilegedIOException(urlConnection::getInputStream);
+ BufferedReader urlReader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
+
+ String metadataResult = urlReader.readLine();
+ if (metadataResult == null || metadataResult.length() == 0) {
+ throw new IOException("no ec2 metadata returned from [" + url + "] for [" + type.configName + "]");
+ }
+ logger.debug("obtained ec2 hostname from ec2 meta-data url {}: {}", url, metadataResult);
+ // only one address: because we explicitly ask for only one via the Ec2HostnameType
+ return new InetAddress[] { InetAddress.getByName(metadataResult) };
+ } catch (IOException e) {
+ throw new IOException("IOException caught when fetching InetAddress from [" + metadataUrl + "]", e);
+ } finally {
+ IOUtils.closeWhileHandlingException(in);
}
- // only one address: because we explicitly ask for only one via the Ec2HostnameType
- return new InetAddress[] { InetAddress.getByName(metadataResult) };
- } catch (IOException e) {
- throw new IOException("IOException caught when fetching InetAddress from [" + metadataUrl + "]", e);
- } finally {
- IOUtils.closeWhileHandlingException(in);
+ } else {
+ throw new IOException("Missing ec2 meta-data url (AWS_EC2_METADATA_SERVICE_ENDPOINT)");
}
}
diff --git a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/SocketAccess.java b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/SocketAccess.java
index 292a3b167f5ad..c6605002c4462 100644
--- a/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/SocketAccess.java
+++ b/plugins/discovery-ec2/src/main/java/org/opensearch/discovery/ec2/SocketAccess.java
@@ -50,6 +50,14 @@ final class SocketAccess {
private SocketAccess() {}
+ public static void doPrivilegedVoid(Runnable action) {
+ SpecialPermission.check();
+ AccessController.doPrivileged((PrivilegedAction) () -> {
+ action.run();
+ return null;
+ });
+ }
+
public static T doPrivileged(PrivilegedAction operation) {
SpecialPermission.check();
return AccessController.doPrivileged(operation);
diff --git a/plugins/discovery-ec2/src/main/plugin-metadata/plugin-security.policy b/plugins/discovery-ec2/src/main/plugin-metadata/plugin-security.policy
index 65dd1d13b5a6d..8712fab93620e 100644
--- a/plugins/discovery-ec2/src/main/plugin-metadata/plugin-security.policy
+++ b/plugins/discovery-ec2/src/main/plugin-metadata/plugin-security.policy
@@ -42,4 +42,13 @@ grant {
permission java.net.SocketPermission "*", "connect";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+
+ permission java.util.PropertyPermission "aws.sharedCredentialsFile", "read,write";
+ permission java.util.PropertyPermission "aws.configFile", "read,write";
+ permission java.util.PropertyPermission "aws.region", "read,write";
+ permission java.util.PropertyPermission "aws.accessKeyId", "read,write";
+ permission java.util.PropertyPermission "aws.secretAccessKey", "read,write";
+ permission java.util.PropertyPermission "opensearch.path.conf", "read,write";
+
+ permission java.io.FilePermission "config", "read";
};
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEc2DiscoveryTestCase.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEc2DiscoveryTestCase.java
new file mode 100644
index 0000000000000..b7f8d3a119ff7
--- /dev/null
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEc2DiscoveryTestCase.java
@@ -0,0 +1,70 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.discovery.ec2;
+
+import org.opensearch.test.OpenSearchTestCase;
+import org.opensearch.common.SuppressForbidden;
+import org.opensearch.common.io.PathUtils;
+import java.nio.file.Path;
+import software.amazon.awssdk.profiles.ProfileFileSystemSetting;
+
+public abstract class AbstractEc2DiscoveryTestCase extends OpenSearchTestCase {
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ setUpAwsProfile();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ resetAwsProfile();
+ super.tearDown();
+ }
+
+ private Path configPath() {
+ return PathUtils.get("config");
+ }
+
+ private String previousOpenSearchPathConf;
+ private String awsRegion;
+ private String awsAccessKeyId;
+ private String awsSecretAccessKey;
+ private String awsSharedCredentialsFile;
+ private String awsConfigFile;
+
+ @SuppressForbidden(reason = "set predictable aws defaults")
+ private void setUpAwsProfile() throws Exception {
+ previousOpenSearchPathConf = SocketAccess.doPrivileged(() -> System.setProperty("opensearch.path.conf", configPath().toString()));
+ awsRegion = SocketAccess.doPrivileged(() -> System.setProperty("aws.region", "us-west-2"));
+ awsAccessKeyId = SocketAccess.doPrivileged(() -> System.setProperty("aws.accessKeyId", "aws-access-key-id"));
+ awsSecretAccessKey = SocketAccess.doPrivileged(() -> System.setProperty("aws.secretAccessKey", "aws-secret-access-key"));
+ awsSharedCredentialsFile = System.getProperty(ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE.property());
+ awsConfigFile = System.getProperty(ProfileFileSystemSetting.AWS_CONFIG_FILE.property());
+ SocketAccess.doPrivilegedVoid(AwsEc2ServiceImpl::setDefaultAwsProfilePath);
+ }
+
+ @SuppressForbidden(reason = "reset aws settings")
+ private void resetAwsProfile() throws Exception {
+ resetPropertyValue("opensearch.path.conf", previousOpenSearchPathConf);
+ resetPropertyValue("aws.region", awsRegion);
+ resetPropertyValue("aws.accessKeyId", awsAccessKeyId);
+ resetPropertyValue("aws.secretAccessKey", awsSecretAccessKey);
+ resetPropertyValue(ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE.property(), awsSharedCredentialsFile);
+ resetPropertyValue(ProfileFileSystemSetting.AWS_CONFIG_FILE.property(), awsConfigFile);
+ }
+
+ @SuppressForbidden(reason = "reset aws settings")
+ private void resetPropertyValue(String key, String value) {
+ if (value != null) {
+ SocketAccess.doPrivileged(() -> System.setProperty(key, value));
+ } else {
+ SocketAccess.doPrivileged(() -> System.clearProperty(key));
+ }
+ }
+}
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEc2MockAPITestCase.java
similarity index 92%
rename from plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java
rename to plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEc2MockAPITestCase.java
index 3256a01838169..d7ac70199e11d 100644
--- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEC2MockAPITestCase.java
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AbstractEc2MockAPITestCase.java
@@ -31,8 +31,8 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.services.ec2.model.Instance;
-import com.amazonaws.services.ec2.model.Tag;
+import software.amazon.awssdk.services.ec2.model.Instance;
+import software.amazon.awssdk.services.ec2.model.Tag;
import com.sun.net.httpserver.HttpServer;
import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.network.InetAddresses;
@@ -40,7 +40,6 @@
import org.opensearch.common.settings.MockSecureSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.io.IOUtils;
-import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.test.transport.MockTransportService;
import org.opensearch.threadpool.TestThreadPool;
import org.opensearch.threadpool.ThreadPool;
@@ -61,7 +60,7 @@
import static java.nio.charset.StandardCharsets.UTF_8;
@SuppressForbidden(reason = "use a http server")
-public abstract class AbstractEC2MockAPITestCase extends OpenSearchTestCase {
+public abstract class AbstractEc2MockAPITestCase extends AbstractEc2DiscoveryTestCase {
protected HttpServer httpServer;
@@ -75,7 +74,7 @@ public abstract class AbstractEC2MockAPITestCase extends OpenSearchTestCase {
public void setUp() throws Exception {
httpServer = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
httpServer.start();
- threadPool = new TestThreadPool(EC2RetriesTests.class.getName());
+ threadPool = new TestThreadPool(Ec2RetriesTests.class.getName());
transportService = createTransportService();
super.setUp();
}
@@ -88,7 +87,11 @@ protected Settings buildSettings(String accessKey) {
final MockSecureSettings mockSecure = new MockSecureSettings();
mockSecure.setString(Ec2ClientSettings.ACCESS_KEY_SETTING.getKey(), accessKey);
mockSecure.setString(Ec2ClientSettings.SECRET_KEY_SETTING.getKey(), "ec2_secret");
- return Settings.builder().put(Ec2ClientSettings.ENDPOINT_SETTING.getKey(), endpoint).setSecureSettings(mockSecure).build();
+ return Settings.builder()
+ .put(Ec2ClientSettings.ENDPOINT_SETTING.getKey(), endpoint)
+ .put(Ec2ClientSettings.REGION_SETTING.getKey(), "ec2_region")
+ .setSecureSettings(mockSecure)
+ .build();
}
@After
@@ -136,11 +139,11 @@ static byte[] generateDescribeInstancesResponse(List instances) {
sw.writeStartElement("item");
{
sw.writeStartElement("instanceId");
- sw.writeCharacters(instance.getInstanceId());
+ sw.writeCharacters(instance.instanceId());
sw.writeEndElement();
sw.writeStartElement("imageId");
- sw.writeCharacters(instance.getImageId());
+ sw.writeCharacters(instance.imageId());
sw.writeEndElement();
sw.writeStartElement("instanceState");
@@ -156,11 +159,11 @@ static byte[] generateDescribeInstancesResponse(List instances) {
sw.writeEndElement();
sw.writeStartElement("privateDnsName");
- sw.writeCharacters(instance.getPrivateDnsName());
+ sw.writeCharacters(instance.privateDnsName());
sw.writeEndElement();
sw.writeStartElement("dnsName");
- sw.writeCharacters(instance.getPublicDnsName());
+ sw.writeCharacters(instance.publicDnsName());
sw.writeEndElement();
sw.writeStartElement("instanceType");
@@ -182,23 +185,23 @@ static byte[] generateDescribeInstancesResponse(List instances) {
sw.writeEndElement();
sw.writeStartElement("privateIpAddress");
- sw.writeCharacters(instance.getPrivateIpAddress());
+ sw.writeCharacters(instance.privateIpAddress());
sw.writeEndElement();
sw.writeStartElement("ipAddress");
- sw.writeCharacters(instance.getPublicIpAddress());
+ sw.writeCharacters(instance.publicIpAddress());
sw.writeEndElement();
sw.writeStartElement("tagSet");
- for (Tag tag : instance.getTags()) {
+ for (Tag tag : instance.tags()) {
sw.writeStartElement("item");
{
sw.writeStartElement("key");
- sw.writeCharacters(tag.getKey());
+ sw.writeCharacters(tag.key());
sw.writeEndElement();
sw.writeStartElement("value");
- sw.writeCharacters(tag.getValue());
+ sw.writeCharacters(tag.value());
sw.writeEndElement();
}
sw.writeEndElement();
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AwsEc2ServiceImplTests.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AwsEc2ServiceImplTests.java
index 3150f96443695..fb6273dd9a223 100644
--- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AwsEc2ServiceImplTests.java
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/AwsEc2ServiceImplTests.java
@@ -32,40 +32,39 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.Protocol;
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.BasicSessionCredentials;
-import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
import org.opensearch.common.settings.MockSecureSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.SettingsException;
-import org.opensearch.test.OpenSearchTestCase;
+import software.amazon.awssdk.core.Protocol;
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.core.retry.RetryPolicy;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
-public class AwsEc2ServiceImplTests extends OpenSearchTestCase {
-
- public void testAWSCredentialsWithSystemProviders() {
- final AWSCredentialsProvider credentialsProvider = AwsEc2ServiceImpl.buildCredentials(
+public class AwsEc2ServiceImplTests extends AbstractEc2DiscoveryTestCase {
+ public void testAwsCredentialsWithSystemProviders() {
+ final AwsCredentialsProvider credentialsProvider = AwsEc2ServiceImpl.buildCredentials(
logger,
Ec2ClientSettings.getClientSettings(Settings.EMPTY)
);
- assertThat(credentialsProvider, instanceOf(DefaultAWSCredentialsProviderChain.class));
+ assertThat(credentialsProvider, instanceOf(AwsCredentialsProvider.class));
}
- public void testAWSCredentialsWithOpenSearchAwsSettings() {
+ public void testAwsCredentialsWithOpenSearchAwsSettings() {
final MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("discovery.ec2.access_key", "aws_key");
secureSettings.setString("discovery.ec2.secret_key", "aws_secret");
- final AWSCredentials credentials = AwsEc2ServiceImpl.buildCredentials(
+ final AwsCredentials credentials = AwsEc2ServiceImpl.buildCredentials(
logger,
Ec2ClientSettings.getClientSettings(Settings.builder().setSecureSettings(secureSettings).build())
- ).getCredentials();
- assertThat(credentials.getAWSAccessKeyId(), is("aws_key"));
- assertThat(credentials.getAWSSecretKey(), is("aws_secret"));
+ ).resolveCredentials();
+ assertThat(credentials.accessKeyId(), is("aws_key"));
+ assertThat(credentials.secretAccessKey(), is("aws_secret"));
}
public void testAWSSessionCredentialsWithOpenSearchAwsSettings() {
@@ -73,43 +72,39 @@ public void testAWSSessionCredentialsWithOpenSearchAwsSettings() {
secureSettings.setString("discovery.ec2.access_key", "aws_key");
secureSettings.setString("discovery.ec2.secret_key", "aws_secret");
secureSettings.setString("discovery.ec2.session_token", "aws_session_token");
- final BasicSessionCredentials credentials = (BasicSessionCredentials) AwsEc2ServiceImpl.buildCredentials(
+ final AwsSessionCredentials credentials = (AwsSessionCredentials) AwsEc2ServiceImpl.buildCredentials(
logger,
Ec2ClientSettings.getClientSettings(Settings.builder().setSecureSettings(secureSettings).build())
- ).getCredentials();
- assertThat(credentials.getAWSAccessKeyId(), is("aws_key"));
- assertThat(credentials.getAWSSecretKey(), is("aws_secret"));
- assertThat(credentials.getSessionToken(), is("aws_session_token"));
+ ).resolveCredentials();
+ assertThat(credentials.accessKeyId(), is("aws_key"));
+ assertThat(credentials.secretAccessKey(), is("aws_secret"));
+ assertThat(credentials.sessionToken(), is("aws_session_token"));
}
- public void testDeprecationOfLoneAccessKey() {
+ public void testRejectionOfLoneAccessKey() {
final MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("discovery.ec2.access_key", "aws_key");
- final AWSCredentials credentials = AwsEc2ServiceImpl.buildCredentials(
- logger,
- Ec2ClientSettings.getClientSettings(Settings.builder().setSecureSettings(secureSettings).build())
- ).getCredentials();
- assertThat(credentials.getAWSAccessKeyId(), is("aws_key"));
- assertThat(credentials.getAWSSecretKey(), is(""));
- assertSettingDeprecationsAndWarnings(
- new String[] {},
- "Setting [discovery.ec2.access_key] is set but [discovery.ec2.secret_key] is not, which will be unsupported in future"
+ SettingsException e = expectThrows(
+ SettingsException.class,
+ () -> AwsEc2ServiceImpl.buildCredentials(
+ logger,
+ Ec2ClientSettings.getClientSettings(Settings.builder().setSecureSettings(secureSettings).build())
+ )
);
+ assertThat(e.getMessage(), is("Setting [discovery.ec2.access_key] is set but [discovery.ec2.secret_key] is not"));
}
public void testDeprecationOfLoneSecretKey() {
final MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("discovery.ec2.secret_key", "aws_secret");
- final AWSCredentials credentials = AwsEc2ServiceImpl.buildCredentials(
- logger,
- Ec2ClientSettings.getClientSettings(Settings.builder().setSecureSettings(secureSettings).build())
- ).getCredentials();
- assertThat(credentials.getAWSAccessKeyId(), is(""));
- assertThat(credentials.getAWSSecretKey(), is("aws_secret"));
- assertSettingDeprecationsAndWarnings(
- new String[] {},
- "Setting [discovery.ec2.secret_key] is set but [discovery.ec2.access_key] is not, which will be unsupported in future"
+ SettingsException e = expectThrows(
+ SettingsException.class,
+ () -> AwsEc2ServiceImpl.buildCredentials(
+ logger,
+ Ec2ClientSettings.getClientSettings(Settings.builder().setSecureSettings(secureSettings).build())
+ )
);
+ assertThat(e.getMessage(), is("Setting [discovery.ec2.secret_key] is set but [discovery.ec2.access_key] is not"));
}
public void testRejectionOfLoneSessionToken() {
@@ -129,44 +124,81 @@ public void testRejectionOfLoneSessionToken() {
}
public void testAWSDefaultConfiguration() {
- launchAWSConfigurationTest(Settings.EMPTY, Protocol.HTTPS, null, -1, null, null, ClientConfiguration.DEFAULT_SOCKET_TIMEOUT);
+ // proxy configuration
+ final ProxyConfiguration proxyConfiguration = AwsEc2ServiceImpl.buildProxyConfiguration(
+ logger,
+ Ec2ClientSettings.getClientSettings(Settings.EMPTY)
+ );
+
+ assertNull(proxyConfiguration.scheme());
+ assertNull(proxyConfiguration.host());
+ assertThat(proxyConfiguration.port(), is(0));
+ assertNull(proxyConfiguration.username());
+ assertNull(proxyConfiguration.password());
+
+ // retry policy
+ RetryPolicy retryPolicyConfiguration = AwsEc2ServiceImpl.buildRetryPolicy(
+ logger,
+ Ec2ClientSettings.getClientSettings(Settings.EMPTY)
+ );
+
+ assertThat(retryPolicyConfiguration.numRetries(), is(10));
+
+ final AwsCredentials credentials = AwsEc2ServiceImpl.buildCredentials(logger, Ec2ClientSettings.getClientSettings(Settings.EMPTY))
+ .resolveCredentials();
+
+ assertThat(credentials.accessKeyId(), is("aws-access-key-id"));
+ assertThat(credentials.secretAccessKey(), is("aws-secret-access-key"));
+
+ ClientOverrideConfiguration clientOverrideConfiguration = AwsEc2ServiceImpl.buildOverrideConfiguration(
+ logger,
+ Ec2ClientSettings.getClientSettings(Settings.EMPTY)
+ );
+ assertTrue(clientOverrideConfiguration.retryPolicy().isPresent());
+ assertThat(clientOverrideConfiguration.retryPolicy().get().numRetries(), is(10));
}
public void testAWSConfigurationWithAwsSettings() {
final MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("discovery.ec2.proxy.username", "aws_proxy_username");
secureSettings.setString("discovery.ec2.proxy.password", "aws_proxy_password");
+
final Settings settings = Settings.builder()
.put("discovery.ec2.protocol", "http")
- .put("discovery.ec2.proxy.host", "aws_proxy_host")
+ // NOTE: a host cannot contain the _ character when parsed by URI, hence aws-proxy-host and not aws_proxy_host
+ .put("discovery.ec2.proxy.host", "aws-proxy-host")
.put("discovery.ec2.proxy.port", 8080)
.put("discovery.ec2.read_timeout", "10s")
.setSecureSettings(secureSettings)
.build();
- launchAWSConfigurationTest(settings, Protocol.HTTP, "aws_proxy_host", 8080, "aws_proxy_username", "aws_proxy_password", 10000);
- }
- protected void launchAWSConfigurationTest(
- Settings settings,
- Protocol expectedProtocol,
- String expectedProxyHost,
- int expectedProxyPort,
- String expectedProxyUsername,
- String expectedProxyPassword,
- int expectedReadTimeout
- ) {
- final ClientConfiguration configuration = AwsEc2ServiceImpl.buildConfiguration(
+ // proxy configuration
+ final ProxyConfiguration proxyConfiguration = AwsEc2ServiceImpl.buildProxyConfiguration(
logger,
Ec2ClientSettings.getClientSettings(settings)
);
- assertThat(configuration.getResponseMetadataCacheSize(), is(0));
- assertThat(configuration.getProtocol(), is(expectedProtocol));
- assertThat(configuration.getProxyHost(), is(expectedProxyHost));
- assertThat(configuration.getProxyPort(), is(expectedProxyPort));
- assertThat(configuration.getProxyUsername(), is(expectedProxyUsername));
- assertThat(configuration.getProxyPassword(), is(expectedProxyPassword));
- assertThat(configuration.getSocketTimeout(), is(expectedReadTimeout));
- }
+ assertThat(proxyConfiguration.scheme(), is(Protocol.HTTP.toString()));
+ assertThat(proxyConfiguration.host(), is("aws-proxy-host"));
+ assertThat(proxyConfiguration.port(), is(8080));
+ assertThat(proxyConfiguration.username(), is("aws_proxy_username"));
+ assertThat(proxyConfiguration.password(), is("aws_proxy_password"));
+
+ // retry policy
+ RetryPolicy retryPolicyConfiguration = AwsEc2ServiceImpl.buildRetryPolicy(logger, Ec2ClientSettings.getClientSettings(settings));
+ assertThat(retryPolicyConfiguration.numRetries(), is(10));
+
+ final AwsCredentials credentials = AwsEc2ServiceImpl.buildCredentials(logger, Ec2ClientSettings.getClientSettings(Settings.EMPTY))
+ .resolveCredentials();
+ assertThat(credentials.accessKeyId(), is("aws-access-key-id"));
+ assertThat(credentials.secretAccessKey(), is("aws-secret-access-key"));
+
+ ClientOverrideConfiguration clientOverrideConfiguration = AwsEc2ServiceImpl.buildOverrideConfiguration(
+ logger,
+ Ec2ClientSettings.getClientSettings(Settings.EMPTY)
+ );
+ assertTrue(clientOverrideConfiguration.retryPolicy().isPresent());
+ assertThat(clientOverrideConfiguration.retryPolicy().get().numRetries(), is(10));
+ }
}
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryPluginTests.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryPluginTests.java
index cb19c0d4255ac..35df2bdbfdfb8 100644
--- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryPluginTests.java
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryPluginTests.java
@@ -32,17 +32,17 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.auth.BasicAWSCredentials;
-import com.amazonaws.auth.BasicSessionCredentials;
-import com.amazonaws.services.ec2.AbstractAmazonEC2;
-import com.amazonaws.services.ec2.AmazonEC2;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
+import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.ec2.Ec2Client;
import org.opensearch.common.settings.MockSecureSettings;
import org.opensearch.common.settings.Settings;
import org.opensearch.node.Node;
-import org.opensearch.test.OpenSearchTestCase;
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -51,10 +51,8 @@
import java.util.Arrays;
import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.Matchers.is;
-
-public class Ec2DiscoveryPluginTests extends OpenSearchTestCase {
+public class Ec2DiscoveryPluginTests extends AbstractEc2DiscoveryTestCase {
private Settings getNodeAttributes(Settings settings, String url) {
final Settings realSettings = Settings.builder().put(AwsEc2Service.AUTO_ATTRIBUTE_SETTING.getKey(), true).put(settings).build();
return Ec2DiscoveryPlugin.getAvailabilityZoneNodeAttributes(realSettings, url);
@@ -103,16 +101,32 @@ public void testNodeAttributesErrorLenient() throws Exception {
public void testDefaultEndpoint() throws IOException {
try (Ec2DiscoveryPluginMock plugin = new Ec2DiscoveryPluginMock(Settings.EMPTY)) {
- final String endpoint = ((AmazonEC2Mock) plugin.ec2Service.client().get()).endpoint;
- assertThat(endpoint, is(""));
+ final String endpoint = ((MockEc2Client) plugin.ec2Service.client().get()).endpoint;
+ assertEquals(endpoint, "");
+ }
+ }
+
+ public void testDefaultRegion() throws IOException {
+ final Settings settings = Settings.builder().build();
+ try (Ec2DiscoveryPluginMock plugin = new Ec2DiscoveryPluginMock(settings)) {
+ final String region = ((MockEc2Client) plugin.ec2Service.client().get()).region;
+ assertEquals(region, "");
+ }
+ }
+
+ public void testSpecificRegion() throws IOException {
+ final Settings settings = Settings.builder().put(Ec2ClientSettings.REGION_SETTING.getKey(), "us-west-2").build();
+ try (Ec2DiscoveryPluginMock plugin = new Ec2DiscoveryPluginMock(settings)) {
+ final String region = ((MockEc2Client) plugin.ec2Service.client().get()).region;
+ assertEquals(region, Region.US_WEST_2.toString());
}
}
public void testSpecificEndpoint() throws IOException {
final Settings settings = Settings.builder().put(Ec2ClientSettings.ENDPOINT_SETTING.getKey(), "ec2.endpoint").build();
try (Ec2DiscoveryPluginMock plugin = new Ec2DiscoveryPluginMock(settings)) {
- final String endpoint = ((AmazonEC2Mock) plugin.ec2Service.client().get()).endpoint;
- assertThat(endpoint, is("ec2.endpoint"));
+ final String endpoint = ((MockEc2Client) plugin.ec2Service.client().get()).endpoint;
+ assertEquals(endpoint, "ec2.endpoint");
}
}
@@ -127,8 +141,9 @@ public void testClientSettingsReInit() throws IOException {
mockSecure1.setString(Ec2ClientSettings.PROXY_USERNAME_SETTING.getKey(), "proxy_username_1");
mockSecure1.setString(Ec2ClientSettings.PROXY_PASSWORD_SETTING.getKey(), "proxy_password_1");
final Settings settings1 = Settings.builder()
- .put(Ec2ClientSettings.PROXY_HOST_SETTING.getKey(), "proxy_host_1")
+ .put(Ec2ClientSettings.PROXY_HOST_SETTING.getKey(), "proxy-host-1")
.put(Ec2ClientSettings.PROXY_PORT_SETTING.getKey(), 881)
+ .put(Ec2ClientSettings.REGION_SETTING.getKey(), "ec2_region")
.put(Ec2ClientSettings.ENDPOINT_SETTING.getKey(), "ec2_endpoint_1")
.setSecureSettings(mockSecure1)
.build();
@@ -142,62 +157,84 @@ public void testClientSettingsReInit() throws IOException {
mockSecure2.setString(Ec2ClientSettings.PROXY_USERNAME_SETTING.getKey(), "proxy_username_2");
mockSecure2.setString(Ec2ClientSettings.PROXY_PASSWORD_SETTING.getKey(), "proxy_password_2");
final Settings settings2 = Settings.builder()
- .put(Ec2ClientSettings.PROXY_HOST_SETTING.getKey(), "proxy_host_2")
+ .put(Ec2ClientSettings.PROXY_HOST_SETTING.getKey(), "proxy-host-2")
.put(Ec2ClientSettings.PROXY_PORT_SETTING.getKey(), 882)
+ .put(Ec2ClientSettings.REGION_SETTING.getKey(), "ec2_region")
.put(Ec2ClientSettings.ENDPOINT_SETTING.getKey(), "ec2_endpoint_2")
.setSecureSettings(mockSecure2)
.build();
try (Ec2DiscoveryPluginMock plugin = new Ec2DiscoveryPluginMock(settings1)) {
- try (AmazonEc2Reference clientReference = plugin.ec2Service.client()) {
+ try (AmazonEc2ClientReference clientReference = plugin.ec2Service.client()) {
{
- final AWSCredentials credentials = ((AmazonEC2Mock) clientReference.get()).credentials.getCredentials();
- assertThat(credentials.getAWSAccessKeyId(), is("ec2_access_1"));
- assertThat(credentials.getAWSSecretKey(), is("ec2_secret_1"));
+ final MockEc2Client mockEc2Client = (MockEc2Client) clientReference.get();
+ assertEquals(mockEc2Client.endpoint, "ec2_endpoint_1");
+
+ final AwsCredentials credentials = mockEc2Client.credentials.resolveCredentials();
+ assertEquals(credentials.accessKeyId(), "ec2_access_1");
+ assertEquals(credentials.secretAccessKey(), "ec2_secret_1");
if (mockSecure1HasSessionToken) {
- assertThat(credentials, instanceOf(BasicSessionCredentials.class));
- assertThat(((BasicSessionCredentials) credentials).getSessionToken(), is("ec2_session_token_1"));
+ assertThat(credentials, instanceOf(AwsSessionCredentials.class));
+ assertEquals(((AwsSessionCredentials) credentials).sessionToken(), "ec2_session_token_1");
} else {
- assertThat(credentials, instanceOf(BasicAWSCredentials.class));
+ assertThat(credentials, instanceOf(AwsBasicCredentials.class));
}
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyUsername(), is("proxy_username_1"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyPassword(), is("proxy_password_1"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyHost(), is("proxy_host_1"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyPort(), is(881));
- assertThat(((AmazonEC2Mock) clientReference.get()).endpoint, is("ec2_endpoint_1"));
+
+ assertEquals(
+ mockEc2Client.proxyConfiguration.toString(),
+ "ProxyConfiguration(endpoint=https://proxy-host-1:881, username=proxy_username_1, preemptiveBasicAuthenticationEnabled=false)"
+ );
+ assertEquals(mockEc2Client.proxyConfiguration.host(), "proxy-host-1");
+ assertEquals(mockEc2Client.proxyConfiguration.port(), 881);
+ assertEquals(mockEc2Client.proxyConfiguration.username(), "proxy_username_1");
+ assertEquals(mockEc2Client.proxyConfiguration.password(), "proxy_password_1");
}
// reload secure settings2
plugin.reload(settings2);
// client is not released, it is still using the old settings
{
- final AWSCredentials credentials = ((AmazonEC2Mock) clientReference.get()).credentials.getCredentials();
+ final MockEc2Client mockEc2Client = (MockEc2Client) clientReference.get();
+ assertEquals(mockEc2Client.endpoint, "ec2_endpoint_1");
+
+ final AwsCredentials credentials = ((MockEc2Client) clientReference.get()).credentials.resolveCredentials();
if (mockSecure1HasSessionToken) {
- assertThat(credentials, instanceOf(BasicSessionCredentials.class));
- assertThat(((BasicSessionCredentials) credentials).getSessionToken(), is("ec2_session_token_1"));
+ assertThat(credentials, instanceOf(AwsSessionCredentials.class));
+ assertEquals(((AwsSessionCredentials) credentials).sessionToken(), "ec2_session_token_1");
} else {
- assertThat(credentials, instanceOf(BasicAWSCredentials.class));
+ assertThat(credentials, instanceOf(AwsBasicCredentials.class));
}
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyUsername(), is("proxy_username_1"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyPassword(), is("proxy_password_1"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyHost(), is("proxy_host_1"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyPort(), is(881));
- assertThat(((AmazonEC2Mock) clientReference.get()).endpoint, is("ec2_endpoint_1"));
+
+ assertEquals(
+ mockEc2Client.proxyConfiguration.toString(),
+ "ProxyConfiguration(endpoint=https://proxy-host-1:881, username=proxy_username_1, preemptiveBasicAuthenticationEnabled=false)"
+ );
+ assertEquals(mockEc2Client.proxyConfiguration.host(), "proxy-host-1");
+ assertEquals(mockEc2Client.proxyConfiguration.port(), 881);
+ assertEquals(mockEc2Client.proxyConfiguration.username(), "proxy_username_1");
+ assertEquals(mockEc2Client.proxyConfiguration.password(), "proxy_password_1");
}
}
- try (AmazonEc2Reference clientReference = plugin.ec2Service.client()) {
- final AWSCredentials credentials = ((AmazonEC2Mock) clientReference.get()).credentials.getCredentials();
- assertThat(credentials.getAWSAccessKeyId(), is("ec2_access_2"));
- assertThat(credentials.getAWSSecretKey(), is("ec2_secret_2"));
+ try (AmazonEc2ClientReference clientReference = plugin.ec2Service.client()) {
+ final MockEc2Client mockEc2Client = (MockEc2Client) clientReference.get();
+ assertEquals(mockEc2Client.endpoint, "ec2_endpoint_2");
+
+ final AwsCredentials credentials = ((MockEc2Client) clientReference.get()).credentials.resolveCredentials();
+ assertEquals(credentials.accessKeyId(), "ec2_access_2");
+ assertEquals(credentials.secretAccessKey(), "ec2_secret_2");
if (mockSecure2HasSessionToken) {
- assertThat(credentials, instanceOf(BasicSessionCredentials.class));
- assertThat(((BasicSessionCredentials) credentials).getSessionToken(), is("ec2_session_token_2"));
+ assertThat(credentials, instanceOf(AwsSessionCredentials.class));
+ assertEquals(((AwsSessionCredentials) credentials).sessionToken(), "ec2_session_token_2");
} else {
- assertThat(credentials, instanceOf(BasicAWSCredentials.class));
+ assertThat(credentials, instanceOf(AwsBasicCredentials.class));
}
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyUsername(), is("proxy_username_2"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyPassword(), is("proxy_password_2"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyHost(), is("proxy_host_2"));
- assertThat(((AmazonEC2Mock) clientReference.get()).configuration.getProxyPort(), is(882));
- assertThat(((AmazonEC2Mock) clientReference.get()).endpoint, is("ec2_endpoint_2"));
+
+ assertEquals(
+ mockEc2Client.proxyConfiguration.toString(),
+ "ProxyConfiguration(endpoint=https://proxy-host-2:882, username=proxy_username_2, preemptiveBasicAuthenticationEnabled=false)"
+ );
+ assertEquals(mockEc2Client.proxyConfiguration.host(), "proxy-host-2");
+ assertEquals(mockEc2Client.proxyConfiguration.port(), 882);
+ assertEquals(mockEc2Client.proxyConfiguration.username(), "proxy_username_2");
+ assertEquals(mockEc2Client.proxyConfiguration.password(), "proxy_password_2");
}
}
}
@@ -207,26 +244,53 @@ private static class Ec2DiscoveryPluginMock extends Ec2DiscoveryPlugin {
Ec2DiscoveryPluginMock(Settings settings) {
super(settings, new AwsEc2ServiceImpl() {
@Override
- AmazonEC2 buildClient(AWSCredentialsProvider credentials, ClientConfiguration configuration, String endpoint) {
- return new AmazonEC2Mock(credentials, configuration, endpoint);
+ protected Ec2Client buildClient(
+ AwsCredentialsProvider credentials,
+ ProxyConfiguration proxyConfiguration,
+ ClientOverrideConfiguration overrideConfiguration,
+ String endpoint,
+ String region,
+ long readTimeoutMillis
+ ) {
+ return new MockEc2Client(credentials, proxyConfiguration, overrideConfiguration, endpoint, region, readTimeoutMillis);
}
});
}
}
- private static class AmazonEC2Mock extends AbstractAmazonEC2 {
+ private static class MockEc2Client implements Ec2Client {
String endpoint;
- final AWSCredentialsProvider credentials;
- final ClientConfiguration configuration;
+ final String region;
+ final AwsCredentialsProvider credentials;
+ final ClientOverrideConfiguration clientOverrideConfiguration;
+ final ProxyConfiguration proxyConfiguration;
+ final long readTimeoutMillis;
- AmazonEC2Mock(AWSCredentialsProvider credentials, ClientConfiguration configuration, String endpoint) {
+ MockEc2Client(
+ AwsCredentialsProvider credentials,
+ ProxyConfiguration proxyConfiguration,
+ ClientOverrideConfiguration clientOverrideConfiguration,
+ String endpoint,
+ String region,
+ long readTimeoutMillis
+ ) {
this.credentials = credentials;
- this.configuration = configuration;
+ this.proxyConfiguration = proxyConfiguration;
+ this.clientOverrideConfiguration = clientOverrideConfiguration;
this.endpoint = endpoint;
+ this.region = region;
+ this.readTimeoutMillis = readTimeoutMillis;
}
@Override
- public void shutdown() {}
+ public String serviceName() {
+ return "ec2";
+ }
+
+ @Override
+ public void close() {
+ // ignore
+ }
}
}
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryTests.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryTests.java
index f1870a1c487e0..861926a9e67c9 100644
--- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryTests.java
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryTests.java
@@ -32,11 +32,10 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.http.HttpMethodName;
-import com.amazonaws.services.ec2.model.Instance;
-import com.amazonaws.services.ec2.model.InstanceState;
-import com.amazonaws.services.ec2.model.InstanceStateName;
-import com.amazonaws.services.ec2.model.Tag;
+import software.amazon.awssdk.services.ec2.model.Instance;
+import software.amazon.awssdk.services.ec2.model.InstanceState;
+import software.amazon.awssdk.services.ec2.model.InstanceStateName;
+import software.amazon.awssdk.services.ec2.model.Tag;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
@@ -72,7 +71,7 @@
import static org.hamcrest.Matchers.is;
@SuppressForbidden(reason = "use a http server")
-public class Ec2DiscoveryTests extends AbstractEC2MockAPITestCase {
+public class Ec2DiscoveryTests extends AbstractEc2MockAPITestCase {
private static final String SUFFIX_PRIVATE_DNS = ".ec2.internal";
private static final String PREFIX_PRIVATE_DNS = "mock-ip-";
@@ -111,7 +110,7 @@ protected List buildDynamicHosts(Settings nodeSettings, int no
try (Ec2DiscoveryPlugin plugin = new Ec2DiscoveryPlugin(buildSettings(accessKey))) {
AwsEc2SeedHostsProvider provider = new AwsEc2SeedHostsProvider(nodeSettings, transportService, plugin.ec2Service);
httpServer.createContext("/", exchange -> {
- if (exchange.getRequestMethod().equals(HttpMethodName.POST.name())) {
+ if (exchange.getRequestMethod().equals("POST")) {
final String request = Streams.readFully(exchange.getRequestBody()).toBytesRef().utf8ToString();
final String userAgent = exchange.getRequestHeaders().getFirst("User-Agent");
if (userAgent != null && userAgent.startsWith("aws-sdk-java")) {
@@ -124,7 +123,7 @@ protected List buildDynamicHosts(Settings nodeSettings, int no
final String[] params = request.split("&");
Arrays.stream(params).filter(entry -> entry.startsWith("Filter.") && entry.contains("=tag%3A")).forEach(entry -> {
final int startIndex = "Filter.".length();
- final int filterId = Integer.parseInt(entry.substring(startIndex, entry.indexOf(".", startIndex)));
+ final String filterId = entry.substring(startIndex, entry.indexOf(".", startIndex));
tagsIncluded.put(
entry.substring(entry.indexOf("=tag%3A") + "=tag%3A".length()),
Arrays.stream(params)
@@ -135,25 +134,26 @@ protected List buildDynamicHosts(Settings nodeSettings, int no
});
final List instances = IntStream.range(1, nodes + 1).mapToObj(node -> {
final String instanceId = "node" + node;
- final Instance instance = new Instance().withInstanceId(instanceId)
- .withState(new InstanceState().withName(InstanceStateName.Running))
- .withPrivateDnsName(PREFIX_PRIVATE_DNS + instanceId + SUFFIX_PRIVATE_DNS)
- .withPublicDnsName(PREFIX_PUBLIC_DNS + instanceId + SUFFIX_PUBLIC_DNS)
- .withPrivateIpAddress(PREFIX_PRIVATE_IP + node)
- .withPublicIpAddress(PREFIX_PUBLIC_IP + node);
+ final Instance.Builder instanceBuilder = Instance.builder()
+ .instanceId(instanceId)
+ .state(InstanceState.builder().name(InstanceStateName.RUNNING).build())
+ .privateDnsName(PREFIX_PRIVATE_DNS + instanceId + SUFFIX_PRIVATE_DNS)
+ .publicDnsName(PREFIX_PUBLIC_DNS + instanceId + SUFFIX_PUBLIC_DNS)
+ .privateIpAddress(PREFIX_PRIVATE_IP + node)
+ .publicIpAddress(PREFIX_PUBLIC_IP + node);
if (tagsList != null) {
- instance.setTags(tagsList.get(node - 1));
+ instanceBuilder.tags(tagsList.get(node - 1));
}
- return instance;
+ return instanceBuilder.build();
})
.filter(
instance -> tagsIncluded.entrySet()
.stream()
.allMatch(
- entry -> instance.getTags()
+ entry -> instance.tags()
.stream()
- .filter(t -> t.getKey().equals(entry.getKey()))
- .map(Tag::getValue)
+ .filter(t -> t.key().equals(entry.getKey()))
+ .map(Tag::value)
.collect(Collectors.toList())
.containsAll(entry.getValue())
)
@@ -273,10 +273,10 @@ public void testFilterByTags() throws InterruptedException {
for (int node = 0; node < nodes; node++) {
List tags = new ArrayList<>();
if (randomBoolean()) {
- tags.add(new Tag("stage", "prod"));
+ tags.add(Tag.builder().key("stage").value("prod").build());
prodInstances++;
} else {
- tags.add(new Tag("stage", "dev"));
+ tags.add(Tag.builder().key("stage").value("dev").build());
}
tagsList.add(tags);
}
@@ -296,15 +296,15 @@ public void testFilterByMultipleTags() throws InterruptedException {
for (int node = 0; node < nodes; node++) {
List tags = new ArrayList<>();
if (randomBoolean()) {
- tags.add(new Tag("stage", "prod"));
+ tags.add(Tag.builder().key("stage").value("prod").build());
if (randomBoolean()) {
- tags.add(new Tag("stage", "preprod"));
+ tags.add(Tag.builder().key("stage").value("preprod").build());
prodInstances++;
}
} else {
- tags.add(new Tag("stage", "dev"));
+ tags.add(Tag.builder().key("stage").value("dev").build());
if (randomBoolean()) {
- tags.add(new Tag("stage", "preprod"));
+ tags.add(Tag.builder().key("stage").value("preprod").build());
}
}
tagsList.add(tags);
@@ -331,7 +331,7 @@ public void testReadHostFromTag() throws UnknownHostException {
for (int node = 0; node < nodes; node++) {
List tags = new ArrayList<>();
- tags.add(new Tag("foo", "node" + (node + 1)));
+ tags.add(Tag.builder().key("foo").value("node" + (node + 1)).build());
tagsList.add(tags);
}
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2NetworkTests.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2NetworkTests.java
index 75224e6bab348..c8cb26026228b 100644
--- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2NetworkTests.java
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2NetworkTests.java
@@ -39,7 +39,6 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.Strings;
import org.opensearch.rest.RestStatus;
-import org.opensearch.test.OpenSearchTestCase;
import org.junit.AfterClass;
import org.junit.Before;
@@ -55,7 +54,6 @@
import java.util.Collections;
import java.util.function.BiConsumer;
-import static com.amazonaws.SDKGlobalConfiguration.EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hamcrest.Matchers.arrayContaining;
import static org.hamcrest.Matchers.equalTo;
@@ -67,7 +65,7 @@
* They aren't.
*/
@SuppressForbidden(reason = "use http server")
-public class Ec2NetworkTests extends OpenSearchTestCase {
+public class Ec2NetworkTests extends AbstractEc2DiscoveryTestCase {
private static HttpServer httpServer;
@@ -97,7 +95,7 @@ public void setup() {
// redirect EC2 metadata service to httpServer
AccessController.doPrivileged(
(PrivilegedAction) () -> System.setProperty(
- EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY,
+ "aws.ec2MetadataServiceEndpoint",
"http://" + httpServer.getAddress().getHostName() + ":" + httpServer.getAddress().getPort()
)
);
@@ -122,7 +120,7 @@ public void testNetworkHostEc2() throws IOException {
public void testNetworkHostUnableToResolveEc2() {
// redirect EC2 metadata service to unknown location
AccessController.doPrivileged(
- (PrivilegedAction) () -> System.setProperty(EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY, "http://127.0.0.1/")
+ (PrivilegedAction) () -> System.setProperty("aws.ec2MetadataServiceEndpoint", "http://127.0.0.1/")
);
try {
diff --git a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/EC2RetriesTests.java b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2RetriesTests.java
similarity index 93%
rename from plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/EC2RetriesTests.java
rename to plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2RetriesTests.java
index 9443eed5efae9..ebb2fb6dd1783 100644
--- a/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/EC2RetriesTests.java
+++ b/plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2RetriesTests.java
@@ -32,8 +32,7 @@
package org.opensearch.discovery.ec2;
-import com.amazonaws.http.HttpMethodName;
-import com.amazonaws.services.ec2.model.Instance;
+import software.amazon.awssdk.services.ec2.model.Instance;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
@@ -64,8 +63,7 @@
import static org.hamcrest.Matchers.is;
@SuppressForbidden(reason = "use a http server")
-public class EC2RetriesTests extends AbstractEC2MockAPITestCase {
-
+public class Ec2RetriesTests extends AbstractEc2MockAPITestCase {
@Override
protected MockTransportService createTransportService() {
return new MockTransportService(
@@ -92,7 +90,7 @@ public void testEC2DiscoveryRetriesOnRateLimiting() throws IOException {
// retry the same request 5 times at most
final int maxRetries = randomIntBetween(1, 5);
httpServer.createContext("/", exchange -> {
- if (exchange.getRequestMethod().equals(HttpMethodName.POST.name())) {
+ if (exchange.getRequestMethod().equals("POST")) {
final String request = Streams.readFully(exchange.getRequestBody()).utf8ToString();
final String userAgent = exchange.getRequestHeaders().getFirst("User-Agent");
if (userAgent != null && userAgent.startsWith("aws-sdk-java")) {
@@ -112,7 +110,9 @@ public void testEC2DiscoveryRetriesOnRateLimiting() throws IOException {
for (NameValuePair parse : URLEncodedUtils.parse(request, UTF_8)) {
if ("Action".equals(parse.getName())) {
responseBody = generateDescribeInstancesResponse(
- hosts.stream().map(address -> new Instance().withPublicIpAddress(address)).collect(Collectors.toList())
+ hosts.stream()
+ .map(address -> Instance.builder().publicIpAddress(address).build())
+ .collect(Collectors.toList())
);
break;
}
diff --git a/plugins/identity-shiro/build.gradle b/plugins/identity-shiro/build.gradle
index c02f3727f935e..22dc21864b620 100644
--- a/plugins/identity-shiro/build.gradle
+++ b/plugins/identity-shiro/build.gradle
@@ -18,6 +18,7 @@ opensearchplugin {
dependencies {
implementation 'org.apache.shiro:shiro-core:1.11.0'
+
// Needed for shiro
implementation "org.slf4j:slf4j-api:${versions.slf4j}"
@@ -25,12 +26,15 @@ dependencies {
implementation 'commons-logging:commons-logging:1.2'
implementation 'commons-lang:commons-lang:2.6'
+ implementation 'org.passay:passay:1.6.3'
+
implementation "org.bouncycastle:bcprov-jdk15on:${versions.bouncycastle}"
testImplementation project(path: ':modules:transport-netty4') // for http
testImplementation project(path: ':plugins:transport-nio') // for http
testImplementation "org.mockito:mockito-core:${versions.mockito}"
- testImplementation project(path: ':client:rest-high-level')
+ testImplementation project(path: ':client:rest-high-level')
+ testImplementation 'junit:junit:4.13.2'
}
/*
@@ -46,6 +50,7 @@ internalClusterTest {
}
thirdPartyAudit.ignoreMissingClasses(
+ 'com.google.common.hash.BloomFilter',
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',
'org.apache.avalon.framework.logger.Logger',
@@ -61,7 +66,10 @@ thirdPartyAudit.ignoreMissingClasses(
'org.apache.log4j.Level',
'org.apache.log4j.Logger',
'org.apache.log4j.Priority',
+ 'org.cryptacular.bean.HashBean',
'org.slf4j.impl.StaticLoggerBinder',
'org.slf4j.impl.StaticMDCBinder',
- 'org.slf4j.impl.StaticMarkerBinder'
+ 'org.slf4j.impl.StaticMarkerBinder',
+ 'org.springframework.context.MessageSource',
+ 'org.springframework.context.support.MessageSourceAccessor'
)
diff --git a/plugins/identity-shiro/licenses/passay-1.6.3.jar.sha1 b/plugins/identity-shiro/licenses/passay-1.6.3.jar.sha1
new file mode 100644
index 0000000000000..52ac0b1a81469
--- /dev/null
+++ b/plugins/identity-shiro/licenses/passay-1.6.3.jar.sha1
@@ -0,0 +1 @@
+bae4754c87297f5600e4071b2596c0b6625cf92b
\ No newline at end of file
diff --git a/plugins/identity-shiro/licenses/passay-LICENSE.txt b/plugins/identity-shiro/licenses/passay-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/identity-shiro/licenses/passay-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/identity-shiro/licenses/passay-NOTICE.txt b/plugins/identity-shiro/licenses/passay-NOTICE.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/AuthTokenHandler.java b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/AuthTokenHandler.java
deleted file mode 100644
index 14801b665f14f..0000000000000
--- a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/AuthTokenHandler.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- *
- * The OpenSearch Contributors require contributions made to
- * this file be licensed under the Apache-2.0 license or a
- * compatible open source license.
- */
-
-package org.opensearch.identity.shiro;
-
-import java.util.Optional;
-
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.opensearch.identity.tokens.BasicAuthToken;
-
-/**
- * Extracts Shiro's {@link AuthenticationToken} from different types of auth headers
- *
- * @opensearch.experimental
- */
-class AuthTokenHandler {
-
- /**
- * Translates into shiro auth token from the given header token
- * @param authenticationToken the token from which to translate
- * @return An optional of the shiro auth token for login
- */
- public Optional translateAuthToken(org.opensearch.identity.tokens.AuthToken authenticationToken) {
- if (authenticationToken instanceof BasicAuthToken) {
- final BasicAuthToken basicAuthToken = (BasicAuthToken) authenticationToken;
- return Optional.of(new UsernamePasswordToken(basicAuthToken.getUser(), basicAuthToken.getPassword()));
- }
-
- return Optional.empty();
- }
-}
diff --git a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroIdentityPlugin.java b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroIdentityPlugin.java
index eee5dd8ce0bd4..c3c08b1359aaa 100644
--- a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroIdentityPlugin.java
+++ b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroIdentityPlugin.java
@@ -11,6 +11,7 @@
import org.opensearch.identity.Subject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.opensearch.identity.tokens.TokenManager;
import org.opensearch.plugins.IdentityPlugin;
import org.opensearch.common.settings.Settings;
import org.opensearch.plugins.Plugin;
@@ -26,7 +27,7 @@ public final class ShiroIdentityPlugin extends Plugin implements IdentityPlugin
private Logger log = LogManager.getLogger(this.getClass());
private final Settings settings;
- private final AuthTokenHandler authTokenHandler;
+ private final ShiroTokenManager authTokenHandler;
/**
* Create a new instance of the Shiro Identity Plugin
@@ -35,7 +36,7 @@ public final class ShiroIdentityPlugin extends Plugin implements IdentityPlugin
*/
public ShiroIdentityPlugin(final Settings settings) {
this.settings = settings;
- authTokenHandler = new AuthTokenHandler();
+ authTokenHandler = new ShiroTokenManager();
SecurityManager securityManager = new ShiroSecurityManager();
SecurityUtils.setSecurityManager(securityManager);
@@ -50,4 +51,14 @@ public ShiroIdentityPlugin(final Settings settings) {
public Subject getSubject() {
return new ShiroSubject(authTokenHandler, SecurityUtils.getSubject());
}
+
+ /**
+ * Return the Shiro Token Handler
+ *
+ * @return the Shiro Token Handler
+ */
+ @Override
+ public TokenManager getTokenManager() {
+ return this.authTokenHandler;
+ }
}
diff --git a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroSubject.java b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroSubject.java
index 3208d2bb5d8ca..89a801d1aab76 100644
--- a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroSubject.java
+++ b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroSubject.java
@@ -20,7 +20,7 @@
* @opensearch.experimental
*/
public class ShiroSubject implements Subject {
- private final AuthTokenHandler authTokenHandler;
+ private final ShiroTokenManager authTokenHandler;
private final org.apache.shiro.subject.Subject shiroSubject;
/**
@@ -29,7 +29,7 @@ public class ShiroSubject implements Subject {
* @param authTokenHandler Used to extract auth header info
* @param subject The specific subject being authc/z'd
*/
- public ShiroSubject(final AuthTokenHandler authTokenHandler, final org.apache.shiro.subject.Subject subject) {
+ public ShiroSubject(final ShiroTokenManager authTokenHandler, final org.apache.shiro.subject.Subject subject) {
this.authTokenHandler = Objects.requireNonNull(authTokenHandler);
this.shiroSubject = Objects.requireNonNull(subject);
}
diff --git a/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroTokenManager.java b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroTokenManager.java
new file mode 100644
index 0000000000000..110095a5cd4ef
--- /dev/null
+++ b/plugins/identity-shiro/src/main/java/org/opensearch/identity/shiro/ShiroTokenManager.java
@@ -0,0 +1,135 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.identity.shiro;
+
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Random;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.opensearch.common.Randomness;
+import org.opensearch.identity.IdentityService;
+import org.opensearch.identity.tokens.AuthToken;
+import org.opensearch.identity.tokens.BasicAuthToken;
+import org.opensearch.identity.tokens.TokenManager;
+import org.passay.CharacterRule;
+import org.passay.EnglishCharacterData;
+import org.passay.PasswordGenerator;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+/**
+ * Extracts Shiro's {@link AuthenticationToken} from different types of auth headers
+ *
+ * @opensearch.experimental
+ */
+class ShiroTokenManager implements TokenManager {
+
+ private static final Logger log = LogManager.getLogger(IdentityService.class);
+
+ private static Map shiroTokenPasswordMap = new HashMap<>();
+
+ /**
+ * Translates into shiro auth token from the given header token
+ * @param authenticationToken the token from which to translate
+ * @return An optional of the shiro auth token for login
+ */
+ public Optional translateAuthToken(org.opensearch.identity.tokens.AuthToken authenticationToken) {
+ if (authenticationToken instanceof BasicAuthToken) {
+ final BasicAuthToken basicAuthToken = (BasicAuthToken) authenticationToken;
+ return Optional.of(new UsernamePasswordToken(basicAuthToken.getUser(), basicAuthToken.getPassword()));
+ }
+
+ return Optional.empty();
+ }
+
+ @Override
+ public AuthToken issueToken(String audience) {
+
+ String password = generatePassword();
+ final byte[] rawEncoded = Base64.getEncoder().encode((audience + ":" + password).getBytes(UTF_8));
+ final String usernamePassword = new String(rawEncoded, UTF_8);
+ final String header = "Basic " + usernamePassword;
+ BasicAuthToken token = new BasicAuthToken(header);
+ shiroTokenPasswordMap.put(token, password);
+
+ return token;
+ }
+
+ public boolean validateToken(AuthToken token) {
+ if (token instanceof BasicAuthToken) {
+ final BasicAuthToken basicAuthToken = (BasicAuthToken) token;
+ return basicAuthToken.getUser().equals(SecurityUtils.getSubject().toString())
+ && basicAuthToken.getPassword().equals(shiroTokenPasswordMap.get(basicAuthToken));
+ }
+ return false;
+ }
+
+ public String getTokenInfo(AuthToken token) {
+ if (token instanceof BasicAuthToken) {
+ final BasicAuthToken basicAuthToken = (BasicAuthToken) token;
+ return basicAuthToken.toString();
+ }
+ throw new UnsupportedAuthenticationToken();
+ }
+
+ public void revokeToken(AuthToken token) {
+ if (token instanceof BasicAuthToken) {
+ final BasicAuthToken basicAuthToken = (BasicAuthToken) token;
+ basicAuthToken.revoke();
+ return;
+ }
+ throw new UnsupportedAuthenticationToken();
+ }
+
+ public void resetToken(AuthToken token) {
+ if (token instanceof BasicAuthToken) {
+ final BasicAuthToken basicAuthToken = (BasicAuthToken) token;
+ basicAuthToken.revoke();
+ }
+ }
+
+ /**
+ * When the ShiroTokenManager is in use, a random password is generated for each token and is then output to the logs.
+ * The password is used for development only.
+ * @return A randomly generated password for development
+ */
+ public String generatePassword() {
+
+ CharacterRule lowercaseCharacterRule = new CharacterRule(EnglishCharacterData.LowerCase, 1);
+ CharacterRule uppercaseCharacterRule = new CharacterRule(EnglishCharacterData.UpperCase, 1);
+ CharacterRule numericCharacterRule = new CharacterRule(EnglishCharacterData.Digit, 1);
+ CharacterRule specialCharacterRule = new CharacterRule(EnglishCharacterData.Special, 1);
+
+ List rules = Arrays.asList(
+ lowercaseCharacterRule,
+ uppercaseCharacterRule,
+ numericCharacterRule,
+ specialCharacterRule
+ );
+ PasswordGenerator passwordGenerator = new PasswordGenerator();
+
+ Random random = Randomness.get();
+
+ String password = passwordGenerator.generatePassword(random.nextInt(8) + 8, rules); // Generate a 8 to 16 char password
+ log.info("Generated password: " + password);
+ return password;
+ }
+
+ Map getShiroTokenPasswordMap() {
+ return shiroTokenPasswordMap;
+ }
+
+}
diff --git a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/AuthTokenHandlerTests.java b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/AuthTokenHandlerTests.java
index 942d777df2086..540fed368aeda 100644
--- a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/AuthTokenHandlerTests.java
+++ b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/AuthTokenHandlerTests.java
@@ -8,32 +8,41 @@
package org.opensearch.identity.shiro;
+import java.util.Optional;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
+import org.junit.Before;
+import org.opensearch.identity.noop.NoopTokenManager;
+import org.opensearch.identity.tokens.AuthToken;
import org.opensearch.identity.tokens.BasicAuthToken;
+import org.opensearch.identity.tokens.BearerAuthToken;
import org.opensearch.test.OpenSearchTestCase;
-import org.junit.Before;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.instanceOf;
+import org.passay.CharacterCharacteristicsRule;
+import org.passay.CharacterRule;
+import org.passay.EnglishCharacterData;
+import org.passay.LengthRule;
+import org.passay.PasswordData;
+import org.passay.PasswordValidator;
import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
-import java.util.Optional;
-
public class AuthTokenHandlerTests extends OpenSearchTestCase {
- private AuthTokenHandler authTokenHandler;
+ private ShiroTokenManager shiroAuthTokenHandler;
+ private NoopTokenManager noopTokenManager;
@Before
public void testSetup() {
- authTokenHandler = new AuthTokenHandler();
+ shiroAuthTokenHandler = new ShiroTokenManager();
+ noopTokenManager = new NoopTokenManager();
}
public void testShouldExtractBasicAuthTokenSuccessfully() {
final BasicAuthToken authToken = new BasicAuthToken("Basic YWRtaW46YWRtaW4="); // admin:admin
- final AuthenticationToken translatedToken = authTokenHandler.translateAuthToken(authToken).get();
+ final AuthenticationToken translatedToken = shiroAuthTokenHandler.translateAuthToken(authToken).get();
assertThat(translatedToken, is(instanceOf(UsernamePasswordToken.class)));
final UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) translatedToken;
@@ -45,7 +54,7 @@ public void testShouldExtractBasicAuthTokenSuccessfully() {
public void testShouldExtractBasicAuthTokenSuccessfully_twoSemiColonPassword() {
final BasicAuthToken authToken = new BasicAuthToken("Basic dGVzdDp0ZTpzdA=="); // test:te:st
- final AuthenticationToken translatedToken = authTokenHandler.translateAuthToken(authToken).get();
+ final AuthenticationToken translatedToken = shiroAuthTokenHandler.translateAuthToken(authToken).get();
assertThat(translatedToken, is(instanceOf(UsernamePasswordToken.class)));
final UsernamePasswordToken usernamePasswordToken = (UsernamePasswordToken) translatedToken;
@@ -55,8 +64,84 @@ public void testShouldExtractBasicAuthTokenSuccessfully_twoSemiColonPassword() {
}
public void testShouldReturnNullWhenExtractingNullToken() {
- final Optional translatedToken = authTokenHandler.translateAuthToken(null);
+ final Optional translatedToken = shiroAuthTokenHandler.translateAuthToken(null);
assertThat(translatedToken.isEmpty(), is(true));
}
+
+ public void testShouldRevokeTokenSuccessfully() {
+ final BasicAuthToken authToken = new BasicAuthToken("Basic dGVzdDp0ZTpzdA==");
+ assertTrue(authToken.toString().equals("Basic auth token with user=test, password=te:st"));
+ shiroAuthTokenHandler.revokeToken(authToken);
+ assert (authToken.toString().equals("Basic auth token with user=, password="));
+ }
+
+ public void testShouldResetTokenSuccessfully() {
+ final BasicAuthToken authToken = new BasicAuthToken("Basic dGVzdDp0ZTpzdA==");
+ assertTrue(authToken.toString().equals("Basic auth token with user=test, password=te:st"));
+ shiroAuthTokenHandler.resetToken(authToken);
+ assert (authToken.toString().equals("Basic auth token with user=, password="));
+ }
+
+ public void testShouldFailWhenRevokeToken() {
+ final BearerAuthToken bearerAuthToken = new BearerAuthToken("header.payload.signature");
+ assert (bearerAuthToken.getTokenIdentifier().equals("Bearer"));
+ assertThrows(UnsupportedAuthenticationToken.class, () -> shiroAuthTokenHandler.revokeToken(bearerAuthToken));
+ }
+
+ public void testShouldFailGetTokenInfo() {
+ final BearerAuthToken bearerAuthToken = new BearerAuthToken("header.payload.signature");
+ assert (bearerAuthToken.getTokenIdentifier().equals("Bearer"));
+ assertThrows(UnsupportedAuthenticationToken.class, () -> shiroAuthTokenHandler.getTokenInfo(bearerAuthToken));
+ }
+
+ public void testShouldFailValidateToken() {
+ final BearerAuthToken bearerAuthToken = new BearerAuthToken("header.payload.signature");
+ assertFalse(shiroAuthTokenHandler.validateToken(bearerAuthToken));
+ }
+
+ public void testShoudPassMapLookupWithToken() {
+ final BasicAuthToken authToken = new BasicAuthToken("Basic dGVzdDp0ZTpzdA==");
+ shiroAuthTokenHandler.getShiroTokenPasswordMap().put(authToken, "te:st");
+ assertTrue(authToken.getPassword().equals(shiroAuthTokenHandler.getShiroTokenPasswordMap().get(authToken)));
+ }
+
+ public void testShouldPassThrougbResetToken(AuthToken token) {
+ final BearerAuthToken bearerAuthToken = new BearerAuthToken("header.payload.signature");
+ shiroAuthTokenHandler.resetToken(bearerAuthToken);
+ }
+
+ public void testVerifyBearerTokenObject() {
+ BearerAuthToken testGoodToken = new BearerAuthToken("header.payload.signature");
+ IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> new BearerAuthToken("asddfhadfasdfad"));
+ assert (exception.getMessage().contains("Illegally formed bearer authorization token "));
+ assertEquals(testGoodToken.getCompleteToken(), "header.payload.signature");
+ assertEquals(testGoodToken.getTokenIdentifier(), "Bearer");
+ assertEquals(testGoodToken.getHeader(), "header");
+ assertEquals(testGoodToken.getPayload(), "payload");
+ assertEquals(testGoodToken.getSignature(), "signature");
+ assertEquals(testGoodToken.toString(), "Bearer auth token with header=header, payload=payload, signature=signature");
+ }
+
+ public void testGeneratedPasswordContents() {
+ String password = shiroAuthTokenHandler.generatePassword();
+ PasswordData data = new PasswordData(password);
+
+ LengthRule lengthRule = new LengthRule(8, 16);
+
+ CharacterCharacteristicsRule characteristicsRule = new CharacterCharacteristicsRule();
+
+ // Define M (3 in this case)
+ characteristicsRule.setNumberOfCharacteristics(3);
+
+ // Define elements of N (upper, lower, digit, symbol)
+ characteristicsRule.getRules().add(new CharacterRule(EnglishCharacterData.UpperCase, 1));
+ characteristicsRule.getRules().add(new CharacterRule(EnglishCharacterData.LowerCase, 1));
+ characteristicsRule.getRules().add(new CharacterRule(EnglishCharacterData.Digit, 1));
+ characteristicsRule.getRules().add(new CharacterRule(EnglishCharacterData.Special, 1));
+
+ PasswordValidator validator = new PasswordValidator(lengthRule, characteristicsRule);
+ validator.validate(data);
+ }
+
}
diff --git a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java
new file mode 100644
index 0000000000000..f06dff7eea382
--- /dev/null
+++ b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroIdentityPluginTests.java
@@ -0,0 +1,40 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ */
+
+package org.opensearch.identity.shiro;
+
+import java.util.List;
+import org.opensearch.OpenSearchException;
+import org.opensearch.common.settings.Settings;
+import org.opensearch.identity.IdentityService;
+import org.opensearch.plugins.IdentityPlugin;
+import org.opensearch.test.OpenSearchTestCase;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertThrows;
+
+public class ShiroIdentityPluginTests extends OpenSearchTestCase {
+
+ public void testSingleIdentityPluginSucceeds() {
+ IdentityPlugin identityPlugin1 = new ShiroIdentityPlugin(Settings.EMPTY);
+ List pluginList1 = List.of(identityPlugin1);
+ IdentityService identityService1 = new IdentityService(Settings.EMPTY, pluginList1);
+ assertThat(identityService1.getTokenManager(), is(instanceOf(ShiroTokenManager.class)));
+ }
+
+ public void testMultipleIdentityPluginsFail() {
+ IdentityPlugin identityPlugin1 = new ShiroIdentityPlugin(Settings.EMPTY);
+ IdentityPlugin identityPlugin2 = new ShiroIdentityPlugin(Settings.EMPTY);
+ IdentityPlugin identityPlugin3 = new ShiroIdentityPlugin(Settings.EMPTY);
+ List pluginList = List.of(identityPlugin1, identityPlugin2, identityPlugin3);
+ Exception ex = assertThrows(OpenSearchException.class, () -> new IdentityService(Settings.EMPTY, pluginList));
+ assert (ex.getMessage().contains("Multiple identity plugins are not supported,"));
+ }
+
+}
diff --git a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroSubjectTests.java b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroSubjectTests.java
index baf6090f79ff3..930945e9a2d8d 100644
--- a/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroSubjectTests.java
+++ b/plugins/identity-shiro/src/test/java/org/opensearch/identity/shiro/ShiroSubjectTests.java
@@ -25,13 +25,13 @@
public class ShiroSubjectTests extends OpenSearchTestCase {
private org.apache.shiro.subject.Subject shiroSubject;
- private AuthTokenHandler authTokenHandler;
+ private ShiroTokenManager authTokenHandler;
private ShiroSubject subject;
@Before
public void setup() {
shiroSubject = mock(org.apache.shiro.subject.Subject.class);
- authTokenHandler = mock(AuthTokenHandler.class);
+ authTokenHandler = mock(ShiroTokenManager.class);
subject = new ShiroSubject(authTokenHandler, shiroSubject);
}
diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle
index 4ca580ba3620f..1f3c80909733c 100644
--- a/plugins/ingest-attachment/build.gradle
+++ b/plugins/ingest-attachment/build.gradle
@@ -57,7 +57,7 @@ dependencies {
runtimeOnly "com.google.guava:guava:${versions.guava}"
// Other dependencies
api 'org.tukaani:xz:1.9'
- api 'commons-io:commons-io:2.11.0'
+ api 'commons-io:commons-io:2.13.0'
api "org.slf4j:slf4j-api:${versions.slf4j}"
// character set detection
@@ -126,7 +126,6 @@ thirdPartyAudit {
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
- 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3',
'com.google.common.hash.Striped64',
'com.google.common.hash.Striped64$1',
'com.google.common.hash.Striped64$Cell',
diff --git a/plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1 b/plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1
deleted file mode 100644
index 8adec30bade49..0000000000000
--- a/plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a2503f302b11ebde7ebc3df41daebe0e4eea3689
\ No newline at end of file
diff --git a/plugins/ingest-attachment/licenses/commons-io-2.13.0.jar.sha1 b/plugins/ingest-attachment/licenses/commons-io-2.13.0.jar.sha1
new file mode 100644
index 0000000000000..c165136eb5822
--- /dev/null
+++ b/plugins/ingest-attachment/licenses/commons-io-2.13.0.jar.sha1
@@ -0,0 +1 @@
+8bb2bc9b4df17e2411533a0708a69f983bf5e83b
\ No newline at end of file
diff --git a/plugins/ingest-attachment/licenses/guava-31.1-jre.jar.sha1 b/plugins/ingest-attachment/licenses/guava-31.1-jre.jar.sha1
deleted file mode 100644
index e57390ebe1299..0000000000000
--- a/plugins/ingest-attachment/licenses/guava-31.1-jre.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-60458f877d055d0c9114d9e1a2efb737b4bc282c
\ No newline at end of file
diff --git a/plugins/ingest-attachment/licenses/guava-32.0.1-jre.jar.sha1 b/plugins/ingest-attachment/licenses/guava-32.0.1-jre.jar.sha1
new file mode 100644
index 0000000000000..80dc9e9308a6c
--- /dev/null
+++ b/plugins/ingest-attachment/licenses/guava-32.0.1-jre.jar.sha1
@@ -0,0 +1 @@
+6e5d51a72d142f2d40a57dfb897188b36a95b489
\ No newline at end of file
diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle
index 7b18facadcb30..48a49af165542 100644
--- a/plugins/repository-azure/build.gradle
+++ b/plugins/repository-azure/build.gradle
@@ -46,7 +46,7 @@ opensearchplugin {
dependencies {
api 'com.azure:azure-core:1.39.0'
api 'com.azure:azure-json:1.0.1'
- api 'com.azure:azure-storage-common:12.21.0'
+ api 'com.azure:azure-storage-common:12.21.2'
api 'com.azure:azure-core-http-netty:1.12.8'
api "io.netty:netty-codec-dns:${versions.netty}"
api "io.netty:netty-codec-socks:${versions.netty}"
@@ -55,12 +55,12 @@ dependencies {
api "io.netty:netty-resolver-dns:${versions.netty}"
api "io.netty:netty-transport-native-unix-common:${versions.netty}"
implementation project(':modules:transport-netty4')
- api 'com.azure:azure-storage-blob:12.21.1'
+ api 'com.azure:azure-storage-blob:12.22.2'
api 'org.reactivestreams:reactive-streams:1.0.4'
- api 'io.projectreactor:reactor-core:3.5.1'
- api 'io.projectreactor.netty:reactor-netty:1.1.4'
- api 'io.projectreactor.netty:reactor-netty-core:1.1.5'
- api 'io.projectreactor.netty:reactor-netty-http:1.1.4'
+ api 'io.projectreactor:reactor-core:3.5.6'
+ api 'io.projectreactor.netty:reactor-netty:1.1.7'
+ api 'io.projectreactor.netty:reactor-netty-core:1.1.7'
+ api 'io.projectreactor.netty:reactor-netty-http:1.1.7'
api "org.slf4j:slf4j-api:${versions.slf4j}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
@@ -69,7 +69,7 @@ dependencies {
api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}"
api 'org.codehaus.woodstox:stax2-api:4.2.1'
implementation "com.fasterxml.woodstox:woodstox-core:${versions.woodstox}"
- runtimeOnly 'com.google.guava:guava:31.1-jre'
+ runtimeOnly "com.google.guava:guava:${versions.guava}"
api 'org.apache.commons:commons-lang3:3.12.0'
testImplementation project(':test:fixtures:azure-fixture')
}
@@ -170,6 +170,7 @@ thirdPartyAudit {
'org.slf4j.impl.StaticMarkerBinder',
'reactor.blockhound.BlockHound$Builder',
'reactor.blockhound.integration.BlockHoundIntegration',
+ 'io.micrometer.context.ThreadLocalAccessor',
'io.micrometer.common.KeyValue',
'io.micrometer.common.KeyValues',
'io.micrometer.common.docs.KeyName',
@@ -205,7 +206,6 @@ thirdPartyAudit {
'com.google.common.hash.Striped64$Cell',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
- 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
diff --git a/plugins/repository-azure/licenses/azure-storage-blob-12.21.1.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-blob-12.21.1.jar.sha1
deleted file mode 100644
index e51bb4d4d9d53..0000000000000
--- a/plugins/repository-azure/licenses/azure-storage-blob-12.21.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-23fc5d2e3266246056a9735315911d200e892d4e
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/azure-storage-blob-12.22.2.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-blob-12.22.2.jar.sha1
new file mode 100644
index 0000000000000..a03bb750a0a96
--- /dev/null
+++ b/plugins/repository-azure/licenses/azure-storage-blob-12.22.2.jar.sha1
@@ -0,0 +1 @@
+1441a678a0d28ed3b22efc27fef4752f91502834
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/azure-storage-common-12.21.0.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-common-12.21.0.jar.sha1
deleted file mode 100644
index 7bfa9273776e8..0000000000000
--- a/plugins/repository-azure/licenses/azure-storage-common-12.21.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0aeabde8faba0ab8b73eadbedfc3c4e52112f5c4
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/azure-storage-common-12.21.2.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-common-12.21.2.jar.sha1
new file mode 100644
index 0000000000000..b3c73774764df
--- /dev/null
+++ b/plugins/repository-azure/licenses/azure-storage-common-12.21.2.jar.sha1
@@ -0,0 +1 @@
+d2676d4fc40a501bd5d0437b8d2bfb9926022bea
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/guava-31.1-jre.jar.sha1 b/plugins/repository-azure/licenses/guava-31.1-jre.jar.sha1
deleted file mode 100644
index e57390ebe1299..0000000000000
--- a/plugins/repository-azure/licenses/guava-31.1-jre.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-60458f877d055d0c9114d9e1a2efb737b4bc282c
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/guava-32.0.1-jre.jar.sha1 b/plugins/repository-azure/licenses/guava-32.0.1-jre.jar.sha1
new file mode 100644
index 0000000000000..80dc9e9308a6c
--- /dev/null
+++ b/plugins/repository-azure/licenses/guava-32.0.1-jre.jar.sha1
@@ -0,0 +1 @@
+6e5d51a72d142f2d40a57dfb897188b36a95b489
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-annotations-2.15.1.jar.sha1 b/plugins/repository-azure/licenses/jackson-annotations-2.15.1.jar.sha1
deleted file mode 100644
index a3ade4ff8dadc..0000000000000
--- a/plugins/repository-azure/licenses/jackson-annotations-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-092a90d3739e970e03b5971839e4fe51f13c1fa3
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-annotations-2.15.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-annotations-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f63416ddb8ceb
--- /dev/null
+++ b/plugins/repository-azure/licenses/jackson-annotations-2.15.2.jar.sha1
@@ -0,0 +1 @@
+4724a65ac8e8d156a24898d50fd5dbd3642870b8
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-databind-2.15.1.jar.sha1 b/plugins/repository-azure/licenses/jackson-databind-2.15.1.jar.sha1
deleted file mode 100644
index 47405b86d4a51..0000000000000
--- a/plugins/repository-azure/licenses/jackson-databind-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ac9ba74d208faf356e4719a49e59c6ea9237c01d
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-databind-2.15.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-databind-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f16d80af8dce6
--- /dev/null
+++ b/plugins/repository-azure/licenses/jackson-databind-2.15.2.jar.sha1
@@ -0,0 +1 @@
+9353b021f10c307c00328f52090de2bdb4b6ff9c
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-dataformat-xml-2.15.1.jar.sha1 b/plugins/repository-azure/licenses/jackson-dataformat-xml-2.15.1.jar.sha1
deleted file mode 100644
index e874b204a1042..0000000000000
--- a/plugins/repository-azure/licenses/jackson-dataformat-xml-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-66e5b7284865d1175dd63d0ffc0385f8810e0810
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-dataformat-xml-2.15.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-dataformat-xml-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..18c388b84f333
--- /dev/null
+++ b/plugins/repository-azure/licenses/jackson-dataformat-xml-2.15.2.jar.sha1
@@ -0,0 +1 @@
+e7e9038dee5c1adb1ebd07d3669e0e1182ac5b60
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-datatype-jsr310-2.15.1.jar.sha1 b/plugins/repository-azure/licenses/jackson-datatype-jsr310-2.15.1.jar.sha1
deleted file mode 100644
index d8c64d8c48452..0000000000000
--- a/plugins/repository-azure/licenses/jackson-datatype-jsr310-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-21300ba63a6408bbd3505af4287d1b9a911a9718
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-datatype-jsr310-2.15.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-datatype-jsr310-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..6aa4f9b99c274
--- /dev/null
+++ b/plugins/repository-azure/licenses/jackson-datatype-jsr310-2.15.2.jar.sha1
@@ -0,0 +1 @@
+30d16ec2aef6d8094c5e2dce1d95034ca8b6cb42
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-module-jaxb-annotations-2.15.1.jar.sha1 b/plugins/repository-azure/licenses/jackson-module-jaxb-annotations-2.15.1.jar.sha1
deleted file mode 100644
index 81921a29b9d15..0000000000000
--- a/plugins/repository-azure/licenses/jackson-module-jaxb-annotations-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ab2078805370360d32c77f1ba46dc9098f84daa6
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/jackson-module-jaxb-annotations-2.15.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-module-jaxb-annotations-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..80da08928f855
--- /dev/null
+++ b/plugins/repository-azure/licenses/jackson-module-jaxb-annotations-2.15.2.jar.sha1
@@ -0,0 +1 @@
+6a22fd1c7b0f9788e81eea32c11dc8c1ba421f18
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-codec-dns-4.1.91.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-codec-dns-4.1.91.Final.jar.sha1
deleted file mode 100644
index de151d86d4595..0000000000000
--- a/plugins/repository-azure/licenses/netty-codec-dns-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2c0242c69eee44ee559d02c564dbceee8bf0a5c7
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-codec-dns-4.1.93.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-codec-dns-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..8ddec4af248f4
--- /dev/null
+++ b/plugins/repository-azure/licenses/netty-codec-dns-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+a1433e4ae1cc56c0809b5b740ff8800d20b33c36
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-codec-http2-4.1.91.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-codec-http2-4.1.91.Final.jar.sha1
deleted file mode 100644
index d57336af7f414..0000000000000
--- a/plugins/repository-azure/licenses/netty-codec-http2-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4ee7027e1653c6ee3f843191e0d932f29e8e14e1
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-codec-http2-4.1.93.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..02423842d6244
--- /dev/null
+++ b/plugins/repository-azure/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+0f1625b43bde13ec057da0d2fe381ded2547a70e
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-codec-socks-4.1.91.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-codec-socks-4.1.91.Final.jar.sha1
deleted file mode 100644
index 10d7478ce02ca..0000000000000
--- a/plugins/repository-azure/licenses/netty-codec-socks-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-8f0a52677da411a8ab762c426d723c7f54471504
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-codec-socks-4.1.93.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-codec-socks-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..3e3f699a3b9a9
--- /dev/null
+++ b/plugins/repository-azure/licenses/netty-codec-socks-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+81ca78969afc60073e47c3b7b361cc3839392c73
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-handler-proxy-4.1.91.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-handler-proxy-4.1.91.Final.jar.sha1
deleted file mode 100644
index 116ed58f33a4d..0000000000000
--- a/plugins/repository-azure/licenses/netty-handler-proxy-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2e3e57eae1a61e4e5f558e39619186fec6c424d3
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-handler-proxy-4.1.93.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-handler-proxy-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..1ac94e6579c89
--- /dev/null
+++ b/plugins/repository-azure/licenses/netty-handler-proxy-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+c165c1efe1b9c0cc22546a057b530611a088768b
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-resolver-dns-4.1.91.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-resolver-dns-4.1.91.Final.jar.sha1
deleted file mode 100644
index 5f96d34bab52c..0000000000000
--- a/plugins/repository-azure/licenses/netty-resolver-dns-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e1567967f5a85a469b10b7394e3e2b90ea5c0b12
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-resolver-dns-4.1.93.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-resolver-dns-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..67eb275207963
--- /dev/null
+++ b/plugins/repository-azure/licenses/netty-resolver-dns-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+d5560348ab139dc9ea2dd9c0aa8ddffd0bf1b60f
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-transport-native-unix-common-4.1.91.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-transport-native-unix-common-4.1.91.Final.jar.sha1
deleted file mode 100644
index 6f45d642c8c0d..0000000000000
--- a/plugins/repository-azure/licenses/netty-transport-native-unix-common-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-80990b5885b8b67be096d7090cba18f05c67120e
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1 b/plugins/repository-azure/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..0f0acb2eccddf
--- /dev/null
+++ b/plugins/repository-azure/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+f4fb8b4c8da539091f43abcbb9f0389e48807eea
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-core-3.5.1.jar.sha1 b/plugins/repository-azure/licenses/reactor-core-3.5.1.jar.sha1
deleted file mode 100644
index 697203d58ff36..0000000000000
--- a/plugins/repository-azure/licenses/reactor-core-3.5.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d1e833c13320d3a3133be6a70a4f1a82466f65fe
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-core-3.5.6.jar.sha1 b/plugins/repository-azure/licenses/reactor-core-3.5.6.jar.sha1
new file mode 100644
index 0000000000000..ad9b7263e7b38
--- /dev/null
+++ b/plugins/repository-azure/licenses/reactor-core-3.5.6.jar.sha1
@@ -0,0 +1 @@
+027fdc551537b349389176a23a192f11a7a3d7de
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-netty-1.1.4.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-1.1.4.jar.sha1
deleted file mode 100644
index ab76deb3bc1f1..0000000000000
--- a/plugins/repository-azure/licenses/reactor-netty-1.1.4.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-1b66183ba316fbbd2d212eb9e9a3ba060ba557b0
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-netty-1.1.7.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-1.1.7.jar.sha1
new file mode 100644
index 0000000000000..01a9b1d34d52f
--- /dev/null
+++ b/plugins/repository-azure/licenses/reactor-netty-1.1.7.jar.sha1
@@ -0,0 +1 @@
+c16497c29f96ea7b1db538cb0ddde55d9be173fe
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-netty-core-1.1.5.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-core-1.1.5.jar.sha1
deleted file mode 100644
index 93120d7bfc2e1..0000000000000
--- a/plugins/repository-azure/licenses/reactor-netty-core-1.1.5.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b3de902598436fba650e3213b2b7b9505270307b
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-netty-core-1.1.7.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-core-1.1.7.jar.sha1
new file mode 100644
index 0000000000000..62ed795cb11e9
--- /dev/null
+++ b/plugins/repository-azure/licenses/reactor-netty-core-1.1.7.jar.sha1
@@ -0,0 +1 @@
+d38bb526a501f52c4476b03730c710a96f8fd35b
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-netty-http-1.1.4.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-http-1.1.4.jar.sha1
deleted file mode 100644
index 7848fcdd8f5cb..0000000000000
--- a/plugins/repository-azure/licenses/reactor-netty-http-1.1.4.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ca8b2f1b23e4593577e0f570e04bb80cd29ce1e3
\ No newline at end of file
diff --git a/plugins/repository-azure/licenses/reactor-netty-http-1.1.7.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-http-1.1.7.jar.sha1
new file mode 100644
index 0000000000000..33bf2aabcfc9b
--- /dev/null
+++ b/plugins/repository-azure/licenses/reactor-netty-http-1.1.7.jar.sha1
@@ -0,0 +1 @@
+39d7c0a13afa471b426a30bcf82664496ad34723
\ No newline at end of file
diff --git a/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureRepository.java b/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureRepository.java
index e3dbca1a02e93..2677604ecb622 100644
--- a/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureRepository.java
+++ b/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureRepository.java
@@ -100,8 +100,6 @@ public static final class Repository {
MAX_CHUNK_SIZE,
Property.NodeScope
);
- public static final Setting COMPRESS_SETTING = Setting.boolSetting("compress", false, Property.NodeScope);
- public static final Setting READONLY_SETTING = Setting.boolSetting("readonly", false, Property.NodeScope);
}
private final BlobPath basePath;
@@ -118,7 +116,7 @@ public AzureRepository(
) {
super(
metadata,
- Repository.COMPRESS_SETTING.get(metadata.settings()),
+ COMPRESS_SETTING.get(metadata.settings()),
namedXContentRegistry,
clusterService,
recoverySettings,
@@ -142,8 +140,8 @@ public AzureRepository(
// If the user explicitly did not define a readonly value, we set it by ourselves depending on the location mode setting.
// For secondary_only setting, the repository should be read only
final LocationMode locationMode = Repository.LOCATION_MODE_SETTING.get(metadata.settings());
- if (Repository.READONLY_SETTING.exists(metadata.settings())) {
- this.readonly = Repository.READONLY_SETTING.get(metadata.settings());
+ if (READONLY_SETTING.exists(metadata.settings())) {
+ this.readonly = READONLY_SETTING.get(metadata.settings());
} else {
this.readonly = locationMode == LocationMode.SECONDARY_ONLY;
}
diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle
index 33934d0369f48..5d7a4c64ae34a 100644
--- a/plugins/repository-gcs/build.gradle
+++ b/plugins/repository-gcs/build.gradle
@@ -9,14 +9,12 @@
* GitHub history for details.
*/
-import java.nio.file.Files
-import java.security.KeyPair
-import java.security.KeyPairGenerator
+
import org.opensearch.gradle.MavenFilteringHack
import org.opensearch.gradle.info.BuildParams
+import org.opensearch.gradle.test.InternalClusterTestPlugin
import org.opensearch.gradle.test.RestIntegTestTask
import org.opensearch.gradle.test.rest.YamlRestTestPlugin
-import org.opensearch.gradle.test.InternalClusterTestPlugin
import java.nio.file.Files
import java.security.KeyPair
@@ -56,14 +54,14 @@ versions << [
dependencies {
api 'com.google.cloud:google-cloud-storage:1.113.1'
api 'com.google.cloud:google-cloud-core:2.5.10'
- runtimeOnly 'com.google.guava:guava:31.1-jre'
+ runtimeOnly "com.google.guava:guava:${versions.guava}"
api 'com.google.guava:failureaccess:1.0.1'
- api 'com.google.http-client:google-http-client:1.42.0'
+ api 'com.google.http-client:google-http-client:1.43.2'
api "commons-logging:commons-logging:${versions.commonslogging}"
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
api 'com.google.api:api-common:1.8.1'
- api 'com.google.api:gax:2.17.0'
+ api 'com.google.api:gax:2.27.0'
api 'org.threeten:threetenbp:1.4.4'
api 'com.google.code.gson:gson:2.9.0'
api 'com.google.api.grpc:proto-google-common-protos:2.10.0'
@@ -73,7 +71,7 @@ dependencies {
api "com.google.auth:google-auth-library-oauth2-http:${versions.google_auth}"
api 'com.google.oauth-client:google-oauth-client:1.33.3'
api 'com.google.api-client:google-api-client:1.34.0'
- api 'com.google.http-client:google-http-client-appengine:1.41.8'
+ api 'com.google.http-client:google-http-client-appengine:1.43.2'
api 'com.google.http-client:google-http-client-jackson2:1.42.3'
api 'com.google.http-client:google-http-client-gson:1.41.4'
api 'com.google.api:gax-httpjson:0.103.1'
@@ -112,7 +110,6 @@ thirdPartyAudit {
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
- 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
@@ -141,7 +138,6 @@ thirdPartyAudit {
'com.google.appengine.api.urlfetch.HTTPResponse',
'com.google.appengine.api.urlfetch.URLFetchService',
'com.google.appengine.api.urlfetch.URLFetchServiceFactory',
- 'com.oracle.svm.core.configure.ResourcesRegistry',
'com.google.protobuf.util.JsonFormat',
'com.google.protobuf.util.JsonFormat$Parser',
'com.google.protobuf.util.JsonFormat$Printer',
@@ -193,13 +189,11 @@ thirdPartyAudit {
'org.apache.http.protocol.HttpContext',
'org.apache.http.protocol.HttpProcessor',
'org.apache.http.protocol.HttpRequestExecutor',
- 'org.graalvm.nativeimage.ImageSingletons',
'org.graalvm.nativeimage.hosted.Feature',
'org.graalvm.nativeimage.hosted.Feature$BeforeAnalysisAccess',
'org.graalvm.nativeimage.hosted.Feature$DuringAnalysisAccess',
'org.graalvm.nativeimage.hosted.Feature$FeatureAccess',
'org.graalvm.nativeimage.hosted.RuntimeReflection',
- 'org.graalvm.nativeimage.impl.ConfigurationCondition',
// commons-logging provided dependencies
'javax.jms.Message',
'javax.servlet.ServletContextEvent',
diff --git a/plugins/repository-gcs/licenses/gax-2.17.0.jar.sha1 b/plugins/repository-gcs/licenses/gax-2.17.0.jar.sha1
deleted file mode 100644
index 37b5e6adf8ad7..0000000000000
--- a/plugins/repository-gcs/licenses/gax-2.17.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f78b89e5c00c7a88c8d874a257f752094ea16321
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/gax-2.27.0.jar.sha1 b/plugins/repository-gcs/licenses/gax-2.27.0.jar.sha1
new file mode 100644
index 0000000000000..1813a3aa94404
--- /dev/null
+++ b/plugins/repository-gcs/licenses/gax-2.27.0.jar.sha1
@@ -0,0 +1 @@
+04a27757c9240da71f896be39f47aaa6e23ef989
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/google-http-client-1.42.0.jar.sha1 b/plugins/repository-gcs/licenses/google-http-client-1.42.0.jar.sha1
deleted file mode 100644
index 9c20d9f12d4b0..0000000000000
--- a/plugins/repository-gcs/licenses/google-http-client-1.42.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4f319ce80ba6888d04a38234916c43d5486842a5
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/google-http-client-1.43.2.jar.sha1 b/plugins/repository-gcs/licenses/google-http-client-1.43.2.jar.sha1
new file mode 100644
index 0000000000000..a576a74c62542
--- /dev/null
+++ b/plugins/repository-gcs/licenses/google-http-client-1.43.2.jar.sha1
@@ -0,0 +1 @@
+2520469ebd8c0675f0d2aeafd2da665228320fcf
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1 b/plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1
deleted file mode 100644
index 052fdd3df85be..0000000000000
--- a/plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-785f175ead3ccee43ded9ad0d7c0dbe4606d3230
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/google-http-client-appengine-1.43.2.jar.sha1 b/plugins/repository-gcs/licenses/google-http-client-appengine-1.43.2.jar.sha1
new file mode 100644
index 0000000000000..d8a9dba20070b
--- /dev/null
+++ b/plugins/repository-gcs/licenses/google-http-client-appengine-1.43.2.jar.sha1
@@ -0,0 +1 @@
+9fb548c5264227813fd83991b94a705b0841c15f
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/guava-31.1-jre.jar.sha1 b/plugins/repository-gcs/licenses/guava-31.1-jre.jar.sha1
deleted file mode 100644
index e57390ebe1299..0000000000000
--- a/plugins/repository-gcs/licenses/guava-31.1-jre.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-60458f877d055d0c9114d9e1a2efb737b4bc282c
\ No newline at end of file
diff --git a/plugins/repository-gcs/licenses/guava-32.0.1-jre.jar.sha1 b/plugins/repository-gcs/licenses/guava-32.0.1-jre.jar.sha1
new file mode 100644
index 0000000000000..80dc9e9308a6c
--- /dev/null
+++ b/plugins/repository-gcs/licenses/guava-32.0.1-jre.jar.sha1
@@ -0,0 +1 @@
+6e5d51a72d142f2d40a57dfb897188b36a95b489
\ No newline at end of file
diff --git a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRepository.java b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRepository.java
index 0ff5527881545..a743ac72bdb8b 100644
--- a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRepository.java
+++ b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageRepository.java
@@ -50,7 +50,6 @@
import java.util.function.Function;
import static org.opensearch.common.settings.Setting.Property;
-import static org.opensearch.common.settings.Setting.boolSetting;
import static org.opensearch.common.settings.Setting.byteSizeSetting;
import static org.opensearch.common.settings.Setting.simpleString;
@@ -70,7 +69,6 @@ class GoogleCloudStorageRepository extends MeteredBlobStoreRepository {
static final Setting BUCKET = simpleString("bucket", Property.NodeScope, Property.Dynamic);
static final Setting BASE_PATH = simpleString("base_path", Property.NodeScope, Property.Dynamic);
- static final Setting COMPRESS = boolSetting("compress", false, Property.NodeScope, Property.Dynamic);
static final Setting CHUNK_SIZE = byteSizeSetting(
"chunk_size",
MAX_CHUNK_SIZE,
@@ -94,7 +92,14 @@ class GoogleCloudStorageRepository extends MeteredBlobStoreRepository {
final ClusterService clusterService,
final RecoverySettings recoverySettings
) {
- super(metadata, getSetting(COMPRESS, metadata), namedXContentRegistry, clusterService, recoverySettings, buildLocation(metadata));
+ super(
+ metadata,
+ getSetting(COMPRESS_SETTING, metadata),
+ namedXContentRegistry,
+ clusterService,
+ recoverySettings,
+ buildLocation(metadata)
+ );
this.storageService = storageService;
String basePath = BASE_PATH.get(metadata.settings());
diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle
index e2f95fec52d43..7ac54544f7a1b 100644
--- a/plugins/repository-hdfs/build.gradle
+++ b/plugins/repository-hdfs/build.gradle
@@ -75,13 +75,13 @@ dependencies {
api 'commons-collections:commons-collections:3.2.2'
api 'org.apache.commons:commons-compress:1.23.0'
api 'org.apache.commons:commons-configuration2:2.9.0'
- api 'commons-io:commons-io:2.11.0'
+ api 'commons-io:commons-io:2.13.0'
api 'org.apache.commons:commons-lang3:3.12.0'
implementation 'com.google.re2j:re2j:1.7'
api 'javax.servlet:servlet-api:2.5'
api "org.slf4j:slf4j-api:${versions.slf4j}"
api "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}"
- api 'net.minidev:json-smart:2.4.10'
+ api 'net.minidev:json-smart:2.4.11'
api "io.netty:netty-all:${versions.netty}"
implementation "com.fasterxml.woodstox:woodstox-core:${versions.woodstox}"
implementation 'org.codehaus.woodstox:stax2-api:4.2.1'
@@ -359,7 +359,6 @@ thirdPartyAudit {
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
- 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3',
'com.google.common.hash.Striped64',
'com.google.common.hash.Striped64$1',
'com.google.common.hash.Striped64$Cell',
diff --git a/plugins/repository-hdfs/licenses/commons-io-2.11.0.jar.sha1 b/plugins/repository-hdfs/licenses/commons-io-2.11.0.jar.sha1
deleted file mode 100644
index 8adec30bade49..0000000000000
--- a/plugins/repository-hdfs/licenses/commons-io-2.11.0.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a2503f302b11ebde7ebc3df41daebe0e4eea3689
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/commons-io-2.13.0.jar.sha1 b/plugins/repository-hdfs/licenses/commons-io-2.13.0.jar.sha1
new file mode 100644
index 0000000000000..c165136eb5822
--- /dev/null
+++ b/plugins/repository-hdfs/licenses/commons-io-2.13.0.jar.sha1
@@ -0,0 +1 @@
+8bb2bc9b4df17e2411533a0708a69f983bf5e83b
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1 b/plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1
deleted file mode 100644
index e57390ebe1299..0000000000000
--- a/plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-60458f877d055d0c9114d9e1a2efb737b4bc282c
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/guava-32.0.1-jre.jar.sha1 b/plugins/repository-hdfs/licenses/guava-32.0.1-jre.jar.sha1
new file mode 100644
index 0000000000000..80dc9e9308a6c
--- /dev/null
+++ b/plugins/repository-hdfs/licenses/guava-32.0.1-jre.jar.sha1
@@ -0,0 +1 @@
+6e5d51a72d142f2d40a57dfb897188b36a95b489
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/json-smart-2.4.10.jar.sha1 b/plugins/repository-hdfs/licenses/json-smart-2.4.10.jar.sha1
deleted file mode 100644
index faac861f60a28..0000000000000
--- a/plugins/repository-hdfs/licenses/json-smart-2.4.10.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-91cb329e9424bf32131eeb1ce2d17bf31b9899bc
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/json-smart-2.4.11.jar.sha1 b/plugins/repository-hdfs/licenses/json-smart-2.4.11.jar.sha1
new file mode 100644
index 0000000000000..04627ab2baace
--- /dev/null
+++ b/plugins/repository-hdfs/licenses/json-smart-2.4.11.jar.sha1
@@ -0,0 +1 @@
+cc5888f14a5768f254b97bafe8b9fd29b31e872e
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/netty-all-4.1.91.Final.jar.sha1 b/plugins/repository-hdfs/licenses/netty-all-4.1.91.Final.jar.sha1
deleted file mode 100644
index fd9d37b2f0c8d..0000000000000
--- a/plugins/repository-hdfs/licenses/netty-all-4.1.91.Final.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d96d417b6c6b4a786d54418e09593c4b2292f437
\ No newline at end of file
diff --git a/plugins/repository-hdfs/licenses/netty-all-4.1.93.Final.jar.sha1 b/plugins/repository-hdfs/licenses/netty-all-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..a0f7bc4bf65ef
--- /dev/null
+++ b/plugins/repository-hdfs/licenses/netty-all-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+408780d8b32ce4510f5408b06efabc2230aaf9b6
\ No newline at end of file
diff --git a/plugins/repository-hdfs/src/main/java/org/opensearch/repositories/hdfs/HdfsRepository.java b/plugins/repository-hdfs/src/main/java/org/opensearch/repositories/hdfs/HdfsRepository.java
index b4075620d0acb..88c58942e9bbf 100644
--- a/plugins/repository-hdfs/src/main/java/org/opensearch/repositories/hdfs/HdfsRepository.java
+++ b/plugins/repository-hdfs/src/main/java/org/opensearch/repositories/hdfs/HdfsRepository.java
@@ -83,7 +83,7 @@ public HdfsRepository(
final ClusterService clusterService,
final RecoverySettings recoverySettings
) {
- super(metadata, metadata.settings().getAsBoolean("compress", false), namedXContentRegistry, clusterService, recoverySettings);
+ super(metadata, COMPRESS_SETTING.get(metadata.settings()), namedXContentRegistry, clusterService, recoverySettings);
this.environment = environment;
this.chunkSize = metadata.settings().getAsBytesSize("chunk_size", null);
diff --git a/plugins/repository-s3/README.md b/plugins/repository-s3/README.md
new file mode 100644
index 0000000000000..03007e03b633e
--- /dev/null
+++ b/plugins/repository-s3/README.md
@@ -0,0 +1,25 @@
+# repository-s3
+
+The repository-s3 plugin enables the use of S3 as a place to store snapshots.
+
+## Testing
+
+### Unit Tests
+
+```
+./gradlew :plugins:repository-s3:test
+```
+
+### Integration Tests
+
+Integration tests require several environment variables.
+
+- `amazon_s3_bucket`: Name of the S3 bucket to use.
+- `amazon_s3_access_key`: The access key ID (`AWS_ACCESS_KEY_ID`) with r/w access to the S3 bucket.
+- `amazon_s3_secret_key`: The secret access key (`AWS_SECRET_ACCESS_KEY`).
+- `amazon_s3_base_path`: A relative path inside the S3 bucket, e.g. `opensearch`.
+- `AWS_REGION`: The region in which the S3 bucket was created. While S3 buckets are global, credentials must scoped to a specific region and cross-region access is not allowed. (TODO: rename this to `amazon_s3_region` in https://github.com/opensearch-project/opensearch-build/issues/3615 and https://github.com/opensearch-project/OpenSearch/pull/7974.)
+
+```
+AWS_REGION=us-west-2 amazon_s3_access_key=$AWS_ACCESS_KEY_ID amazon_s3_secret_key=$AWS_SECRET_ACCESS_KEY amazon_s3_base_path=path amazon_s3_bucket=dblock-opensearch ./gradlew :plugins:repository-s3:s3ThirdPartyTest
+```
diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle
index 9e239950cac69..2250f2fc88f05 100644
--- a/plugins/repository-s3/build.gradle
+++ b/plugins/repository-s3/build.gradle
@@ -46,10 +46,31 @@ opensearchplugin {
}
dependencies {
- api "com.amazonaws:aws-java-sdk-s3:${versions.aws}"
- api "com.amazonaws:aws-java-sdk-core:${versions.aws}"
- api "com.amazonaws:aws-java-sdk-sts:${versions.aws}"
- api "com.amazonaws:jmespath-java:${versions.aws}"
+ // aws sdk v2 stack
+ api "software.amazon.awssdk:sdk-core:${versions.aws}"
+ api "software.amazon.awssdk:annotations:${versions.aws}"
+ api "software.amazon.awssdk:aws-core:${versions.aws}"
+ api "software.amazon.awssdk:auth:${versions.aws}"
+ api "software.amazon.awssdk:endpoints-spi:${versions.aws}"
+ api "software.amazon.awssdk:http-client-spi:${versions.aws}"
+ api "software.amazon.awssdk:apache-client:${versions.aws}"
+ api "software.amazon.awssdk:metrics-spi:${versions.aws}"
+ api "software.amazon.awssdk:profiles:${versions.aws}"
+ api "software.amazon.awssdk:regions:${versions.aws}"
+ api "software.amazon.awssdk:utils:${versions.aws}"
+ api "software.amazon.awssdk:aws-json-protocol:${versions.aws}"
+ api "software.amazon.awssdk:protocol-core:${versions.aws}"
+ api "software.amazon.awssdk:json-utils:${versions.aws}"
+ api "software.amazon.awssdk:third-party-jackson-core:${versions.aws}"
+ api "software.amazon.awssdk:s3:${versions.aws}"
+ api "software.amazon.awssdk:signer:${versions.aws}"
+ api "software.amazon.awssdk:aws-xml-protocol:${versions.aws}"
+ api "software.amazon.awssdk:aws-json-protocol:${versions.aws}"
+ api "software.amazon.awssdk:aws-query-protocol:${versions.aws}"
+ api "software.amazon.awssdk:sts:${versions.aws}"
+ api "software.amazon.awssdk:netty-nio-client:${versions.aws}"
+
+ api "org.reactivestreams:reactive-streams:${versions.reactivestreams}"
api "org.apache.httpcomponents:httpclient:${versions.httpclient}"
api "org.apache.httpcomponents:httpcore:${versions.httpcore}"
api "commons-logging:commons-logging:${versions.commonslogging}"
@@ -60,6 +81,19 @@ dependencies {
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
api "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
api "joda-time:joda-time:${versions.joda}"
+ api "org.slf4j:slf4j-api:${versions.slf4j}"
+
+ // network stack
+ api "io.netty:netty-buffer:${versions.netty}"
+ api "io.netty:netty-codec:${versions.netty}"
+ api "io.netty:netty-codec-http:${versions.netty}"
+ api "io.netty:netty-codec-http2:${versions.netty}"
+ api "io.netty:netty-common:${versions.netty}"
+ api "io.netty:netty-handler:${versions.netty}"
+ api "io.netty:netty-resolver:${versions.netty}"
+ api "io.netty:netty-transport:${versions.netty}"
+ api "io.netty:netty-transport-native-unix-common:${versions.netty}"
+ api "io.netty:netty-transport-classes-epoll:${versions.netty}"
// HACK: javax.xml.bind was removed from default modules in java 9, so we pull the api in here,
// and allowlist this hack in JarHell
@@ -75,10 +109,9 @@ restResources {
}
tasks.named("dependencyLicenses").configure {
- mapping from: /aws-java-sdk-.*/, to: 'aws-java-sdk'
- mapping from: /jmespath-java.*/, to: 'aws-java-sdk'
mapping from: /jackson-.*/, to: 'jackson'
mapping from: /jaxb-.*/, to: 'jaxb'
+ mapping from: /netty-.*/, to: 'netty'
}
bundlePlugin {
@@ -115,12 +148,14 @@ String s3PermanentAccessKey = System.getenv("amazon_s3_access_key")
String s3PermanentSecretKey = System.getenv("amazon_s3_secret_key")
String s3PermanentBucket = System.getenv("amazon_s3_bucket")
String s3PermanentBasePath = System.getenv("amazon_s3_base_path")
+String s3PermanentRegion = System.getenv("amazon_s3_region")
String s3TemporaryAccessKey = System.getenv("amazon_s3_access_key_temporary")
String s3TemporarySecretKey = System.getenv("amazon_s3_secret_key_temporary")
String s3TemporarySessionToken = System.getenv("amazon_s3_session_token_temporary")
String s3TemporaryBucket = System.getenv("amazon_s3_bucket_temporary")
String s3TemporaryBasePath = System.getenv("amazon_s3_base_path_temporary")
+String s3TemporaryRegion = System.getenv("amazon_s3_region_temporary")
String s3EC2Bucket = System.getenv("amazon_s3_bucket_ec2")
String s3EC2BasePath = System.getenv("amazon_s3_base_path_ec2")
@@ -133,28 +168,40 @@ String s3EKSBasePath = System.getenv("amazon_s3_base_path_eks")
boolean s3DisableChunkedEncoding = (new Random(Long.parseUnsignedLong(BuildParams.testSeed.tokenize(':').get(0), 16))).nextBoolean()
+// TODO: remove after https://github.com/opensearch-project/opensearch-build/issues/3615
+if (s3PermanentBucket && !s3PermanentRegion) {
+ s3PermanentRegion = "us-west-2"
+}
+
+if (s3TemporaryBucket && !s3TemporaryRegion) {
+ s3TemporaryRegion = "us-west-2"
+}
+// ----
+
// If all these variables are missing then we are testing against the internal fixture instead, which has the following
// credentials hard-coded in.
-if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath) {
+if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath && !s3PermanentRegion) {
s3PermanentAccessKey = 'access_key'
s3PermanentSecretKey = 'secret_key'
s3PermanentBucket = 'bucket'
s3PermanentBasePath = 'base_path'
+ s3PermanentRegion = 'region'
apply plugin: 'opensearch.test.fixtures'
useFixture = true
-} else if (!s3PermanentAccessKey || !s3PermanentSecretKey || !s3PermanentBucket || !s3PermanentBasePath) {
+} else if (!s3PermanentAccessKey || !s3PermanentSecretKey || !s3PermanentBucket || !s3PermanentBasePath || !s3PermanentRegion) {
throw new IllegalArgumentException("not all options specified to run against external S3 service as permanent credentials are present")
}
-if (!s3TemporaryAccessKey && !s3TemporarySecretKey && !s3TemporaryBucket && !s3TemporaryBasePath && !s3TemporarySessionToken) {
+if (!s3TemporaryAccessKey && !s3TemporarySecretKey && !s3TemporaryBucket && !s3TemporaryBasePath && !s3TemporarySessionToken && !s3TemporaryRegion) {
s3TemporaryAccessKey = 'session_token_access_key'
s3TemporarySecretKey = 'session_token_secret_key'
s3TemporaryBucket = 'session_token_bucket'
s3TemporaryBasePath = 'session_token_base_path'
s3TemporarySessionToken = 'session_token'
+ s3TemporaryRegion = 'session_token_region'
} else if (!s3TemporaryAccessKey || !s3TemporarySecretKey || !s3TemporaryBucket || !s3TemporaryBasePath || !s3TemporarySessionToken) {
throw new IllegalArgumentException("not all options specified to run against external S3 service as temporary credentials are present")
@@ -175,8 +222,10 @@ processYamlRestTestResources {
Map expansions = [
'permanent_bucket': s3PermanentBucket,
'permanent_base_path': s3PermanentBasePath + "_integration_tests_" + BuildParams.testSeed,
+ 'permanent_region': s3PermanentRegion,
'temporary_bucket': s3TemporaryBucket,
'temporary_base_path': s3TemporaryBasePath + "_integration_tests_" + BuildParams.testSeed,
+ 'temporary_region': s3TemporaryRegion,
'ec2_bucket': s3EC2Bucket,
'ec2_base_path': s3EC2BasePath,
'ecs_bucket': s3ECSBucket,
@@ -241,9 +290,9 @@ testClusters.yamlRestTest {
setting 's3.client.integration_test_eks.region', { "us-east-2" }, IGNORE_VALUE
// to redirect InstanceProfileCredentialsProvider to custom auth point
- systemProperty "com.amazonaws.sdk.ec2MetadataServiceEndpointOverride", { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ec2', '80')}" }, IGNORE_VALUE
+ systemProperty "aws.ec2MetadataServiceEndpointOverride", { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ec2', '80')}" }, IGNORE_VALUE
// to redirect AWSSecurityTokenServiceClient to custom auth point
- systemProperty "com.amazonaws.sdk.stsEndpointOverride", { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-eks', '80')}/eks_credentials_endpoint" }, IGNORE_VALUE
+ systemProperty "aws.stsEndpointOverride", { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-eks', '80')}/eks_credentials_endpoint" }, IGNORE_VALUE
} else {
println "Using an external service to test the repository-s3 plugin"
}
@@ -337,7 +386,7 @@ if (useFixture) {
plugin tasks.bundlePlugin.archiveFile
// to redirect AWSSecurityTokenServiceClient to custom auth point
- systemProperty "com.amazonaws.sdk.stsEndpointOverride", { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-eks', '80')}/eks_credentials_endpoint" }, IGNORE_VALUE
+ systemProperty "aws.stsEndpointOverride", { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-eks', '80')}/eks_credentials_endpoint" }, IGNORE_VALUE
}
}
@@ -351,6 +400,7 @@ TaskProvider s3ThirdPartyTest = tasks.register("s3ThirdPartyTest", Test) {
systemProperty 'test.s3.account', s3PermanentAccessKey
systemProperty 'test.s3.key', s3PermanentSecretKey
systemProperty 'test.s3.bucket', s3PermanentBucket
+ systemProperty 'test.s3.region', s3PermanentRegion
nonInputProperties.systemProperty 'test.s3.base', s3PermanentBasePath + "_third_party_tests_" + BuildParams.testSeed
if (useFixture) {
nonInputProperties.systemProperty 'test.s3.endpoint', "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000') }"
@@ -358,34 +408,184 @@ TaskProvider s3ThirdPartyTest = tasks.register("s3ThirdPartyTest", Test) {
}
tasks.named("check").configure { dependsOn(s3ThirdPartyTest) }
-thirdPartyAudit.ignoreMissingClasses(
- // classes are missing
- 'javax.jms.Message',
- 'javax.servlet.ServletContextEvent',
- 'javax.servlet.ServletContextListener',
- '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',
- // We don't use the kms dependency
- 'com.amazonaws.services.kms.AWSKMS',
- 'com.amazonaws.services.kms.AWSKMSClient',
- 'com.amazonaws.services.kms.model.DecryptRequest',
- 'com.amazonaws.services.kms.model.DecryptResult',
- 'com.amazonaws.services.kms.model.EncryptRequest',
- 'com.amazonaws.services.kms.model.EncryptResult',
- 'com.amazonaws.services.kms.model.GenerateDataKeyRequest',
- 'com.amazonaws.services.kms.model.GenerateDataKeyResult',
- 'com.amazonaws.services.kms.AWSKMSClientBuilder'
-)
+thirdPartyAudit {
+ ignoreMissingClasses(
+ // classes are missing
+ 'javax.jms.Message',
+ 'javax.servlet.ServletContextEvent',
+ 'javax.servlet.ServletContextListener',
+ 'org.apache.avalon.framework.logger.Logger',
+ 'org.apache.log.Hierarchy',
+ 'org.apache.log.Logger',
+
+ // from io.netty.handler.ssl.OpenSslEngine (netty)
+ 'io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod',
+ 'io.netty.internal.tcnative.AsyncTask',
+ 'io.netty.internal.tcnative.Buffer',
+ 'io.netty.internal.tcnative.CertificateCompressionAlgo',
+ 'io.netty.internal.tcnative.Library',
+ 'io.netty.internal.tcnative.ResultCallback',
+ 'io.netty.internal.tcnative.SSL',
+ 'io.netty.internal.tcnative.SSLContext',
+ 'io.netty.internal.tcnative.SSLPrivateKeyMethod',
+ 'io.netty.internal.tcnative.SSLSession',
+ 'io.netty.internal.tcnative.SSLSessionCache',
+ 'io.netty.internal.tcnative.CertificateCallback',
+ 'io.netty.internal.tcnative.CertificateVerifier',
+ 'io.netty.internal.tcnative.SessionTicketKey',
+ 'io.netty.internal.tcnative.SniHostNameMatcher',
+
+ 'com.aayushatharva.brotli4j.Brotli4jLoader',
+ 'com.aayushatharva.brotli4j.decoder.DecoderJNI$Status',
+ 'com.aayushatharva.brotli4j.decoder.DecoderJNI$Wrapper',
+ 'com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel',
+ 'com.aayushatharva.brotli4j.encoder.Encoder',
+ 'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
+ 'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',
+
+ 'com.google.protobuf.nano.CodedOutputByteBufferNano',
+ 'com.google.protobuf.nano.MessageNano',
+
+ 'com.ning.compress.BufferRecycler',
+ 'com.ning.compress.lzf.ChunkDecoder',
+ 'com.ning.compress.lzf.ChunkEncoder',
+ 'com.ning.compress.lzf.LZFChunk',
+ 'com.ning.compress.lzf.LZFEncoder',
+ 'com.ning.compress.lzf.util.ChunkDecoderFactory',
+ 'com.ning.compress.lzf.util.ChunkEncoderFactory',
+
+ 'io.netty.internal.tcnative.AsyncSSLPrivateKeyMethod',
+ 'io.netty.internal.tcnative.AsyncTask',
+
+ 'io.netty.internal.tcnative.CertificateCallback',
+ 'io.netty.internal.tcnative.CertificateVerifier',
+ 'io.netty.internal.tcnative.ResultCallback',
+ 'io.netty.internal.tcnative.SessionTicketKey',
+ 'io.netty.internal.tcnative.SniHostNameMatcher',
+ 'io.netty.internal.tcnative.SSL',
+ 'io.netty.internal.tcnative.SSLSession',
+ 'io.netty.internal.tcnative.SSLSessionCache',
+
+ 'lzma.sdk.lzma.Encoder',
+ 'net.jpountz.lz4.LZ4Compressor',
+ 'net.jpountz.lz4.LZ4Factory',
+ 'net.jpountz.lz4.LZ4FastDecompressor',
+ 'net.jpountz.xxhash.XXHash32',
+ 'net.jpountz.xxhash.XXHashFactory',
+
+ // from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty)
+ 'org.bouncycastle.cert.X509v3CertificateBuilder',
+ 'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter',
+ 'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder',
+ 'org.bouncycastle.openssl.PEMEncryptedKeyPair',
+ 'org.bouncycastle.openssl.PEMParser',
+ 'org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter',
+ 'org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder',
+ 'org.bouncycastle.openssl.jcajce.JcePEMDecryptorProviderBuilder',
+ 'org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo',
+
+ 'org.conscrypt.AllocatedBuffer',
+ 'org.conscrypt.BufferAllocator',
+ 'org.conscrypt.Conscrypt',
+ 'org.conscrypt.HandshakeListener',
+
+ 'org.eclipse.jetty.alpn.ALPN$ClientProvider',
+ 'org.eclipse.jetty.alpn.ALPN$ServerProvider',
+ 'org.eclipse.jetty.alpn.ALPN',
+
+ // from io.netty.handler.ssl.JettyNpnSslEngine (netty)
+ 'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
+ 'org.eclipse.jetty.npn.NextProtoNego$ServerProvider',
+ 'org.eclipse.jetty.npn.NextProtoNego',
+
+ // from io.netty.handler.codec.marshalling.ChannelBufferByteInput (netty)
+ 'org.jboss.marshalling.ByteInput',
+
+ // from io.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty)
+ 'org.jboss.marshalling.ByteOutput',
+
+ // from io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty)
+ 'org.jboss.marshalling.Marshaller',
+
+ // from io.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty)
+ 'org.jboss.marshalling.MarshallerFactory',
+ 'org.jboss.marshalling.MarshallingConfiguration',
+ 'org.jboss.marshalling.Unmarshaller',
+
+ 'org.slf4j.impl.StaticLoggerBinder',
+ 'org.slf4j.impl.StaticMDCBinder',
+ 'org.slf4j.impl.StaticMarkerBinder',
+ 'reactor.blockhound.BlockHound$Builder',
+ 'reactor.blockhound.integration.BlockHoundIntegration',
+
+ 'software.amazon.awssdk.arns.Arn',
+ 'software.amazon.awssdk.arns.ArnResource',
+ 'software.amazon.awssdk.crt.CRT',
+ 'software.amazon.awssdk.crt.auth.credentials.Credentials',
+ 'software.amazon.awssdk.crt.auth.credentials.CredentialsProvider',
+ 'software.amazon.awssdk.crt.auth.credentials.DelegateCredentialsProvider$DelegateCredentialsProviderBuilder',
+ 'software.amazon.awssdk.crt.http.HttpHeader',
+ 'software.amazon.awssdk.crt.http.HttpMonitoringOptions',
+ 'software.amazon.awssdk.crt.http.HttpProxyOptions',
+ 'software.amazon.awssdk.crt.http.HttpRequest',
+ 'software.amazon.awssdk.crt.http.HttpRequestBodyStream',
+ 'software.amazon.awssdk.crt.io.ClientBootstrap',
+ 'software.amazon.awssdk.crt.io.ExponentialBackoffRetryOptions',
+ 'software.amazon.awssdk.crt.io.StandardRetryOptions',
+ 'software.amazon.awssdk.crt.io.TlsCipherPreference',
+ 'software.amazon.awssdk.crt.io.TlsContext',
+ 'software.amazon.awssdk.crt.io.TlsContextOptions',
+ 'software.amazon.awssdk.crt.s3.ChecksumAlgorithm',
+ 'software.amazon.awssdk.crt.s3.ChecksumConfig',
+ 'software.amazon.awssdk.crt.s3.ChecksumConfig$ChecksumLocation',
+ 'software.amazon.awssdk.crt.s3.ResumeToken',
+ 'software.amazon.awssdk.crt.s3.S3Client',
+ 'software.amazon.awssdk.crt.s3.S3ClientOptions',
+ 'software.amazon.awssdk.crt.s3.S3FinishedResponseContext',
+ 'software.amazon.awssdk.crt.s3.S3MetaRequest',
+ 'software.amazon.awssdk.crt.s3.S3MetaRequestOptions',
+ 'software.amazon.awssdk.crt.s3.S3MetaRequestOptions$MetaRequestType',
+ 'software.amazon.awssdk.crt.s3.S3MetaRequestResponseHandler',
+ 'software.amazon.awssdk.crtcore.CrtConfigurationUtils',
+ 'software.amazon.awssdk.crtcore.CrtConnectionHealthConfiguration',
+ 'software.amazon.awssdk.crtcore.CrtConnectionHealthConfiguration$Builder',
+ 'software.amazon.awssdk.crtcore.CrtConnectionHealthConfiguration$DefaultBuilder',
+ 'software.amazon.awssdk.crtcore.CrtProxyConfiguration',
+ 'software.amazon.awssdk.crtcore.CrtProxyConfiguration$Builder',
+ 'software.amazon.awssdk.crtcore.CrtProxyConfiguration$DefaultBuilder',
+ 'software.amazon.eventstream.HeaderValue',
+ 'software.amazon.eventstream.Message',
+ 'software.amazon.eventstream.MessageDecoder'
+ )
+
+ ignoreViolations (
+ 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator',
+ 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$1',
+ 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$2',
+ 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$3',
+ 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$4',
+ 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator$5',
+
+ 'io.netty.util.internal.PlatformDependent0',
+ 'io.netty.util.internal.PlatformDependent0$1',
+ 'io.netty.util.internal.PlatformDependent0$2',
+ 'io.netty.util.internal.PlatformDependent0$3',
+ 'io.netty.util.internal.PlatformDependent0$4',
+ 'io.netty.util.internal.PlatformDependent0$6',
+
+ 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef',
+ 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef',
+ 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields',
+ 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields',
+ 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields',
+ 'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode',
+ 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField',
+ 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField',
+ 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField',
+ 'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess',
+ 'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess',
+ )
+}
// jarhell with jdk (intentionally, because jaxb was removed from default modules in java 9)
if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) {
diff --git a/plugins/repository-s3/config/repository-s3/log4j2.properties b/plugins/repository-s3/config/repository-s3/log4j2.properties
index 7263bbcba521c..ceb9a546b9b08 100644
--- a/plugins/repository-s3/config/repository-s3/log4j2.properties
+++ b/plugins/repository-s3/config/repository-s3/log4j2.properties
@@ -9,17 +9,17 @@
# GitHub history for details.
#
-logger.com_amazonaws.name = com.amazonaws
+logger.com_amazonaws.name = software.amazon.awssdk
logger.com_amazonaws.level = warn
-logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.name = com.amazonaws.jmx.SdkMBeanRegistrySupport
+logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.name = software.amazon.awssdk.jmx.SdkMBeanRegistrySupport
logger.com_amazonaws_jmx_SdkMBeanRegistrySupport.level = error
-logger.com_amazonaws_metrics_AwsSdkMetrics.name = com.amazonaws.metrics.AwsSdkMetrics
+logger.com_amazonaws_metrics_AwsSdkMetrics.name = software.amazon.awssdk.metrics.AwsSdkMetrics
logger.com_amazonaws_metrics_AwsSdkMetrics.level = error
-logger.com_amazonaws_auth_profile_internal_BasicProfileConfigFileLoader.name = com.amazonaws.auth.profile.internal.BasicProfileConfigFileLoader
+logger.com_amazonaws_auth_profile_internal_BasicProfileConfigFileLoader.name = software.amazon.awssdk.auth.profile.internal.BasicProfileConfigFileLoader
logger.com_amazonaws_auth_profile_internal_BasicProfileConfigFileLoader.level = error
-logger.com_amazonaws_services_s3_internal_UseArnRegionResolver.name = com.amazonaws.services.s3.internal.UseArnRegionResolver
+logger.com_amazonaws_services_s3_internal_UseArnRegionResolver.name = software.amazon.awssdk.services.s3.internal.UseArnRegionResolver
logger.com_amazonaws_services_s3_internal_UseArnRegionResolver.level = error
diff --git a/plugins/repository-s3/licenses/annotations-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/annotations-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..5a626eeb5725b
--- /dev/null
+++ b/plugins/repository-s3/licenses/annotations-2.20.55.jar.sha1
@@ -0,0 +1 @@
+330e9d0e5f2401fffba5afe30f3740f400e8308d
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/annotations-LICENSE.txt b/plugins/repository-s3/licenses/annotations-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/annotations-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/annotations-NOTICE.txt b/plugins/repository-s3/licenses/annotations-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/annotations-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/apache-client-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/apache-client-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..3ee96bb6e4076
--- /dev/null
+++ b/plugins/repository-s3/licenses/apache-client-2.20.55.jar.sha1
@@ -0,0 +1 @@
+5c149885667d41a306769505cfa481cfddf6f113
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/apache-client-LICENSE.txt b/plugins/repository-s3/licenses/apache-client-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/apache-client-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/apache-client-NOTICE.txt b/plugins/repository-s3/licenses/apache-client-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/apache-client-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/auth-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/auth-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..010464bdf9fd1
--- /dev/null
+++ b/plugins/repository-s3/licenses/auth-2.20.55.jar.sha1
@@ -0,0 +1 @@
+e21f00a8a2096d5044f3eff176944256e01a175e
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/auth-LICENSE.txt b/plugins/repository-s3/licenses/auth-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/auth-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/auth-NOTICE.txt b/plugins/repository-s3/licenses/auth-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/auth-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/aws-core-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/aws-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..4b4ee1db864a8
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+734427c2cece98a8cb90871b78d2311e4a7ef746
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-core-LICENSE.txt b/plugins/repository-s3/licenses/aws-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/aws-core-NOTICE.txt b/plugins/repository-s3/licenses/aws-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/aws-java-sdk-LICENSE.txt b/plugins/repository-s3/licenses/aws-java-sdk-LICENSE.txt
deleted file mode 100644
index 98d1f9319f374..0000000000000
--- a/plugins/repository-s3/licenses/aws-java-sdk-LICENSE.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-Apache License
-Version 2.0, January 2004
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
- 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
- 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
- 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
- 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-Note: Other license terms may apply to certain, identified software files contained within or distributed with the accompanying software if such terms are included in the directory containing the accompanying software. Such other license terms will then apply in lieu of the terms of the software license above.
-
-JSON processing code subject to the JSON License from JSON.org:
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/plugins/repository-s3/licenses/aws-java-sdk-NOTICE.txt b/plugins/repository-s3/licenses/aws-java-sdk-NOTICE.txt
deleted file mode 100644
index 565bd6085c71a..0000000000000
--- a/plugins/repository-s3/licenses/aws-java-sdk-NOTICE.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-AWS SDK for Java
-Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-
-This product includes software developed by
-Amazon Technologies, Inc (http://www.amazon.com/).
-
-**********************
-THIRD PARTY COMPONENTS
-**********************
-This software includes third party software subject to the following copyrights:
-- XML parsing and utility functions from JetS3t - Copyright 2006-2009 James Murty.
-- JSON parsing and utility functions from JSON.org - Copyright 2002 JSON.org.
-- PKCS#1 PEM encoded private key parsing and utility functions from oauth.googlecode.com - Copyright 1998-2010 AOL Inc.
-
-The licenses for these third party components are included in LICENSE.txt
diff --git a/plugins/repository-s3/licenses/aws-java-sdk-core-1.12.270.jar.sha1 b/plugins/repository-s3/licenses/aws-java-sdk-core-1.12.270.jar.sha1
deleted file mode 100644
index ce40f68b3e229..0000000000000
--- a/plugins/repository-s3/licenses/aws-java-sdk-core-1.12.270.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-8f0cc2cc1b41c51e2117f5b1ce6530febf99d4ba
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-java-sdk-s3-1.12.270.jar.sha1 b/plugins/repository-s3/licenses/aws-java-sdk-s3-1.12.270.jar.sha1
deleted file mode 100644
index 73b9b4cd8d410..0000000000000
--- a/plugins/repository-s3/licenses/aws-java-sdk-s3-1.12.270.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2901cdd72a7f0d940b2bd4e1bcdb606d5d33736f
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-java-sdk-sts-1.12.270.jar.sha1 b/plugins/repository-s3/licenses/aws-java-sdk-sts-1.12.270.jar.sha1
deleted file mode 100644
index 3b77226cdd5d2..0000000000000
--- a/plugins/repository-s3/licenses/aws-java-sdk-sts-1.12.270.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-aeffa3e8d9471377adf1108e21dab92f4f13edb3
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-json-protocol-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/aws-json-protocol-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..45a88305c1928
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-json-protocol-2.20.55.jar.sha1
@@ -0,0 +1 @@
+a52731c86b974aefa5bbb1c545f407811a0163b1
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-json-protocol-LICENSE.txt b/plugins/repository-s3/licenses/aws-json-protocol-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-json-protocol-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/aws-json-protocol-NOTICE.txt b/plugins/repository-s3/licenses/aws-json-protocol-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-json-protocol-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/aws-query-protocol-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/aws-query-protocol-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..ba5f43378730c
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-query-protocol-2.20.55.jar.sha1
@@ -0,0 +1 @@
+ac116215cc85366f0bdffee53b4c21e7a7fe03ef
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-query-protocol-LICENSE.txt b/plugins/repository-s3/licenses/aws-query-protocol-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-query-protocol-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/aws-query-protocol-NOTICE.txt b/plugins/repository-s3/licenses/aws-query-protocol-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-query-protocol-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/aws-xml-protocol-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/aws-xml-protocol-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..fc65ee07c40c6
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-xml-protocol-2.20.55.jar.sha1
@@ -0,0 +1 @@
+6a3b5f607ece38536f17d869b82c669c6339f9ad
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/aws-xml-protocol-LICENSE.txt b/plugins/repository-s3/licenses/aws-xml-protocol-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-xml-protocol-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/aws-xml-protocol-NOTICE.txt b/plugins/repository-s3/licenses/aws-xml-protocol-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/aws-xml-protocol-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/endpoints-spi-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/endpoints-spi-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..5bc0e31166c77
--- /dev/null
+++ b/plugins/repository-s3/licenses/endpoints-spi-2.20.55.jar.sha1
@@ -0,0 +1 @@
+085f82038ee86a7d6cd568fe7edd842978d92de3
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/endpoints-spi-LICENSE.txt b/plugins/repository-s3/licenses/endpoints-spi-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/endpoints-spi-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/endpoints-spi-NOTICE.txt b/plugins/repository-s3/licenses/endpoints-spi-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/endpoints-spi-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/http-client-spi-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/http-client-spi-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..523cf43dcb2e9
--- /dev/null
+++ b/plugins/repository-s3/licenses/http-client-spi-2.20.55.jar.sha1
@@ -0,0 +1 @@
+34f9b10c1a46038a0ceebdd750ba3a413a862ceb
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/http-client-spi-LICENSE.txt b/plugins/repository-s3/licenses/http-client-spi-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/http-client-spi-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/http-client-spi-NOTICE.txt b/plugins/repository-s3/licenses/http-client-spi-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/http-client-spi-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/jackson-annotations-2.15.1.jar.sha1 b/plugins/repository-s3/licenses/jackson-annotations-2.15.1.jar.sha1
deleted file mode 100644
index a3ade4ff8dadc..0000000000000
--- a/plugins/repository-s3/licenses/jackson-annotations-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-092a90d3739e970e03b5971839e4fe51f13c1fa3
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/jackson-annotations-2.15.2.jar.sha1 b/plugins/repository-s3/licenses/jackson-annotations-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f63416ddb8ceb
--- /dev/null
+++ b/plugins/repository-s3/licenses/jackson-annotations-2.15.2.jar.sha1
@@ -0,0 +1 @@
+4724a65ac8e8d156a24898d50fd5dbd3642870b8
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/jackson-databind-2.15.1.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.15.1.jar.sha1
deleted file mode 100644
index 47405b86d4a51..0000000000000
--- a/plugins/repository-s3/licenses/jackson-databind-2.15.1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-ac9ba74d208faf356e4719a49e59c6ea9237c01d
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/jackson-databind-2.15.2.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.15.2.jar.sha1
new file mode 100644
index 0000000000000..f16d80af8dce6
--- /dev/null
+++ b/plugins/repository-s3/licenses/jackson-databind-2.15.2.jar.sha1
@@ -0,0 +1 @@
+9353b021f10c307c00328f52090de2bdb4b6ff9c
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/jmespath-java-1.12.270.jar.sha1 b/plugins/repository-s3/licenses/jmespath-java-1.12.270.jar.sha1
deleted file mode 100644
index a50e3040575c3..0000000000000
--- a/plugins/repository-s3/licenses/jmespath-java-1.12.270.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5bd3e1976e3b3b94c30e4868af9a5bfc4221e24a
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/json-utils-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/json-utils-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..a19b00e62f8b5
--- /dev/null
+++ b/plugins/repository-s3/licenses/json-utils-2.20.55.jar.sha1
@@ -0,0 +1 @@
+cd6710900e3190eac4c4496ae529ce08680dd320
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/json-utils-LICENSE.txt b/plugins/repository-s3/licenses/json-utils-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/json-utils-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/json-utils-NOTICE.txt b/plugins/repository-s3/licenses/json-utils-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/json-utils-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/metrics-spi-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/metrics-spi-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..db6701d87892a
--- /dev/null
+++ b/plugins/repository-s3/licenses/metrics-spi-2.20.55.jar.sha1
@@ -0,0 +1 @@
+8a0eae705b27465516f3b09cc9918e40963d534d
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/metrics-spi-LICENSE.txt b/plugins/repository-s3/licenses/metrics-spi-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/metrics-spi-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/metrics-spi-NOTICE.txt b/plugins/repository-s3/licenses/metrics-spi-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/metrics-spi-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/netty-LICENSE.txt b/plugins/repository-s3/licenses/netty-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/netty-NOTICE.txt b/plugins/repository-s3/licenses/netty-NOTICE.txt
new file mode 100644
index 0000000000000..5bbf91a14de23
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-NOTICE.txt
@@ -0,0 +1,116 @@
+
+ The Netty Project
+ =================
+
+Please visit the Netty web site for more information:
+
+ * http://netty.io/
+
+Copyright 2011 The Netty Project
+
+The Netty Project licenses this file to you under the Apache License,
+version 2.0 (the "License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at:
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.
+
+Also, please refer to each LICENSE..txt file, which is located in
+the 'license' directory of the distribution file, for the license terms of the
+components that this product depends on.
+
+-------------------------------------------------------------------------------
+This product contains the extensions to Java Collections Framework which has
+been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
+
+ * LICENSE:
+ * license/LICENSE.jsr166y.txt (Public Domain)
+ * HOMEPAGE:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
+ * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/
+
+This product contains a modified version of Robert Harder's Public Domain
+Base64 Encoder and Decoder, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.base64.txt (Public Domain)
+ * HOMEPAGE:
+ * http://iharder.sourceforge.net/current/java/base64/
+
+This product contains a modified version of 'JZlib', a re-implementation of
+zlib in pure Java, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jzlib.txt (BSD Style License)
+ * HOMEPAGE:
+ * http://www.jcraft.com/jzlib/
+
+This product contains a modified version of 'Webbit', a Java event based
+WebSocket and HTTP server:
+
+ * LICENSE:
+ * license/LICENSE.webbit.txt (BSD License)
+ * HOMEPAGE:
+ * https://github.com/joewalnes/webbit
+
+This product optionally depends on 'Protocol Buffers', Google's data
+interchange format, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.protobuf.txt (New BSD License)
+ * HOMEPAGE:
+ * http://code.google.com/p/protobuf/
+
+This product optionally depends on 'Bouncy Castle Crypto APIs' to generate
+a temporary self-signed X.509 certificate when the JVM does not provide the
+equivalent functionality. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.bouncycastle.txt (MIT License)
+ * HOMEPAGE:
+ * http://www.bouncycastle.org/
+
+This product optionally depends on 'SLF4J', a simple logging facade for Java,
+which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.slf4j.txt (MIT License)
+ * HOMEPAGE:
+ * http://www.slf4j.org/
+
+This product optionally depends on 'Apache Commons Logging', a logging
+framework, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.commons-logging.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * http://commons.apache.org/logging/
+
+This product optionally depends on 'Apache Log4J', a logging framework,
+which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.log4j.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * http://logging.apache.org/log4j/
+
+This product optionally depends on 'JBoss Logging', a logging framework,
+which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jboss-logging.txt (GNU LGPL 2.1)
+ * HOMEPAGE:
+ * http://anonsvn.jboss.org/repos/common/common-logging-spi/
+
+This product optionally depends on 'Apache Felix', an open source OSGi
+framework implementation, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.felix.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * http://felix.apache.org/
diff --git a/plugins/repository-s3/licenses/netty-buffer-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-buffer-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..5c5a17a9466f1
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-buffer-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+87fac21f4ef95157866b07b48e3c707a2f13c581
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-codec-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-codec-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..2b12a111335a2
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-codec-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+503badb458b6586632be8d1f81aa4e5ab99a80fc
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-codec-http-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-codec-http-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..6719e882e40fe
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-codec-http-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+36acf0c94d03eb6ecef78a749a32cbb7dc0c57b4
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-codec-http2-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..02423842d6244
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+0f1625b43bde13ec057da0d2fe381ded2547a70e
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-common-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-common-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..2324a54dc5735
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-common-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+1cfc49b91b0d3ddb30c9f7d8467e5d02ae8babdf
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-handler-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-handler-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..54e5b22047812
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-handler-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+10f7ed9d8e1bfcba416074c70e5388be96116bfc
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-nio-client-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/netty-nio-client-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..489f18e0bceaa
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-nio-client-2.20.55.jar.sha1
@@ -0,0 +1 @@
+4c269571ad2fb19851ebd7c7856aa2975fe0bab3
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-resolver-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-resolver-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..c795762c2d7f1
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-resolver-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+3860e99075f9e078364ed38f6d6fc8825b7a168a
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-transport-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-transport-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..687cade3c7b3a
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-transport-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+1a0894915c8027ce83b4d6a811c4e765955efd15
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-transport-classes-epoll-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-transport-classes-epoll-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..81a180b455cdd
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-transport-classes-epoll-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+79c2d95406bc2ef38c08c34efd16039919db80be
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1 b/plugins/repository-s3/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
new file mode 100644
index 0000000000000..0f0acb2eccddf
--- /dev/null
+++ b/plugins/repository-s3/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
@@ -0,0 +1 @@
+f4fb8b4c8da539091f43abcbb9f0389e48807eea
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/profiles-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/profiles-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..b7104cf0939e6
--- /dev/null
+++ b/plugins/repository-s3/licenses/profiles-2.20.55.jar.sha1
@@ -0,0 +1 @@
+959aad08b2f24057bf286c761b49e3af31a0a623
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/profiles-LICENSE.txt b/plugins/repository-s3/licenses/profiles-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/profiles-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/profiles-NOTICE.txt b/plugins/repository-s3/licenses/profiles-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/profiles-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/protocol-core-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/protocol-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..4dee45f4d9dd3
--- /dev/null
+++ b/plugins/repository-s3/licenses/protocol-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+0935e3ab32962a890f1d13bf39ba2167d9d692f9
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/protocol-core-LICENSE.txt b/plugins/repository-s3/licenses/protocol-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/protocol-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/protocol-core-NOTICE.txt b/plugins/repository-s3/licenses/protocol-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/protocol-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/reactive-streams-1.0.4.jar.sha1 b/plugins/repository-s3/licenses/reactive-streams-1.0.4.jar.sha1
new file mode 100644
index 0000000000000..45a80e3f7e361
--- /dev/null
+++ b/plugins/repository-s3/licenses/reactive-streams-1.0.4.jar.sha1
@@ -0,0 +1 @@
+3864a1320d97d7b045f729a326e1e077661f31b7
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/reactive-streams-LICENSE.txt b/plugins/repository-s3/licenses/reactive-streams-LICENSE.txt
new file mode 100644
index 0000000000000..1e3c7e7c77495
--- /dev/null
+++ b/plugins/repository-s3/licenses/reactive-streams-LICENSE.txt
@@ -0,0 +1,21 @@
+MIT No Attribution
+
+Copyright 2014 Reactive Streams
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/reactive-streams-NOTICE.txt b/plugins/repository-s3/licenses/reactive-streams-NOTICE.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/plugins/repository-s3/licenses/regions-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/regions-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..993fc2f97de62
--- /dev/null
+++ b/plugins/repository-s3/licenses/regions-2.20.55.jar.sha1
@@ -0,0 +1 @@
+a117c19b4a30e902f4f1cc4bef6b5c10cc9aef31
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/regions-LICENSE.txt b/plugins/repository-s3/licenses/regions-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/regions-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/regions-NOTICE.txt b/plugins/repository-s3/licenses/regions-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/regions-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/s3-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/s3-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..b7f3157995aa6
--- /dev/null
+++ b/plugins/repository-s3/licenses/s3-2.20.55.jar.sha1
@@ -0,0 +1 @@
+69e7df4c7c170867dc246c0205c5e0b6099e8a6f
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/s3-LICENSE.txt b/plugins/repository-s3/licenses/s3-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/s3-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/s3-NOTICE.txt b/plugins/repository-s3/licenses/s3-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/s3-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/sdk-core-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/sdk-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..5f12be9c08c5b
--- /dev/null
+++ b/plugins/repository-s3/licenses/sdk-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+8f2347feaf2575560ca89a2caa8d0243dbeb17a9
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/sdk-core-LICENSE.txt b/plugins/repository-s3/licenses/sdk-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/sdk-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/sdk-core-NOTICE.txt b/plugins/repository-s3/licenses/sdk-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/sdk-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/signer-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/signer-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..ec53fa0db623e
--- /dev/null
+++ b/plugins/repository-s3/licenses/signer-2.20.55.jar.sha1
@@ -0,0 +1 @@
+a44e55775ae429931287f81a634eeb67bd607a9f
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/signer-LICENSE.txt b/plugins/repository-s3/licenses/signer-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/signer-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/signer-NOTICE.txt b/plugins/repository-s3/licenses/signer-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/signer-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/slf4j-api-1.7.36.jar.sha1 b/plugins/repository-s3/licenses/slf4j-api-1.7.36.jar.sha1
new file mode 100644
index 0000000000000..77b9917528382
--- /dev/null
+++ b/plugins/repository-s3/licenses/slf4j-api-1.7.36.jar.sha1
@@ -0,0 +1 @@
+6c62681a2f655b49963a5983b8b0950a6120ae14
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/slf4j-api-LICENSE.txt b/plugins/repository-s3/licenses/slf4j-api-LICENSE.txt
new file mode 100644
index 0000000000000..8fda22f4d72f6
--- /dev/null
+++ b/plugins/repository-s3/licenses/slf4j-api-LICENSE.txt
@@ -0,0 +1,21 @@
+Copyright (c) 2004-2014 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/plugins/repository-s3/licenses/slf4j-api-NOTICE.txt b/plugins/repository-s3/licenses/slf4j-api-NOTICE.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/plugins/repository-s3/licenses/sts-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/sts-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..9f4bbdd0f22ad
--- /dev/null
+++ b/plugins/repository-s3/licenses/sts-2.20.55.jar.sha1
@@ -0,0 +1 @@
+adc350996b6f8481a32c8e73598138fc32826584
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/sts-LICENSE.txt b/plugins/repository-s3/licenses/sts-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/sts-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/sts-NOTICE.txt b/plugins/repository-s3/licenses/sts-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/sts-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/third-party-jackson-core-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/third-party-jackson-core-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..e7eebbb98f1fe
--- /dev/null
+++ b/plugins/repository-s3/licenses/third-party-jackson-core-2.20.55.jar.sha1
@@ -0,0 +1 @@
+956912f26056fc7d46b2db566362fe5f7a8c0e14
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/third-party-jackson-core-LICENSE.txt b/plugins/repository-s3/licenses/third-party-jackson-core-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/third-party-jackson-core-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/third-party-jackson-core-NOTICE.txt b/plugins/repository-s3/licenses/third-party-jackson-core-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/third-party-jackson-core-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/licenses/utils-2.20.55.jar.sha1 b/plugins/repository-s3/licenses/utils-2.20.55.jar.sha1
new file mode 100644
index 0000000000000..fc4cde604e33c
--- /dev/null
+++ b/plugins/repository-s3/licenses/utils-2.20.55.jar.sha1
@@ -0,0 +1 @@
+d3e1bbbc19795eadbeb4dd963a94647576644097
\ No newline at end of file
diff --git a/plugins/repository-s3/licenses/utils-LICENSE.txt b/plugins/repository-s3/licenses/utils-LICENSE.txt
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/plugins/repository-s3/licenses/utils-LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/plugins/repository-s3/licenses/utils-NOTICE.txt b/plugins/repository-s3/licenses/utils-NOTICE.txt
new file mode 100644
index 0000000000000..d2bc5723e9aea
--- /dev/null
+++ b/plugins/repository-s3/licenses/utils-NOTICE.txt
@@ -0,0 +1,14 @@
+OpenSearch (https://opensearch.org/)
+Copyright OpenSearch Contributors
+
+This product includes software developed by
+Elasticsearch (http://www.elastic.co).
+Copyright 2009-2018 Elasticsearch
+
+This product includes software developed by The Apache Software
+Foundation (http://www.apache.org/).
+
+This product includes software developed by
+Joda.org (http://www.joda.org/).
+
+
diff --git a/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3BlobStoreRepositoryTests.java b/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3BlobStoreRepositoryTests.java
index 9dc1b1106e062..61268cf00a77a 100644
--- a/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3BlobStoreRepositoryTests.java
+++ b/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3BlobStoreRepositoryTests.java
@@ -31,12 +31,10 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.http.AmazonHttpClient;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import fixture.s3.S3HttpHandler;
-
import org.opensearch.cluster.metadata.RepositoryMetadata;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.SuppressForbidden;
@@ -53,9 +51,11 @@
import org.opensearch.plugins.Plugin;
import org.opensearch.repositories.blobstore.BlobStoreRepository;
import org.opensearch.repositories.blobstore.OpenSearchMockAPIBasedRepositoryIntegTestCase;
+import org.opensearch.repositories.s3.utils.AwsRequestSigner;
import org.opensearch.snapshots.mockstore.BlobStoreWrapper;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.threadpool.ThreadPool;
+import software.amazon.awssdk.core.internal.http.pipeline.stages.ApplyTransactionIdStage;
import java.io.IOException;
import java.nio.file.Path;
@@ -66,29 +66,33 @@
import java.util.Map;
import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.startsWith;
@SuppressForbidden(reason = "this test uses a HttpServer to emulate an S3 endpoint")
// Need to set up a new cluster for each test because cluster settings use randomized authentication settings
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST)
public class S3BlobStoreRepositoryTests extends OpenSearchMockAPIBasedRepositoryIntegTestCase {
- private String region;
+ private final String region = "test-region";
private String signerOverride;
+ private String previousOpenSearchPathConf;
@Override
public void setUp() throws Exception {
- if (randomBoolean()) {
- region = "test-region";
- }
- if (region != null && randomBoolean()) {
- signerOverride = randomFrom("AWS3SignerType", "AWS4SignerType");
- } else if (randomBoolean()) {
- signerOverride = "AWS3SignerType";
- }
+ signerOverride = AwsRequestSigner.VERSION_FOUR_SIGNER.getName();
+ previousOpenSearchPathConf = SocketAccess.doPrivileged(() -> System.setProperty("opensearch.path.conf", "config"));
super.setUp();
}
+ @Override
+ public void tearDown() throws Exception {
+ if (previousOpenSearchPathConf != null) {
+ SocketAccess.doPrivileged(() -> System.setProperty("opensearch.path.conf", previousOpenSearchPathConf));
+ } else {
+ SocketAccess.doPrivileged(() -> System.clearProperty("opensearch.path.conf"));
+ }
+ super.tearDown();
+ }
+
@Override
protected String repositoryType() {
return S3Repository.TYPE;
@@ -133,15 +137,15 @@ protected Settings nodeSettings(int nodeOrdinal) {
.put(S3ClientSettings.DISABLE_CHUNKED_ENCODING.getConcreteSettingForNamespace("test").getKey(), true)
// Disable request throttling because some random values in tests might generate too many failures for the S3 client
.put(S3ClientSettings.USE_THROTTLE_RETRIES_SETTING.getConcreteSettingForNamespace("test").getKey(), false)
+ .put(S3ClientSettings.PROXY_TYPE_SETTING.getConcreteSettingForNamespace("test").getKey(), ProxySettings.ProxyType.DIRECT)
.put(super.nodeSettings(nodeOrdinal))
.setSecureSettings(secureSettings);
if (signerOverride != null) {
builder.put(S3ClientSettings.SIGNER_OVERRIDE.getConcreteSettingForNamespace("test").getKey(), signerOverride);
}
- if (region != null) {
- builder.put(S3ClientSettings.REGION.getConcreteSettingForNamespace("test").getKey(), region);
- }
+
+ builder.put(S3ClientSettings.REGION.getConcreteSettingForNamespace("test").getKey(), region);
return builder.build();
}
@@ -206,14 +210,11 @@ public void handle(final HttpExchange exchange) throws IOException {
private void validateAuthHeader(HttpExchange exchange) {
final String authorizationHeaderV4 = exchange.getRequestHeaders().getFirst("Authorization");
- final String authorizationHeaderV3 = exchange.getRequestHeaders().getFirst("X-amzn-authorization");
- if ("AWS3SignerType".equals(signerOverride)) {
- assertThat(authorizationHeaderV3, startsWith("AWS3"));
- } else if ("AWS4SignerType".equals(signerOverride)) {
+ if ("AWS4SignerType".equals(signerOverride)) {
assertThat(authorizationHeaderV4, containsString("aws4_request"));
}
- if (region != null && authorizationHeaderV4 != null) {
+ if (authorizationHeaderV4 != null) {
assertThat(authorizationHeaderV4, containsString("/" + region + "/s3/"));
}
}
@@ -235,7 +236,7 @@ private static class S3ErroneousHttpHandler extends ErroneousHttpHandler {
@Override
protected String requestUniqueId(final HttpExchange exchange) {
// Amazon SDK client provides a unique ID per request
- return exchange.getRequestHeaders().getFirst(AmazonHttpClient.HEADER_SDK_TRANSACTION_ID);
+ return exchange.getRequestHeaders().getFirst(ApplyTransactionIdStage.HEADER_SDK_TRANSACTION_ID);
}
}
@@ -251,7 +252,7 @@ private static class S3StatsCollectorHttpHandler extends HttpStatsCollectorHandl
@Override
public void maybeTrack(final String request, Headers requestHeaders) {
- if (Regex.simpleMatch("GET /*/?prefix=*", request)) {
+ if (Regex.simpleMatch("GET /*?list-type=*", request)) {
trackRequest("ListObjects");
} else if (Regex.simpleMatch("GET /*/*", request)) {
trackRequest("GetObject");
diff --git a/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3RepositoryThirdPartyTests.java b/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3RepositoryThirdPartyTests.java
index bc2839d066092..c8b1670bfdd83 100644
--- a/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3RepositoryThirdPartyTests.java
+++ b/plugins/repository-s3/src/internalClusterTest/java/org/opensearch/repositories/s3/S3RepositoryThirdPartyTests.java
@@ -31,7 +31,9 @@
package org.opensearch.repositories.s3;
+import org.junit.Before;
import org.opensearch.action.support.master.AcknowledgedResponse;
+import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.blobstore.BlobMetadata;
import org.opensearch.common.blobstore.BlobPath;
import org.opensearch.common.settings.MockSecureSettings;
@@ -40,6 +42,7 @@
import org.opensearch.plugins.Plugin;
import org.opensearch.repositories.AbstractThirdPartyRepositoryTestCase;
import org.opensearch.repositories.blobstore.BlobStoreRepository;
+import software.amazon.awssdk.services.s3.model.StorageClass;
import java.util.Collection;
import java.util.Map;
@@ -52,6 +55,21 @@
public class S3RepositoryThirdPartyTests extends AbstractThirdPartyRepositoryTestCase {
+ @Override
+ @Before
+ @SuppressForbidden(reason = "Need to set system property here for AWS SDK v2")
+ public void setUp() throws Exception {
+ SocketAccess.doPrivileged(() -> System.setProperty("opensearch.path.conf", "config"));
+ super.setUp();
+ }
+
+ @Override
+ @SuppressForbidden(reason = "Need to reset system property here for AWS SDK v2")
+ public void tearDown() throws Exception {
+ SocketAccess.doPrivileged(() -> System.clearProperty("opensearch.path.conf"));
+ super.tearDown();
+ }
+
@Override
protected Collection> getPlugins() {
return pluginList(S3RepositoryPlugin.class);
@@ -73,6 +91,7 @@ protected SecureSettings credentials() {
protected void createRepository(String repoName) {
Settings.Builder settings = Settings.builder()
.put("bucket", System.getProperty("test.s3.bucket"))
+ .put("region", System.getProperty("test.s3.region", "us-west-2"))
.put("base_path", System.getProperty("test.s3.base", "testpath"));
final String endpoint = System.getProperty("test.s3.endpoint");
if (endpoint != null) {
@@ -81,12 +100,12 @@ protected void createRepository(String repoName) {
// only test different storage classes when running against the default endpoint, i.e. a genuine S3 service
if (randomBoolean()) {
final String storageClass = randomFrom(
- "standard",
- "reduced_redundancy",
- "standard_ia",
- "onezone_ia",
- "intelligent_tiering"
- );
+ StorageClass.STANDARD,
+ StorageClass.REDUCED_REDUNDANCY,
+ StorageClass.STANDARD_IA,
+ StorageClass.ONEZONE_IA,
+ StorageClass.INTELLIGENT_TIERING
+ ).toString();
logger.info("--> using storage_class [{}]", storageClass);
settings.put("storage_class", storageClass);
}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3Reference.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3Reference.java
index 6f14cd850ccf6..21554147d6f7c 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3Reference.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3Reference.java
@@ -32,22 +32,18 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.services.s3.AmazonS3;
-import com.amazonaws.services.s3.AmazonS3Client;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.services.s3.S3Client;
import org.opensearch.common.Nullable;
import org.opensearch.common.concurrent.RefCountedReleasable;
-import java.io.Closeable;
-import java.io.IOException;
-
/**
- * Handles the shutdown of the wrapped {@link AmazonS3Client} using reference
+ * Handles the shutdown of the wrapped {@link S3Client} using reference
* counting.
*/
-public class AmazonS3Reference extends RefCountedReleasable {
- AmazonS3Reference(AmazonS3 client) {
+public class AmazonS3Reference extends RefCountedReleasable {
+ AmazonS3Reference(S3Client client) {
this(client, null);
}
@@ -55,13 +51,13 @@ public class AmazonS3Reference extends RefCountedReleasable {
this(client.client(), client.credentials());
}
- AmazonS3Reference(AmazonS3 client, @Nullable AWSCredentialsProvider credentials) {
+ AmazonS3Reference(S3Client client, @Nullable AwsCredentialsProvider credentials) {
super("AWS_S3_CLIENT", client, () -> {
- client.shutdown();
- if (credentials instanceof Closeable) {
+ client.close();
+ if (credentials instanceof AutoCloseable) {
try {
- ((Closeable) credentials).close();
- } catch (IOException e) {
+ ((AutoCloseable) credentials).close();
+ } catch (Exception e) {
/* Do nothing here */
}
}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3WithCredentials.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3WithCredentials.java
index 5622be5546cb1..5e7459d532779 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3WithCredentials.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/AmazonS3WithCredentials.java
@@ -8,32 +8,32 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.auth.AWSCredentialsProvider;
-import com.amazonaws.services.s3.AmazonS3;
+import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
+import software.amazon.awssdk.services.s3.S3Client;
import org.opensearch.common.Nullable;
/**
- * The holder of the AmazonS3 and AWSCredentialsProvider
+ * The holder of the AmazonS3 and AwsCredentialsProvider
*/
final class AmazonS3WithCredentials {
- private final AmazonS3 client;
- private final AWSCredentialsProvider credentials;
+ private final S3Client client;
+ private final AwsCredentialsProvider credentials;
- private AmazonS3WithCredentials(final AmazonS3 client, @Nullable final AWSCredentialsProvider credentials) {
+ private AmazonS3WithCredentials(final S3Client client, @Nullable final AwsCredentialsProvider credentials) {
this.client = client;
this.credentials = credentials;
}
- AmazonS3 client() {
+ S3Client client() {
return client;
}
- AWSCredentialsProvider credentials() {
+ AwsCredentialsProvider credentials() {
return credentials;
}
- static AmazonS3WithCredentials create(final AmazonS3 client, @Nullable final AWSCredentialsProvider credentials) {
+ static AmazonS3WithCredentials create(final S3Client client, @Nullable final AwsCredentialsProvider credentials) {
return new AmazonS3WithCredentials(client, credentials);
}
}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/ProxySettings.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/ProxySettings.java
index 27ed7c7d9a245..8f7d566cac758 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/ProxySettings.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/ProxySettings.java
@@ -8,9 +8,10 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.Protocol;
-import org.opensearch.common.settings.SettingsException;
import org.opensearch.core.common.Strings;
+import org.opensearch.common.settings.SettingsException;
+import org.opensearch.repositories.s3.utils.Protocol;
+import software.amazon.awssdk.core.exception.SdkException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@@ -28,7 +29,7 @@ public static enum ProxyType {
private final String name;
- private ProxyType(String name) {
+ ProxyType(String name) {
this.name = name;
}
@@ -84,7 +85,7 @@ public InetSocketAddress getAddress() {
return new InetSocketAddress(InetAddress.getByName(host), port);
} catch (UnknownHostException e) {
// this error won't be thrown since validation of the host name is in the S3ClientSettings
- throw new RuntimeException(e);
+ throw SdkException.create("Unknown host", e);
}
}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BasicCredentials.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BasicCredentials.java
deleted file mode 100644
index 5f00236c671eb..0000000000000
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BasicCredentials.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- *
- * The OpenSearch Contributors require contributions made to
- * this file be licensed under the Apache-2.0 license or a
- * compatible open source license.
- */
-
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Modifications Copyright OpenSearch Contributors. See
- * GitHub history for details.
- */
-
-package org.opensearch.repositories.s3;
-
-import com.amazonaws.auth.AWSCredentials;
-
-import java.util.Objects;
-
-class S3BasicCredentials implements AWSCredentials {
-
- private final String accessKey;
-
- private final String secretKey;
-
- S3BasicCredentials(String accessKey, String secretKey) {
- this.accessKey = accessKey;
- this.secretKey = secretKey;
- }
-
- @Override
- public final String getAWSAccessKeyId() {
- return accessKey;
- }
-
- @Override
- public final String getAWSSecretKey() {
- return secretKey;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final S3BasicCredentials that = (S3BasicCredentials) o;
- return accessKey.equals(that.accessKey) && secretKey.equals(that.secretKey);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(accessKey, secretKey);
- }
-}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BasicSessionCredentials.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BasicSessionCredentials.java
deleted file mode 100644
index 2264dd6cde297..0000000000000
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BasicSessionCredentials.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- *
- * The OpenSearch Contributors require contributions made to
- * this file be licensed under the Apache-2.0 license or a
- * compatible open source license.
- */
-
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/*
- * Modifications Copyright OpenSearch Contributors. See
- * GitHub history for details.
- */
-
-package org.opensearch.repositories.s3;
-
-import com.amazonaws.auth.AWSSessionCredentials;
-
-import java.util.Objects;
-
-final class S3BasicSessionCredentials extends S3BasicCredentials implements AWSSessionCredentials {
-
- private final String sessionToken;
-
- S3BasicSessionCredentials(String accessKey, String secretKey, String sessionToken) {
- super(accessKey, secretKey);
- this.sessionToken = sessionToken;
- }
-
- @Override
- public String getSessionToken() {
- return sessionToken;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- final S3BasicSessionCredentials that = (S3BasicSessionCredentials) o;
- return sessionToken.equals(that.sessionToken)
- && getAWSAccessKeyId().equals(that.getAWSAccessKeyId())
- && getAWSSecretKey().equals(that.getAWSSecretKey());
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(sessionToken, getAWSAccessKeyId(), getAWSSecretKey());
- }
-}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java
index b0498da9f8e30..cf749eeffd903 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobContainer.java
@@ -32,19 +32,6 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.AmazonClientException;
-import com.amazonaws.services.s3.model.AbortMultipartUploadRequest;
-import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest;
-import com.amazonaws.services.s3.model.DeleteObjectsRequest;
-import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;
-import com.amazonaws.services.s3.model.ListObjectsRequest;
-import com.amazonaws.services.s3.model.MultiObjectDeleteException;
-import com.amazonaws.services.s3.model.ObjectListing;
-import com.amazonaws.services.s3.model.ObjectMetadata;
-import com.amazonaws.services.s3.model.PartETag;
-import com.amazonaws.services.s3.model.PutObjectRequest;
-import com.amazonaws.services.s3.model.UploadPartRequest;
-import com.amazonaws.services.s3.model.UploadPartResult;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
@@ -61,6 +48,28 @@
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.unit.ByteSizeUnit;
import org.opensearch.common.unit.ByteSizeValue;
+import software.amazon.awssdk.core.exception.SdkException;
+import software.amazon.awssdk.core.sync.RequestBody;
+import software.amazon.awssdk.services.s3.model.AbortMultipartUploadRequest;
+import software.amazon.awssdk.services.s3.model.CommonPrefix;
+import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadRequest;
+import software.amazon.awssdk.services.s3.model.CompletedMultipartUpload;
+import software.amazon.awssdk.services.s3.model.CompletedPart;
+import software.amazon.awssdk.services.s3.model.CreateMultipartUploadRequest;
+import software.amazon.awssdk.services.s3.model.Delete;
+import software.amazon.awssdk.services.s3.model.DeleteObjectsRequest;
+import software.amazon.awssdk.services.s3.model.DeleteObjectsResponse;
+import software.amazon.awssdk.services.s3.model.HeadObjectRequest;
+import software.amazon.awssdk.services.s3.model.ListObjectsV2Request;
+import software.amazon.awssdk.services.s3.model.ListObjectsV2Response;
+import software.amazon.awssdk.services.s3.model.NoSuchKeyException;
+import software.amazon.awssdk.services.s3.model.ObjectIdentifier;
+import software.amazon.awssdk.services.s3.model.PutObjectRequest;
+import software.amazon.awssdk.services.s3.model.S3Error;
+import software.amazon.awssdk.services.s3.model.ServerSideEncryption;
+import software.amazon.awssdk.services.s3.model.UploadPartRequest;
+import software.amazon.awssdk.services.s3.model.UploadPartResponse;
+import software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable;
import org.opensearch.core.common.Strings;
import java.io.ByteArrayInputStream;
@@ -68,6 +77,7 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -101,7 +111,13 @@ class S3BlobContainer extends AbstractBlobContainer {
@Override
public boolean blobExists(String blobName) {
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
- return SocketAccess.doPrivileged(() -> clientReference.get().doesObjectExist(blobStore.bucket(), buildKey(blobName)));
+ SocketAccess.doPrivileged(
+ () -> clientReference.get()
+ .headObject(HeadObjectRequest.builder().bucket(blobStore.bucket()).key(buildKey(blobName)).build())
+ );
+ return true;
+ } catch (NoSuchKeyException e) {
+ return false;
} catch (final Exception e) {
throw new BlobStoreException("Failed to check if blob [" + blobName + "] exists", e);
}
@@ -164,38 +180,39 @@ public DeleteResult delete() throws IOException {
final AtomicLong deletedBlobs = new AtomicLong();
final AtomicLong deletedBytes = new AtomicLong();
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
- ObjectListing prevListing = null;
- while (true) {
- ObjectListing list;
- if (prevListing != null) {
- final ObjectListing finalPrevListing = prevListing;
- list = SocketAccess.doPrivileged(() -> clientReference.get().listNextBatchOfObjects(finalPrevListing));
- } else {
- final ListObjectsRequest listObjectsRequest = new ListObjectsRequest();
- listObjectsRequest.setBucketName(blobStore.bucket());
- listObjectsRequest.setPrefix(keyPath);
- listObjectsRequest.setRequestMetricCollector(blobStore.listMetricCollector);
- list = SocketAccess.doPrivileged(() -> clientReference.get().listObjects(listObjectsRequest));
- }
- final List blobsToDelete = new ArrayList<>();
- list.getObjectSummaries().forEach(s3ObjectSummary -> {
+ ListObjectsV2Iterable listObjectsIterable = SocketAccess.doPrivileged(
+ () -> clientReference.get()
+ .listObjectsV2Paginator(
+ ListObjectsV2Request.builder()
+ .bucket(blobStore.bucket())
+ .prefix(keyPath)
+ .overrideConfiguration(
+ o -> o.addMetricPublisher(blobStore.getStatsMetricPublisher().listObjectsMetricPublisher)
+ )
+ .build()
+ )
+ );
+
+ Iterator listObjectsResponseIterator = listObjectsIterable.iterator();
+ while (listObjectsResponseIterator.hasNext()) {
+ ListObjectsV2Response listObjectsResponse = SocketAccess.doPrivileged(listObjectsResponseIterator::next);
+ List blobsToDelete = listObjectsResponse.contents().stream().map(s3Object -> {
deletedBlobs.incrementAndGet();
- deletedBytes.addAndGet(s3ObjectSummary.getSize());
- blobsToDelete.add(s3ObjectSummary.getKey());
- });
- if (list.isTruncated()) {
- doDeleteBlobs(blobsToDelete, false);
- prevListing = list;
- } else {
- final List lastBlobsToDelete = new ArrayList<>(blobsToDelete);
- lastBlobsToDelete.add(keyPath);
- doDeleteBlobs(lastBlobsToDelete, false);
- break;
+ deletedBytes.addAndGet(s3Object.size());
+
+ return s3Object.key();
+ }).collect(Collectors.toList());
+
+ if (!listObjectsResponseIterator.hasNext()) {
+ blobsToDelete.add(keyPath);
}
+
+ doDeleteBlobs(blobsToDelete, false);
}
- } catch (final AmazonClientException e) {
+ } catch (SdkException e) {
throw new IOException("Exception when deleting blob container [" + keyPath + "]", e);
}
+
return new DeleteResult(deletedBlobs.get(), deletedBytes.get());
}
@@ -229,34 +246,29 @@ private void doDeleteBlobs(List blobNames, boolean relative) throws IOEx
deleteRequests.add(bulkDelete(blobStore.bucket(), partition));
}
SocketAccess.doPrivilegedVoid(() -> {
- AmazonClientException aex = null;
+ SdkException aex = null;
for (DeleteObjectsRequest deleteRequest : deleteRequests) {
- List keysInRequest = deleteRequest.getKeys()
+ List keysInRequest = deleteRequest.delete()
+ .objects()
.stream()
- .map(DeleteObjectsRequest.KeyVersion::getKey)
+ .map(ObjectIdentifier::key)
.collect(Collectors.toList());
try {
- clientReference.get().deleteObjects(deleteRequest);
- outstanding.removeAll(keysInRequest);
- } catch (MultiObjectDeleteException e) {
- // We are sending quiet mode requests so we can't use the deleted keys entry on the exception and instead
- // first remove all keys that were sent in the request and then add back those that ran into an exception.
+ DeleteObjectsResponse deleteObjectsResponse = clientReference.get().deleteObjects(deleteRequest);
outstanding.removeAll(keysInRequest);
- outstanding.addAll(
- e.getErrors().stream().map(MultiObjectDeleteException.DeleteError::getKey).collect(Collectors.toSet())
- );
- logger.warn(
- () -> new ParameterizedMessage(
- "Failed to delete some blobs {}",
- e.getErrors()
- .stream()
- .map(err -> "[" + err.getKey() + "][" + err.getCode() + "][" + err.getMessage() + "]")
- .collect(Collectors.toList())
- ),
- e
- );
- aex = ExceptionsHelper.useOrSuppress(aex, e);
- } catch (AmazonClientException e) {
+ outstanding.addAll(deleteObjectsResponse.errors().stream().map(S3Error::key).collect(Collectors.toSet()));
+ if (!deleteObjectsResponse.errors().isEmpty()) {
+ logger.warn(
+ () -> new ParameterizedMessage(
+ "Failed to delete some blobs {}",
+ deleteObjectsResponse.errors()
+ .stream()
+ .map(s3Error -> "[" + s3Error.key() + "][" + s3Error.code() + "][" + s3Error.message() + "]")
+ .collect(Collectors.toList())
+ )
+ );
+ }
+ } catch (SdkException e) {
// The AWS client threw any unexpected exception and did not execute the request at all so we do not
// remove any keys from the outstanding deletes set.
aex = ExceptionsHelper.useOrSuppress(aex, e);
@@ -273,18 +285,27 @@ private void doDeleteBlobs(List blobNames, boolean relative) throws IOEx
}
private static DeleteObjectsRequest bulkDelete(String bucket, List blobs) {
- return new DeleteObjectsRequest(bucket).withKeys(blobs.toArray(Strings.EMPTY_ARRAY)).withQuiet(true);
+ return DeleteObjectsRequest.builder()
+ .bucket(bucket)
+ .delete(
+ Delete.builder()
+ .objects(blobs.stream().map(blob -> ObjectIdentifier.builder().key(blob).build()).collect(Collectors.toList()))
+ .quiet(true)
+ .build()
+ )
+ .build();
}
@Override
public Map listBlobsByPrefix(@Nullable String blobNamePrefix) throws IOException {
+ String prefix = blobNamePrefix == null ? keyPath : buildKey(blobNamePrefix);
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
- return executeListing(clientReference, listObjectsRequest(blobNamePrefix == null ? keyPath : buildKey(blobNamePrefix))).stream()
- .flatMap(listing -> listing.getObjectSummaries().stream())
- .map(summary -> new PlainBlobMetadata(summary.getKey().substring(keyPath.length()), summary.getSize()))
+ return executeListing(clientReference, listObjectsRequest(prefix)).stream()
+ .flatMap(listing -> listing.contents().stream())
+ .map(s3Object -> new PlainBlobMetadata(s3Object.key().substring(keyPath.length()), s3Object.size()))
.collect(Collectors.toMap(PlainBlobMetadata::name, Function.identity()));
- } catch (final AmazonClientException e) {
- throw new IOException("Exception when listing blobs by prefix [" + blobNamePrefix + "]", e);
+ } catch (final SdkException e) {
+ throw new IOException("Exception when listing blobs by prefix [" + prefix + "]", e);
}
}
@@ -296,53 +317,43 @@ public Map listBlobs() throws IOException {
@Override
public Map children() throws IOException {
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
- return executeListing(clientReference, listObjectsRequest(keyPath)).stream().flatMap(listing -> {
- assert listing.getObjectSummaries().stream().noneMatch(s -> {
- for (String commonPrefix : listing.getCommonPrefixes()) {
- if (s.getKey().substring(keyPath.length()).startsWith(commonPrefix)) {
+ return executeListing(clientReference, listObjectsRequest(keyPath)).stream().flatMap(listObjectsResponse -> {
+ assert listObjectsResponse.contents().stream().noneMatch(s -> {
+ for (CommonPrefix commonPrefix : listObjectsResponse.commonPrefixes()) {
+ if (s.key().substring(keyPath.length()).startsWith(commonPrefix.prefix())) {
return true;
}
}
return false;
}) : "Response contained children for listed common prefixes.";
- return listing.getCommonPrefixes().stream();
+ return listObjectsResponse.commonPrefixes().stream();
})
- .map(prefix -> prefix.substring(keyPath.length()))
+ .map(commonPrefix -> commonPrefix.prefix().substring(keyPath.length()))
.filter(name -> name.isEmpty() == false)
// Stripping the trailing slash off of the common prefix
.map(name -> name.substring(0, name.length() - 1))
.collect(Collectors.toMap(Function.identity(), name -> blobStore.blobContainer(path().add(name))));
- } catch (final AmazonClientException e) {
+ } catch (final SdkException e) {
throw new IOException("Exception when listing children of [" + path().buildAsString() + ']', e);
}
}
- private static List executeListing(AmazonS3Reference clientReference, ListObjectsRequest listObjectsRequest) {
- final List results = new ArrayList<>();
- ObjectListing prevListing = null;
- while (true) {
- ObjectListing list;
- if (prevListing != null) {
- final ObjectListing finalPrevListing = prevListing;
- list = SocketAccess.doPrivileged(() -> clientReference.get().listNextBatchOfObjects(finalPrevListing));
- } else {
- list = SocketAccess.doPrivileged(() -> clientReference.get().listObjects(listObjectsRequest));
- }
- results.add(list);
- if (list.isTruncated()) {
- prevListing = list;
- } else {
- break;
- }
- }
- return results;
+ private static List executeListing(AmazonS3Reference clientReference, ListObjectsV2Request listObjectsRequest) {
+ return SocketAccess.doPrivileged(() -> {
+ final List results = new ArrayList<>();
+ ListObjectsV2Iterable listObjectsIterable = clientReference.get().listObjectsV2Paginator(listObjectsRequest);
+ listObjectsIterable.forEach(results::add);
+ return results;
+ });
}
- private ListObjectsRequest listObjectsRequest(String keyPath) {
- return new ListObjectsRequest().withBucketName(blobStore.bucket())
- .withPrefix(keyPath)
- .withDelimiter("/")
- .withRequestMetricCollector(blobStore.listMetricCollector);
+ private ListObjectsV2Request listObjectsRequest(String keyPath) {
+ return ListObjectsV2Request.builder()
+ .bucket(blobStore.bucket())
+ .prefix(keyPath)
+ .delimiter("/")
+ .overrideConfiguration(o -> o.addMetricPublisher(blobStore.getStatsMetricPublisher().listObjectsMetricPublisher))
+ .build();
}
private String buildKey(String blobName) {
@@ -363,19 +374,23 @@ void executeSingleUpload(final S3BlobStore blobStore, final String blobName, fin
throw new IllegalArgumentException("Upload request size [" + blobSize + "] can't be larger than buffer size");
}
- final ObjectMetadata md = new ObjectMetadata();
- md.setContentLength(blobSize);
+ PutObjectRequest.Builder putObjectRequestBuilder = PutObjectRequest.builder()
+ .bucket(blobStore.bucket())
+ .key(blobName)
+ .contentLength(blobSize)
+ .storageClass(blobStore.getStorageClass())
+ .acl(blobStore.getCannedACL())
+ .overrideConfiguration(o -> o.addMetricPublisher(blobStore.getStatsMetricPublisher().putObjectMetricPublisher));
if (blobStore.serverSideEncryption()) {
- md.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
+ putObjectRequestBuilder.serverSideEncryption(ServerSideEncryption.AES256);
}
- final PutObjectRequest putRequest = new PutObjectRequest(blobStore.bucket(), blobName, input, md);
- putRequest.setStorageClass(blobStore.getStorageClass());
- putRequest.setCannedAcl(blobStore.getCannedACL());
- putRequest.setRequestMetricCollector(blobStore.putMetricCollector);
+ PutObjectRequest putObjectRequest = putObjectRequestBuilder.build();
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
- SocketAccess.doPrivilegedVoid(() -> { clientReference.get().putObject(putRequest); });
- } catch (final AmazonClientException e) {
+ SocketAccess.doPrivilegedVoid(
+ () -> clientReference.get().putObject(putObjectRequest, RequestBody.fromInputStream(input, blobSize))
+ );
+ } catch (final SdkException e) {
throw new IOException("Unable to upload object [" + blobName + "] using a single upload", e);
}
}
@@ -402,45 +417,46 @@ void executeMultipartUpload(final S3BlobStore blobStore, final String blobName,
final String bucketName = blobStore.bucket();
boolean success = false;
- final InitiateMultipartUploadRequest initRequest = new InitiateMultipartUploadRequest(bucketName, blobName);
- initRequest.setStorageClass(blobStore.getStorageClass());
- initRequest.setCannedACL(blobStore.getCannedACL());
- initRequest.setRequestMetricCollector(blobStore.multiPartUploadMetricCollector);
+ CreateMultipartUploadRequest.Builder createMultipartUploadRequestBuilder = CreateMultipartUploadRequest.builder()
+ .bucket(bucketName)
+ .key(blobName)
+ .storageClass(blobStore.getStorageClass())
+ .acl(blobStore.getCannedACL())
+ .overrideConfiguration(o -> o.addMetricPublisher(blobStore.getStatsMetricPublisher().multipartUploadMetricCollector));
+
if (blobStore.serverSideEncryption()) {
- final ObjectMetadata md = new ObjectMetadata();
- md.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
- initRequest.setObjectMetadata(md);
+ createMultipartUploadRequestBuilder.serverSideEncryption(ServerSideEncryption.AES256);
}
- try (AmazonS3Reference clientReference = blobStore.clientReference()) {
- uploadId.set(SocketAccess.doPrivileged(() -> clientReference.get().initiateMultipartUpload(initRequest).getUploadId()));
+ CreateMultipartUploadRequest createMultipartUploadRequest = createMultipartUploadRequestBuilder.build();
+ try (AmazonS3Reference clientReference = blobStore.clientReference()) {
+ uploadId.set(
+ SocketAccess.doPrivileged(() -> clientReference.get().createMultipartUpload(createMultipartUploadRequest).uploadId())
+ );
if (Strings.isEmpty(uploadId.get())) {
throw new IOException("Failed to initialize multipart upload " + blobName);
}
- final List parts = new ArrayList<>();
+ final List parts = new ArrayList<>();
long bytesCount = 0;
for (int i = 1; i <= nbParts; i++) {
- final UploadPartRequest uploadRequest = new UploadPartRequest();
- uploadRequest.setBucketName(bucketName);
- uploadRequest.setKey(blobName);
- uploadRequest.setUploadId(uploadId.get());
- uploadRequest.setPartNumber(i);
- uploadRequest.setInputStream(input);
- uploadRequest.setRequestMetricCollector(blobStore.multiPartUploadMetricCollector);
-
- if (i < nbParts) {
- uploadRequest.setPartSize(partSize);
- uploadRequest.setLastPart(false);
- } else {
- uploadRequest.setPartSize(lastPartSize);
- uploadRequest.setLastPart(true);
- }
- bytesCount += uploadRequest.getPartSize();
-
- final UploadPartResult uploadResponse = SocketAccess.doPrivileged(() -> clientReference.get().uploadPart(uploadRequest));
- parts.add(uploadResponse.getPartETag());
+ final UploadPartRequest uploadPartRequest = UploadPartRequest.builder()
+ .bucket(bucketName)
+ .key(blobName)
+ .uploadId(uploadId.get())
+ .partNumber(i)
+ .contentLength((i < nbParts) ? partSize : lastPartSize)
+ .overrideConfiguration(o -> o.addMetricPublisher(blobStore.getStatsMetricPublisher().multipartUploadMetricCollector))
+ .build();
+
+ bytesCount += uploadPartRequest.contentLength();
+
+ final UploadPartResponse uploadResponse = SocketAccess.doPrivileged(
+ () -> clientReference.get()
+ .uploadPart(uploadPartRequest, RequestBody.fromInputStream(input, uploadPartRequest.contentLength()))
+ );
+ parts.add(CompletedPart.builder().partNumber(uploadPartRequest.partNumber()).eTag(uploadResponse.eTag()).build());
}
if (bytesCount != blobSize) {
@@ -449,21 +465,26 @@ void executeMultipartUpload(final S3BlobStore blobStore, final String blobName,
);
}
- final CompleteMultipartUploadRequest complRequest = new CompleteMultipartUploadRequest(
- bucketName,
- blobName,
- uploadId.get(),
- parts
- );
- complRequest.setRequestMetricCollector(blobStore.multiPartUploadMetricCollector);
- SocketAccess.doPrivilegedVoid(() -> clientReference.get().completeMultipartUpload(complRequest));
+ CompleteMultipartUploadRequest completeMultipartUploadRequest = CompleteMultipartUploadRequest.builder()
+ .bucket(bucketName)
+ .key(blobName)
+ .uploadId(uploadId.get())
+ .multipartUpload(CompletedMultipartUpload.builder().parts(parts).build())
+ .overrideConfiguration(o -> o.addMetricPublisher(blobStore.getStatsMetricPublisher().multipartUploadMetricCollector))
+ .build();
+
+ SocketAccess.doPrivilegedVoid(() -> clientReference.get().completeMultipartUpload(completeMultipartUploadRequest));
success = true;
- } catch (final AmazonClientException e) {
+ } catch (final SdkException e) {
throw new IOException("Unable to upload object [" + blobName + "] using multipart upload", e);
} finally {
if ((success == false) && Strings.hasLength(uploadId.get())) {
- final AbortMultipartUploadRequest abortRequest = new AbortMultipartUploadRequest(bucketName, blobName, uploadId.get());
+ AbortMultipartUploadRequest abortRequest = AbortMultipartUploadRequest.builder()
+ .bucket(bucketName)
+ .key(blobName)
+ .uploadId(uploadId.get())
+ .build();
try (AmazonS3Reference clientReference = blobStore.clientReference()) {
SocketAccess.doPrivilegedVoid(() -> clientReference.get().abortMultipartUpload(abortRequest));
}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobStore.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobStore.java
index 90f8bbb6612d4..6a9be2df2bf72 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobStore.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3BlobStore.java
@@ -32,12 +32,6 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.Request;
-import com.amazonaws.Response;
-import com.amazonaws.metrics.RequestMetricCollector;
-import com.amazonaws.services.s3.model.CannedAccessControlList;
-import com.amazonaws.services.s3.model.StorageClass;
-import com.amazonaws.util.AWSRequestMetrics;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.cluster.metadata.RepositoryMetadata;
@@ -46,12 +40,12 @@
import org.opensearch.common.blobstore.BlobStore;
import org.opensearch.common.blobstore.BlobStoreException;
import org.opensearch.common.unit.ByteSizeValue;
+import software.amazon.awssdk.services.s3.model.ObjectCannedACL;
+import software.amazon.awssdk.services.s3.model.StorageClass;
import java.io.IOException;
-import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
class S3BlobStore implements BlobStore {
@@ -65,18 +59,13 @@ class S3BlobStore implements BlobStore {
private final boolean serverSideEncryption;
- private final CannedAccessControlList cannedACL;
+ private final ObjectCannedACL cannedACL;
private final StorageClass storageClass;
private final RepositoryMetadata repositoryMetadata;
- private final Stats stats = new Stats();
-
- final RequestMetricCollector getMetricCollector;
- final RequestMetricCollector listMetricCollector;
- final RequestMetricCollector putMetricCollector;
- final RequestMetricCollector multiPartUploadMetricCollector;
+ private final StatsMetricPublisher statsMetricPublisher = new StatsMetricPublisher();
S3BlobStore(
S3Service service,
@@ -94,43 +83,6 @@ class S3BlobStore implements BlobStore {
this.cannedACL = initCannedACL(cannedACL);
this.storageClass = initStorageClass(storageClass);
this.repositoryMetadata = repositoryMetadata;
- this.getMetricCollector = new RequestMetricCollector() {
- @Override
- public void collectMetrics(Request> request, Response> response) {
- assert request.getHttpMethod().name().equals("GET");
- stats.getCount.addAndGet(getRequestCount(request));
- }
- };
- this.listMetricCollector = new RequestMetricCollector() {
- @Override
- public void collectMetrics(Request> request, Response> response) {
- assert request.getHttpMethod().name().equals("GET");
- stats.listCount.addAndGet(getRequestCount(request));
- }
- };
- this.putMetricCollector = new RequestMetricCollector() {
- @Override
- public void collectMetrics(Request> request, Response> response) {
- assert request.getHttpMethod().name().equals("PUT");
- stats.putCount.addAndGet(getRequestCount(request));
- }
- };
- this.multiPartUploadMetricCollector = new RequestMetricCollector() {
- @Override
- public void collectMetrics(Request> request, Response> response) {
- assert request.getHttpMethod().name().equals("PUT") || request.getHttpMethod().name().equals("POST");
- stats.postCount.addAndGet(getRequestCount(request));
- }
- };
- }
-
- private long getRequestCount(Request> request) {
- Number requestCount = request.getAWSRequestMetrics().getTimingInfo().getCounter(AWSRequestMetrics.Field.RequestCount.name());
- if (requestCount == null) {
- logger.warn("Expected request count to be tracked for request [{}] but found not count.", request);
- return 0L;
- }
- return requestCount.longValue();
}
@Override
@@ -170,10 +122,10 @@ public void close() throws IOException {
@Override
public Map stats() {
- return stats.toMap();
+ return statsMetricPublisher.getStats().toMap();
}
- public CannedAccessControlList getCannedACL() {
+ public ObjectCannedACL getCannedACL() {
return cannedACL;
}
@@ -181,32 +133,36 @@ public StorageClass getStorageClass() {
return storageClass;
}
- public static StorageClass initStorageClass(String storageClass) {
- if ((storageClass == null) || storageClass.equals("")) {
- return StorageClass.Standard;
+ public StatsMetricPublisher getStatsMetricPublisher() {
+ return statsMetricPublisher;
+ }
+
+ public static StorageClass initStorageClass(String storageClassStringValue) {
+ if ((storageClassStringValue == null) || storageClassStringValue.equals("")) {
+ return StorageClass.STANDARD;
}
- try {
- final StorageClass _storageClass = StorageClass.fromValue(storageClass.toUpperCase(Locale.ENGLISH));
- if (_storageClass.equals(StorageClass.Glacier)) {
- throw new BlobStoreException("Glacier storage class is not supported");
- }
+ final StorageClass storageClass = StorageClass.fromValue(storageClassStringValue.toUpperCase(Locale.ENGLISH));
+ if (storageClass.equals(StorageClass.GLACIER)) {
+ throw new BlobStoreException("Glacier storage class is not supported");
+ }
- return _storageClass;
- } catch (final IllegalArgumentException illegalArgumentException) {
- throw new BlobStoreException("`" + storageClass + "` is not a valid S3 Storage Class.");
+ if (storageClass == StorageClass.UNKNOWN_TO_SDK_VERSION) {
+ throw new BlobStoreException("`" + storageClassStringValue + "` is not a valid S3 Storage Class.");
}
+
+ return storageClass;
}
/**
* Constructs canned acl from string
*/
- public static CannedAccessControlList initCannedACL(String cannedACL) {
+ public static ObjectCannedACL initCannedACL(String cannedACL) {
if ((cannedACL == null) || cannedACL.equals("")) {
- return CannedAccessControlList.Private;
+ return ObjectCannedACL.PRIVATE;
}
- for (final CannedAccessControlList cur : CannedAccessControlList.values()) {
+ for (final ObjectCannedACL cur : ObjectCannedACL.values()) {
if (cur.toString().equalsIgnoreCase(cannedACL)) {
return cur;
}
@@ -214,24 +170,4 @@ public static CannedAccessControlList initCannedACL(String cannedACL) {
throw new BlobStoreException("cannedACL is not valid: [" + cannedACL + "]");
}
-
- static class Stats {
-
- final AtomicLong listCount = new AtomicLong();
-
- final AtomicLong getCount = new AtomicLong();
-
- final AtomicLong putCount = new AtomicLong();
-
- final AtomicLong postCount = new AtomicLong();
-
- Map toMap() {
- final Map results = new HashMap<>();
- results.put("GetObject", getCount.get());
- results.put("ListObjects", listCount.get());
- results.put("PutObject", putCount.get());
- results.put("PutMultipartObject", postCount.get());
- return results;
- }
- }
}
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java
index ba7535dd78f68..5f6be6ac01e76 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3ClientSettings.java
@@ -32,8 +32,7 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.ClientConfiguration;
-import com.amazonaws.Protocol;
+import org.opensearch.core.common.Strings;
import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.io.PathUtils;
import org.opensearch.common.logging.DeprecationLogger;
@@ -44,7 +43,10 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.SettingsException;
import org.opensearch.common.unit.TimeValue;
-import org.opensearch.core.common.Strings;
+import org.opensearch.repositories.s3.utils.Protocol;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.AwsCredentials;
+import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -167,21 +169,21 @@ final class S3ClientSettings {
static final Setting.AffixSetting READ_TIMEOUT_SETTING = Setting.affixKeySetting(
PREFIX,
"read_timeout",
- key -> Setting.timeSetting(key, TimeValue.timeValueMillis(ClientConfiguration.DEFAULT_SOCKET_TIMEOUT), Property.NodeScope)
+ key -> Setting.timeSetting(key, TimeValue.timeValueMillis(50_000), Property.NodeScope)
);
/** The number of retries to use when an s3 request fails. */
static final Setting.AffixSetting MAX_RETRIES_SETTING = Setting.affixKeySetting(
PREFIX,
"max_retries",
- key -> Setting.intSetting(key, ClientConfiguration.DEFAULT_RETRY_POLICY.getMaxErrorRetry(), 0, Property.NodeScope)
+ key -> Setting.intSetting(key, 3, 0, Property.NodeScope)
);
/** Whether retries should be throttled (ie use backoff). */
static final Setting.AffixSetting USE_THROTTLE_RETRIES_SETTING = Setting.affixKeySetting(
PREFIX,
"use_throttle_retries",
- key -> Setting.boolSetting(key, ClientConfiguration.DEFAULT_THROTTLE_RETRIES, Property.NodeScope)
+ key -> Setting.boolSetting(key, true, Property.NodeScope)
);
/** Whether the s3 client should use path style access. */
@@ -213,7 +215,7 @@ final class S3ClientSettings {
);
/** Credentials to authenticate with s3. */
- final S3BasicCredentials credentials;
+ final AwsCredentials credentials;
/** Credentials to authenticate with s3 using IAM Roles for Service Accounts (IRSA). */
final IrsaCredentials irsaCredentials;
@@ -249,7 +251,7 @@ final class S3ClientSettings {
final String signerOverride;
private S3ClientSettings(
- S3BasicCredentials credentials,
+ AwsCredentials credentials,
IrsaCredentials irsaCredentials,
String endpoint,
Protocol protocol,
@@ -306,7 +308,7 @@ S3ClientSettings refine(Settings repositorySettings) {
normalizedSettings,
disableChunkedEncoding
);
- final S3BasicCredentials newCredentials;
+ final AwsCredentials newCredentials;
if (checkDeprecatedCredentials(repositorySettings)) {
newCredentials = loadDeprecatedCredentials(repositorySettings);
} else {
@@ -390,17 +392,17 @@ static boolean checkDeprecatedCredentials(Settings repositorySettings) {
}
// backcompat for reading keys out of repository settings (clusterState)
- private static S3BasicCredentials loadDeprecatedCredentials(Settings repositorySettings) {
+ private static AwsCredentials loadDeprecatedCredentials(Settings repositorySettings) {
assert checkDeprecatedCredentials(repositorySettings);
try (
SecureString key = S3Repository.ACCESS_KEY_SETTING.get(repositorySettings);
SecureString secret = S3Repository.SECRET_KEY_SETTING.get(repositorySettings)
) {
- return new S3BasicCredentials(key.toString(), secret.toString());
+ return AwsBasicCredentials.create(key.toString(), secret.toString());
}
}
- private static S3BasicCredentials loadCredentials(Settings settings, String clientName) {
+ private static AwsCredentials loadCredentials(Settings settings, String clientName) {
try (
SecureString accessKey = getConfigValue(settings, clientName, ACCESS_KEY_SETTING);
SecureString secretKey = getConfigValue(settings, clientName, SECRET_KEY_SETTING);
@@ -409,9 +411,9 @@ private static S3BasicCredentials loadCredentials(Settings settings, String clie
if (accessKey.length() != 0) {
if (secretKey.length() != 0) {
if (sessionToken.length() != 0) {
- return new S3BasicSessionCredentials(accessKey.toString(), secretKey.toString(), sessionToken.toString());
+ return AwsSessionCredentials.create(accessKey.toString(), secretKey.toString(), sessionToken.toString());
} else {
- return new S3BasicCredentials(accessKey.toString(), secretKey.toString());
+ return AwsBasicCredentials.create(accessKey.toString(), secretKey.toString());
}
} else {
throw new IllegalArgumentException("Missing secret key for s3 client [" + clientName + "]");
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3Repository.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3Repository.java
index 117b4f009ec03..954b79035429f 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3Repository.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3Repository.java
@@ -156,12 +156,6 @@ class S3Repository extends MeteredBlobStoreRepository {
new ByteSizeValue(5, ByteSizeUnit.TB)
);
- /**
- * When set to true metadata files are stored in compressed format. This setting doesn’t affect index
- * files that are already compressed by default. Defaults to false.
- */
- static final Setting COMPRESS_SETTING = Setting.boolSetting("compress", false);
-
/**
* Sets the S3 storage class type for the backup files. Values may be standard, reduced_redundancy,
* standard_ia, onezone_ia and intelligent_tiering. Defaults to standard.
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java
index a52e05d94fa95..828bf85fd7889 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java
@@ -32,8 +32,6 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.util.json.Jackson;
-import org.opensearch.SpecialPermission;
import org.opensearch.cluster.metadata.RepositoryMetadata;
import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.settings.Setting;
@@ -48,8 +46,6 @@
import java.io.IOException;
import java.nio.file.Path;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -61,22 +57,6 @@
*/
public class S3RepositoryPlugin extends Plugin implements RepositoryPlugin, ReloadablePlugin {
- static {
- SpecialPermission.check();
- AccessController.doPrivileged((PrivilegedAction) () -> {
- try {
- // kick jackson to do some static caching of declared members info
- Jackson.jsonNodeOf("{}");
- // ClientConfiguration clinit has some classloader problems
- // TODO: fix that
- Class.forName("com.amazonaws.ClientConfiguration");
- } catch (final ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- return null;
- });
- }
-
protected final S3Service service;
private final Path configPath;
@@ -124,6 +104,7 @@ public List> getSettings() {
S3ClientSettings.SESSION_TOKEN_SETTING,
S3ClientSettings.ENDPOINT_SETTING,
S3ClientSettings.PROTOCOL_SETTING,
+ S3ClientSettings.PROXY_TYPE_SETTING,
S3ClientSettings.PROXY_HOST_SETTING,
S3ClientSettings.PROXY_PORT_SETTING,
S3ClientSettings.PROXY_USERNAME_SETTING,
diff --git a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java
index 477b5ab9cceeb..e4c0089fdbe69 100644
--- a/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java
+++ b/plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RetryingInputStream.java
@@ -31,22 +31,24 @@
package org.opensearch.repositories.s3;
-import com.amazonaws.AmazonClientException;
-import com.amazonaws.services.s3.model.AmazonS3Exception;
-import com.amazonaws.services.s3.model.GetObjectRequest;
-import com.amazonaws.services.s3.model.ObjectMetadata;
-import com.amazonaws.services.s3.model.S3Object;
-import com.amazonaws.services.s3.model.S3ObjectInputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
+import org.opensearch.common.collect.Tuple;
import org.opensearch.common.util.io.IOUtils;
+import org.opensearch.repositories.s3.utils.HttpRangeUtils;
+import software.amazon.awssdk.core.ResponseInputStream;
+import software.amazon.awssdk.core.exception.SdkException;
+import software.amazon.awssdk.services.s3.model.GetObjectRequest;
+import software.amazon.awssdk.services.s3.model.GetObjectResponse;
+import software.amazon.awssdk.services.s3.model.S3Exception;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.NoSuchFileException;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* Wrapper around an S3 object that will retry the {@link GetObjectRequest} if the download fails part-way through, resuming from where
@@ -68,7 +70,8 @@ class S3RetryingInputStream extends InputStream {
private final int maxAttempts;
private final List