Skip to content

ECS Task IAM profile credentials ignored in repository-s3 plugin #26913

Closed
@JeffDownie

Description

@JeffDownie

Elasticsearch version (bin/elasticsearch --version): 5.6.2

Plugins installed: [repository-s3]

JVM version (java -version): Doesn't seem to matter

OS version (uname -a if on a Unix-like system): Doesn't seem to matter

Description of the problem including expected versus actual behavior:

When using the repository-s3 plugin from within an ECS Task that has an ECS Task IAM role
, the repository-s3 instead loads the underlying ec2 host's credentials, which appears to be contrary (or at least unexpected!), based on what is in the usage guide

Steps to reproduce:

  1. Install elasticsearch 5.6.2 on a docker container
  2. Use docker container in a task definition on AWS ECS
  3. Give task definition an IAM role with access to an s3 bucket
  4. Give EC2 instance an IAM role that denies access to s3 bucket
  5. Install repository-s3 plugin using elasticsearch-plugin install repository-s3
  6. Start elasticsearch
  7. Attempt to create a repository using as specified at https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/repository-s3-repository.html#repository-s3-repository, which fails.
  8. Note that the aws cli is, however able to access the s3 bucket from inside the container correctly (e.g., aws s3 ls s3::/<BUCKET_NAME> works).

Believed cause:

I believe I've tracked the issue down to

, which uses an InstanceProfileCredentialsProvider, rather than the DefaultAWSCredentialsProviderChain, which I would have thought would be more appropriate, unless I am missing something?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions