--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "opensearch_component_template Resource - terraform-provider-opensearch" subcategory: "" description: |- Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. You cannot directly apply a component template to a data stream or index. To be applied, a component template must be included in an index template’s composed_of list. --- # opensearch_component_template (Resource) Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. You cannot directly apply a component template to a data stream or index. To be applied, a component template must be included in an index template’s `composed_of` list. ## Example Usage ```terraform resource "opensearch_component_template" "test" { name = "terraform-test" body = < ## Schema ### Required - `body` (String) The JSON body of the template. - `name` (String) Name of the component template to create. ### Read-Only - `id` (String) The ID of this resource. ## Import Import is supported using the following syntax: ```shell # Import by name terraform import opensearch_component_template.test terraform-test ```