phillbaker / terraform-provider-elasticsearch

An elasticsearch provider for terraform
https://registry.terraform.io/providers/phillbaker/elasticsearch
Mozilla Public License 2.0
306 stars 134 forks source link

Using role write for creating multiple roles #300

Closed jay2242 closed 2 years ago

jay2242 commented 2 years ago

https://registry.terraform.io/providers/phillbaker/elasticsearch/latest/docs/resources/opensearch_role Example here creates single role, I would like to create multiple roles and later map them using "elasticsearch_opendistro_role.writer.id" , How can I do that? Thanks

phillbaker commented 2 years ago

Hi @jay2242, I'm not sure I'm understanding the question, but creating multiple resources and referencing them seems like a general practice in terraform. There are good guides on the terraform site about how to use HCL: https://learn.hashicorp.com/tutorials/terraform/count. Each role can be referenced by its own id.

jay2242 commented 2 years ago

Thanks, it worked "writer" is just a label for elasticsearch_opendistro_role