cloudposse/terraform-aws-elasticsearch

Cannot create 2 elasticsearch insatnces in the same account

ByJacob opened this issue · 1 comments

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

module.elasticsearch.aws_iam_service_linked_role.default[0]: Creating...
Releasing state lock. This may take a few moments...

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.
        status code: 400, request id: 033695e1-3d76-46e8-a102-8d9313b35a91

  on ../../modules/elasticsearch/main.tf line 61, in resource "aws_iam_service_linked_role" "default":
  61: resource "aws_iam_service_linked_role" "default" {

Expected Behavior

Second es instance are created

Steps to Reproduce

Steps to reproduce the behavior:

  1. create 1 es instance using this module
  2. try create second es instance using this module

Screenshots

If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: linux
  • Version newest

Additional Context

Add any other context about the problem here.

@ByJacob you can fix this issue by utilizing the create_iam_service_linked_role variable and setting it to false in all ElasticSearch module usages but the first. Closing out as this should be addressed via that solution. Thanks!