Skip to content

Commit d027f42

Browse files
committed
Generate docs for script resource
1 parent c76a508 commit d027f42

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "elasticstack_elasticsearch_script Resource - terraform-provider-elasticstack"
4+
subcategory: ""
5+
description: |-
6+
Creates or updates a stored script or search template. See https://www.elastic.co/guide/en/elasticsearch/reference/current/create-stored-script-api.html
7+
---
8+
9+
# elasticstack_elasticsearch_script (Resource)
10+
11+
Creates or updates a stored script or search template. See https://www.elastic.co/guide/en/elasticsearch/reference/current/create-stored-script-api.html
12+
13+
## Example Usage
14+
15+
```terraform
16+
provider "elasticstack" {
17+
elasticsearch {}
18+
}
19+
20+
resource "elasticstack_elasticsearch_script" "my_script" {
21+
script_id = "my_script"
22+
source = "Math.log(_score * 2) + params['my_modifier']"
23+
context = "score"
24+
}
25+
```
26+
27+
<!-- schema generated by tfplugindocs -->
28+
## Schema
29+
30+
### Required
31+
32+
- `script_id` (String) Identifier for the stored script. Must be unique within the cluster.
33+
- `source` (String) For scripts, a string containing the script. For search templates, an object containing the search template.
34+
35+
### Optional
36+
37+
- `context` (String) Context in which the script or search template should run.
38+
- `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))
39+
- `lang` (String) Script language. For search templates, use `mustache`. Defaults to `painless`.
40+
- `params` (String) Parameters for the script or search template.
41+
42+
### Read-Only
43+
44+
- `id` (String) The ID of this resource.
45+
46+
<a id="nestedblock--elasticsearch_connection"></a>
47+
### Nested Schema for `elasticsearch_connection`
48+
49+
Optional:
50+
51+
- `api_key` (String, Sensitive) API Key to use for authentication to Elasticsearch
52+
- `ca_data` (String) PEM-encoded custom Certificate Authority certificate
53+
- `ca_file` (String) Path to a custom Certificate Authority certificate
54+
- `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.
55+
- `insecure` (Boolean) Disable TLS certificate validation
56+
- `password` (String, Sensitive) A password to use for API authentication to Elasticsearch.
57+
- `username` (String) A username to use for API authentication to Elasticsearch.
58+
59+
## Import
60+
61+
Import is supported using the following syntax:
62+
63+
```shell
64+
terraform import elasticstack_elasticsearch_script.my_script <cluster_uuid>/<script id>
65+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import elasticstack_elasticsearch_script.my_script <cluster_uuid>/<script id>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
}
4+
5+
resource "elasticstack_elasticsearch_script" "my_script" {
6+
script_id = "my_script"
7+
source = "Math.log(_score * 2) + params['my_modifier']"
8+
context = "score"
9+
}

0 commit comments

Comments
 (0)