diff --git a/modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java b/modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java index 4f4eb24b5a9ca..b4279f8f0b07c 100644 --- a/modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java +++ b/modules/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java @@ -645,7 +645,9 @@ public void handle(final HttpExchange exchange) throws IOException { assertTrue( isValidAwsV4SignedAuthorizationHeader( "test_access_key", - Objects.requireNonNullElse(region, "us-east-1"), + // If unset, the region used by the SDK is usually going to be `us-east-1` but sometimes these tests run on bare EC2 + // machines and the SDK picks up the region from the IMDS there, so for now we use '*' to skip validation. + Objects.requireNonNullElse(region, "*"), "s3", exchange.getRequestHeaders().getFirst("Authorization") )