AWS IAM role not working with Elasticsearch 5.0.0-alpha2, but works with 2.3 version
I am trying to use AWS IAM role with Elasticsearch 5.0.0-alpha2 and EC2 discovery plug-in, but it does not seem to be working and I am getting below error:
"Exception while retrieving instance list from AWS API: Authorization header or parameters are not formatted correctly. (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure"
However, same configuration works fine with with Elasticsearch 2.3 version. Has anyone faced the same issue with the latest Elasticsearch version 5.0.0-alpha2?
Thanks for response David. discovery.ec2.groups is not empty. It is security group id e.g. sg-9d856tfe.
I am using security group for clustering so that instances belonging to same security group can be clustered. For your information, same configuration works if I provide access_key and secret_access_key.
Therefore, I feel problem happens when plugin is trying to fetch instance list while making AWS API call and its not using IAM role for this purpose. As per documentation, plug-in always tries to use IAM role first and if IAM role is not available, then only it should look for access_key and secret_access_key and my elasticsearch instance is associated with IAM role with correct permission to fetch the instance list. This works fine 2.3 version with IAM role.
As you suggested, I will remove below lines and try - but I am not sure if it will solve the problem that I am facing.
discovery.ec2.any_group: true
discovery.ec2.groups : sg-9d856tfe
Please let me know, if you need more info. Thanks!
Seems it got fixed now. However, I am not able to test this. I have removed the discovery-ec2 plug-in and installed again(as shown below), but getting the same error.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.