-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "elasticstack_elasticsearch_script Resource - terraform-provider-elasticstack" | ||
subcategory: "" | ||
description: |- | ||
Creates or updates a stored script or search template. See https://www.elastic.co/guide/en/elasticsearch/reference/current/create-stored-script-api.html | ||
--- | ||
|
||
# elasticstack_elasticsearch_script (Resource) | ||
|
||
Creates or updates a stored script or search template. See https://www.elastic.co/guide/en/elasticsearch/reference/current/create-stored-script-api.html | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "elasticstack" { | ||
elasticsearch {} | ||
} | ||
resource "elasticstack_elasticsearch_script" "my_script" { | ||
script_id = "my_script" | ||
source = "Math.log(_score * 2) + params['my_modifier']" | ||
context = "score" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `script_id` (String) Identifier for the stored script. Must be unique within the cluster. | ||
- `source` (String) For scripts, a string containing the script. For search templates, an object containing the search template. | ||
|
||
### Optional | ||
|
||
- `context` (String) Context in which the script or search template should run. | ||
- `elasticsearch_connection` (Block List, Max: 1) Used to establish connection to Elasticsearch server. Overrides environment variables if present. (see [below for nested schema](#nestedblock--elasticsearch_connection)) | ||
- `lang` (String) Script language. For search templates, use `mustache`. Defaults to `painless`. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--elasticsearch_connection"></a> | ||
### Nested Schema for `elasticsearch_connection` | ||
|
||
Optional: | ||
|
||
- `api_key` (String, Sensitive) API Key to use for authentication to Elasticsearch | ||
- `ca_data` (String) PEM-encoded custom Certificate Authority certificate | ||
- `ca_file` (String) Path to a custom Certificate Authority certificate | ||
- `endpoints` (List of String, Sensitive) A list of endpoints the Terraform provider will point to. They must include the http(s) schema and port number. | ||
- `insecure` (Boolean) Disable TLS certificate validation | ||
- `password` (String, Sensitive) A password to use for API authentication to Elasticsearch. | ||
- `username` (String) A username to use for API authentication to Elasticsearch. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import elasticstack_elasticsearch_script.my_script <cluster_uuid>/<script id> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import elasticstack_elasticsearch_script.my_script <cluster_uuid>/<script id> |
9 changes: 9 additions & 0 deletions
9
examples/resources/elasticstack_elasticsearch_script/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
provider "elasticstack" { | ||
elasticsearch {} | ||
} | ||
|
||
resource "elasticstack_elasticsearch_script" "my_script" { | ||
script_id = "my_script" | ||
source = "Math.log(_score * 2) + params['my_modifier']" | ||
context = "score" | ||
} |