--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "opensearch_script Resource - terraform-provider-opensearch" subcategory: "" description: |- Provides an Opensearch script resource. --- # opensearch_script (Resource) Provides an Opensearch script resource. ## Example Usage ```terraform # Create a script resource "opensearch_script" "test_script" { script_id = "my_script" lang = "painless" source = "Math.log(_score * 2) + params.my_modifier" } ``` ## Schema ### Required - `script_id` (String) Identifier for the stored script. Must be unique within the cluster. - `source` (String) The source of the stored script ### Optional - `lang` (String) Specifies the language the script is written in. Defaults to painless. ### Read-Only - `id` (String) The ID of this resource. ## Import Import is supported using the following syntax: ```shell terraform import opensearch_script.test_script my_script ```