--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "opensearch_roles_mapping Resource - terraform-provider-opensearch" subcategory: "" description: |- Provides an OpenSearch security role mapping. Please refer to the OpenSearch Access Control documentation for details. --- # opensearch_roles_mapping (Resource) Provides an OpenSearch security role mapping. Please refer to the OpenSearch Access Control documentation for details. ## Example Usage ```terraform # Create a role mapping resource "opensearch_roles_mapping" "mapper" { role_name = "logs_writer" description = "Mapping AWS IAM roles to ES role" backend_roles = [ "arn:aws:iam::123456789012:role/lambda-call-opensearch", "arn:aws:iam::123456789012:role/run-containers", ] } ``` ## Schema ### Required - `role_name` (String) The name of the security role. ### Optional - `and_backend_roles` (Set of String) A list of backend roles. - `backend_roles` (Set of String) A list of backend roles. - `description` (String) Description of the role mapping. - `hosts` (Set of String) A list of host names. - `users` (Set of String) A list of users. ### Read-Only - `id` (String) The ID of this resource. ## Import Import is supported using the following syntax: ```shell terraform import opensearch_roles_mapping.mapper logs_writer ```