Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

es:CreateElasticsearchServiceRole missing from Elasticsearch service actions #163

Closed
andywickersham opened this issue Dec 3, 2019 · 4 comments

Comments

@andywickersham
Copy link

The Elasticsearch documentation is missing the "es:CreateElasticsearchServiceRole" action which is required when creating a new Elasticsearch domain.

Documentation URL:
https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonelasticsearchservice.html

@jsoncow
Copy link

jsoncow commented Dec 3, 2019

Hi Andy!

To create a ServiceRole for Elasticsearch, this is tied to the IAM action iam:CreateServiceLinkedRole.

It's interesting. There is es:DeleteElasticsearchServiceRole for a manual deletion of the ES Service Role, but the create is handled by an API action that falls under the broader IAM service umbrella.

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/slr-es.html

@andywickersham
Copy link
Author

andywickersham commented Dec 4, 2019

This is the CloudTrail error:
User: arn:aws:sts::[ACCOUNT ID]:assumed-role/SecurityOperations/[USER] is not authorized to perform: es:CreateElasticsearchServiceRole on resource: arn:aws:es:us-east-1:[ACCOUNT ID]:domain/*

This is the IAM policy statement that fixed it:
Sid: AllowESRoleCreate Effect: Allow Action: es:CreateElasticsearchServiceRole Resource: !Sub 'arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/*/*'

@jsoncow
Copy link

jsoncow commented Dec 4, 2019

Interesting!

You're right. I see it in my CloudTrail as well now.

@aws, this should be fixed in the ES User Guide as well. https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/slr-es.html

@bonniekeller
Copy link
Contributor

Thank you for bringing this to our attention. The information on this page https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonelasticsearchservice.html is generated automatically with information provided by the Elastic Search team. I've cut the Elastic Search service team a ticket to review your issue. Someone from the service team will get back to you about this issue.

@ericthoj ericthoj closed this as completed Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants