cloudposse / terraform-aws-elasticsearch

Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash.
https://cloudposse.com/accelerate
Apache License 2.0
218 stars 231 forks source link

Add var.create_elasticsearch_user_role #161

Closed mohamed-essam closed 1 year ago

mohamed-essam commented 1 year ago

what

why

references

closes #160

aknysh commented 1 year ago

@mohamed-essam thanks for the PR. Please make a few changes:

  1. The resource data "aws_iam_policy_document" "assume_role" in https://github.com/cloudposse/terraform-aws-elasticsearch/blob/master/main.tf#L84 is only needed if we create resource "aws_iam_role" "elasticsearch_user". Please add the same logic in the count as you added for resource "aws_iam_role" "elasticsearch_user"

  2. In https://github.com/cloudposse/terraform-aws-elasticsearch/blob/master/main.tf#L258, change it to

identifiers = distinct(compact(concat(var.iam_role_arns, aws_iam_role.elasticsearch_user[*].arn)))

to use the splat expression https://developer.hashicorp.com/terraform/language/expressions/splat

  1. Please run the following commands from the root of the repo and commit the changes:
make init
make github/init
make readme

Thank you

mohamed-essam commented 1 year ago

@aknysh I couldn't find exact documentation on the steps required for contribution (I saw make readme in a comment in README.md), would it be possible to add these steps in a CONTRIBUTING.md file or in the README?

aknysh commented 1 year ago

nice point, we should add it, thanks

aknysh commented 1 year ago

/test all