### Elasticsearch Version

8.3.1

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Linux 5.4.196-108.356.amzn2.x86_64

### Problem Description

Elasticsearch in EKS does not honour `eks.amazonaws.com/sts-regional-endpoints=true` for IAM access with AWS regions. It always sends it's API calls to `us-east-1`.

### Steps to Reproduce

Deploy Elasticsearch in EKS using operator with the following env
```
          containers:
            - env:
                - name: AWS_ROLE_SESSION_NAME
                  value: snapshot-repo
                - name: ZONE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.annotations['topology.kubernetes.io/zone']
```

Create service account with the annotations
```
  annotations:
    eks.amazonaws.com/role-arn: redacted
    eks.amazonaws.com/sts-regional-endpoints: "true"
```

Create snapshot repo
```
PUT _snapshot/s3backup
{
    "type": "s3",
    "settings": {
      "bucket": "redacted",
      "server_side_encryption": "true",
      "max_restore_bytes_per_sec": "500mb",
      "storage_class": "intelligent_tiering",
      "use_throttle_retries": "true",
      "readonly": "false",
      "base_path": "snapshot",
      "region": "us-west-2",
      "max_snapshot_bytes_per_sec": "500mb",
      "endpoint": "s3.us-west-2.amazonaws.com"
  }
}
```

Run snapshot

View cloudtrail events for service account name
![2022-08-08_11-36-48](https://user-images.githubusercontent.com/64858237/183456721-db86153c-ccc3-4821-8c84-f8c85cb4e495.png)


### Logs (if relevant)

_No response_
modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/CustomWebIdentityTokenCredentialsProviderTests.java
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
public class CustomWebIdentityTokenCredentialsProviderTests extends ESTestCase {
    private static final String ROLE_ARN = "arn:aws:iam::123456789012:role/FederatedWebIdentityRole";
    private static final String ROLE_NAME = "aws-sdk-java-1651084775908";
    @SuppressForbidden(reason = "HTTP server is used for testing")
    public void testCreateWebIdentityTokenCredentialsProvider() throws Exception {
        HttpServer httpServer = MockHttpServer.createHttp(new InetSocketAddress(InetAddress.getLoopbackAddress().getHostAddress(), 0), 0);
        httpServer.createContext("/", exchange -> {
            try (exchange) {
                String body = new String(exchange.getRequestBody().readAllBytes(), StandardCharsets.UTF_8);
                Map<String, String> params = Arrays.stream(body.split("&"))
                    .map(e -> e.split("="))
                    .collect(Collectors.toMap(e -> e[0], e -> URLDecoder.decode(e[1], StandardCharsets.UTF_8)));
                assertEquals(ROLE_NAME, params.get("RoleSessionName"));
                exchange.getResponseHeaders().add("Content-Type", "text/xml; charset=UTF-8");
                byte[] response = Strings.format(
                    """
                        <AssumeRoleWithWebIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
                          <AssumeRoleWithWebIdentityResult>
                            <SubjectFromWebIdentityToken>amzn1.account.AF6RHO7KZU5XRVQJGXK6HB56KR2A</SubjectFromWebIdentityToken>
                            <Audience>client.5498841531868486423.1548@apps.example.com</Audience>
                            <AssumedRoleUser>
                              <Arn>%s</Arn>
                              <AssumedRoleId>AROACLKWSDQRAOEXAMPLE:%s</AssumedRoleId>
                            </AssumedRoleUser>