Elasticsearch version: 5.2
Plugins installed: [repository-s3]
JVM version:
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode
OS version: CentOS Linux release 7.3.1611 (Core)
Description of the problem including expected versus actual behavior:
I am using repository-s3 with aws instance profile, but got Access Denied error with http code 500.
Here are the command and output:
[root@ip-10-99-3-140 bin]# curl -XPUT '10.99.3.140:9200/_snapshot/my_s3_repository_3?pretty' -H 'Content-Type: application/json' -d'
{
"type": "s3",
"settings": {
"bucket": "elasticsearchbucket-14lu5ab5ncv3a",
"region": "us-west-2"
}
}'
{
"error" : {
"root_cause" : [
{
"type" : "repository_verification_exception",
"reason" : "[my_s3_repository_3] path is not accessible on master node"
}
],
"type" : "repository_verification_exception",
"reason" : "[my_s3_repository_3] path is not accessible on master node",
"caused_by" : {
"type" : "i_o_exception",
"reason" : "Unable to upload object tests-NxZaN5PAQOOZH7c528Krrg/master.dat-temp",
"caused_by" : {
"type" : "amazon_s3_exception",
"reason" : "Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 99B74F2EF8BBBD0C)"
}
}
},
"status" : 500
}
The ec2 instance has the iam role and policies for accessing this bucket:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::elasticsearchbucket-14lu5ab5ncv3a/*",
"arn:aws:s3:::elasticsearchbucket-14lu5ab5ncv3a"
],
"Effect": "Allow"
}
]
}
Logs can be seen from here: https://github.com/elastic/elasticsearch/issues/23780
I want to know how to get it working.