Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service role name AWSServiceRoleForAmazonElasticsearchService has been taken in this account #5

Closed
stormlcc opened this issue Jun 26, 2020 · 8 comments

Comments

@stormlcc
Copy link

If the service role already existed in the account, the error will occur.
Error: Error creating service-linked role with name es.amazonaws.com: InvalidInput: Service role name AWSServiceRoleForAmazonElasticsearchService has been taken in this account, please try a different suffix.

@lgallard
Copy link
Owner

@stormlcc are you deploying several AWS ElasticSearch in the same account? I tried to include a custom prefix using the custom_prefix property as described in the resource documentation for Service Roles, but some services don't support it like AWS ElasticSearch Service :(

@stormlcc
Copy link
Author

@lgallard yeah i already have 1 AWS Elasticsearch deployed. I want to deploy another 1 in the same account.
There are others who encountered the same problem (albeit from a different codebase) such as this:
https://github.com/cloudposse/terraform-aws-elasticsearch/issues/5
I prefer using yours because it is well defined and not too complicated for me to modify it.

Thanks!

@lgallard
Copy link
Owner

@stormlcc I'm working in the fix!

@lgallard lgallard reopened this Jun 26, 2020
@lgallard
Copy link
Owner

@stormlcc version 0.3.0 has the fix.

@lgallard
Copy link
Owner

lgallard commented Jun 26, 2020

Set the create_service_link_role variable to false for the additional AWS ElasticSearch clusters.


module "aws_es2" {

  source  = "lgallard/elasticsearch/aws"
  version = "0.3.0"
 
  domain_name              = var.es_domain_name2
  elasticsearch_version    = var.es_version
  create_service_link_role = false

...
}

@stormlcc
Copy link
Author

@lgallard
Thank you very much! Tested it and verified that it works perfectly.

@lgallard
Copy link
Owner

@stormlcc for reporting the issue and your feedback!

@simonweil
Copy link

I got this too just now...
@lgallard, perhaps you can add a note about it in the readme so the solution is more prominent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants