Elasticsearch s3 snapshots

Hello Team,

Is it possible to configure or change the medata service or sts service endpoint when creating s3 snapshot with InstanceProfileCredentialsProvider authentication method.

I have tried with setting the env but by default connecting to some aws ip
AWS_WEB_IDENTITY_TOKEN_FILE=http://localhost//v1/metadata

snapshot creation api

_snapshot/bel -d'{
        "type": "s3",
        "settings": {
            "endpoint": "endpoint",
            "bucket": "elasticsearch-snapshots",
            "region": "us-iad-5",
            "base_path": "elasticsearch/folder",
            "path_style_access": true
        }
}'

Error from elasticsearch

Caused by: com.amazonaws.SdkClientException: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/

The AWS SDK docs indicate that you can configure a different metadata service endpoint via the AWS_EC2_METADATA_SERVICE_ENDPOINT environment variable. I've not tried it, but seems like it's what you are looking for.

(edit: I meant to say "I've not tried it" but missed the vital word "not"!)

@DavidTurner I have tried with AWS_EC2_METADATA_SERVICE_ENDPOINT but elasticsearch is not honoring the env.

Not sure then, sorry. It's not really Elasticsearch doing anything here, we're just using the official AWS SDK.

1 Like