### 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/main/java/org/elasticsearch/repositories/s3/S3Service.java
+ "in the config directory"
                );
                return;
            }
            if (Files.isReadable(webIdentityTokenFileSymlink) == false) {
                throw new IllegalStateException("Unable to read a Web Identity Token symlink in the config directory");
            }
            String roleArn = systemEnvironment.getEnv(AWS_ROLE_ARN_ENV_VAR);
            if (roleArn == null) {
                LOGGER.warn(
                    "Unable to use a web identity token for authentication. The AWS_WEB_IDENTITY_TOKEN_FILE environment "
                        + "variable is set, but either AWS_ROLE_ARN is missing"
                );
                return;
            }
            String roleSessionName = Objects.requireNonNullElseGet(
                systemEnvironment.getEnv(AWS_ROLE_SESSION_NAME_ENV_VAR),
                
                
                () -> "aws-sdk-java-" + clock.millis()
            );
            AWSSecurityTokenServiceClientBuilder stsClientBuilder = AWSSecurityTokenServiceClient.builder();
            
            String customStsEndpoint = jvmEnvironment.getProperty("com.amazonaws.sdk.stsMetadataServiceEndpointOverride", STS_HOSTNAME);
            
            stsClientBuilder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(customStsEndpoint, null));
            stsClientBuilder.withCredentials(new AWSStaticCredentialsProvider(new AnonymousAWSCredentials()));
            stsClient = SocketAccess.doPrivileged(stsClientBuilder::build);
            try {
                credentialsProvider = new STSAssumeRoleWithWebIdentitySessionCredentialsProvider.Builder(