forked from phillbaker/terraform-provider-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Upgrade to Elasticsearch 8.4.1 (#15)
* fix: migrate to es-handler instead to wrap all api call. Fix so many little bugs. Signed-off-by: langoureaux-s <[email protected]> * feat: upgrade do elasticsearch 8.4.1 and add golangci-lint step Signed-off-by: langoureaux-s <[email protected]> * fix: Add acctest form elasticsearch_data_stream ressource Signed-off-by: langoureaux-s <[email protected]> * fix: Add forget tests and documentation Signed-off-by: langoureaux-s <[email protected]> * fix: fix github workflow Signed-off-by: langoureaux-s <[email protected]> * fix: bump to es-handler 8.0.2 Signed-off-by: langoureaux-s <[email protected]> Signed-off-by: langoureaux-s <[email protected]> Co-authored-by: langoureaux-s <[email protected]>
- Loading branch information
1 parent
dd57f51
commit b122f51
Showing
53 changed files
with
1,707 additions
and
2,278 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 |
---|---|---|
|
@@ -22,17 +22,24 @@ jobs: | |
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.17" | ||
go-version: "1.18" | ||
- name: Setup Elasticsearch | ||
run: | | ||
set -e | ||
docker-compose up & | ||
until $(curl --output /dev/null --silent --head --fail -u elastic:changeme http://localhost:9200); do sleep 5; done | ||
curl -XPOST -u elastic:changeme http://localhost:9200/_license/start_trial?acknowledge=true | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
args: --timeout 600s | ||
- name: Run build | ||
run: make build | ||
- name: Run acceptance tests | ||
run: ELASTICSEARCH_URLS="http://localhost:9200" ELASTICSEARCH_USERNAME="elastic" ELASTICSEARCH_PASSWORD="changeme" make testacc | ||
run: | | ||
mv es/resource_elasticsearch_license_test.go es/resource_elasticsearch_license_test.go.disable | ||
ELASTICSEARCH_URLS="http://localhost:9200" ELASTICSEARCH_USERNAME="elastic" ELASTICSEARCH_PASSWORD="changeme" make testacc | ||
- name: Run acceptance test on license resource | ||
run: | | ||
set -e | ||
|
@@ -58,7 +65,7 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
go-version: 1.18 | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: paultyng/[email protected] | ||
|
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
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
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
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,28 @@ | ||
# elasticsearch_data_stream | ||
|
||
This resource permit to manage the index data stream in Elasticsearch. | ||
You can see the API documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/data-stream-apis.html | ||
|
||
***Supported Elasticsearch version:*** | ||
- v8 | ||
|
||
## Example Usage | ||
|
||
It will create data stream index. | ||
|
||
> You need to have index template with `data_sream` that match your index before to create data stream index. | ||
```tf | ||
resource elasticsearch_data_stream "test" { | ||
name = "terraform-test" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
***The following arguments are supported:*** | ||
- **name**: (required) The data stream index name. | ||
|
||
## Attribute Reference | ||
|
||
NA |
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
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
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
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
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,41 @@ | ||
# elasticsearch_ingest_pipeline Resource Source | ||
|
||
This resource permit to manage the ingest pipeline in Elasticsearch. | ||
You can see the API documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-apis.html | ||
|
||
***Supported Elasticsearch version:*** | ||
- v8 | ||
|
||
## Example Usage | ||
|
||
It will create ingest pipeline. | ||
|
||
```tf | ||
resource elasticsearch_ingest_pipeline "test" { | ||
name = "terraform-test" | ||
pipeline = <<EOF | ||
{ | ||
"description" : "My optional pipeline description", | ||
"processors" : [ | ||
{ | ||
"set" : { | ||
"description" : "My optional processor description", | ||
"field": "my-keyword-field", | ||
"value": "foo" | ||
} | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
***The following arguments are supported:*** | ||
- **name**: (required) Identifier for the ingest pipeline. | ||
- **pipeline**: (required) The pipeline specification. It's a string as JSON object. | ||
|
||
## Attribute Reference | ||
|
||
NA |
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
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
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
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
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
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,74 @@ | ||
# elasticsearch_transform Resource Source | ||
|
||
This resource permit to manage the transform in Elasticsearch. | ||
You can see the API documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-apis.html | ||
|
||
***Supported Elasticsearch version:*** | ||
- v8 | ||
|
||
## Example Usage | ||
|
||
It will create transform. | ||
|
||
```tf | ||
resource "elasticsearch_transform" "test" { | ||
name = "terraform-test-transform" | ||
transform = <<EOF | ||
{ | ||
"source": { | ||
"index": ["ecs-*"], | ||
"query": { | ||
"term": { | ||
"geoip.continent_name": { | ||
"value": "Asia" | ||
} | ||
} | ||
} | ||
}, | ||
"pivot": { | ||
"group_by": { | ||
"customer_id": { | ||
"terms": { | ||
"field": "customer_id" | ||
} | ||
} | ||
}, | ||
"aggregations": { | ||
"max_price": { | ||
"max": { | ||
"field": "taxful_total_price" | ||
} | ||
} | ||
} | ||
}, | ||
"description": "Maximum priced ecommerce data by customer_id in Asia", | ||
"dest": { | ||
"index": "kibana_sample_data_ecommerce_transform1" | ||
}, | ||
"frequency": "5m", | ||
"sync": { | ||
"time": { | ||
"field": "order_date", | ||
"delay": "60s" | ||
} | ||
}, | ||
"retention_policy": { | ||
"time": { | ||
"field": "order_date", | ||
"max_age": "30d" | ||
} | ||
} | ||
} | ||
EOF | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
***The following arguments are supported:*** | ||
- **name**: (required) Identifier for the transform. | ||
- **transform**: (required) The transform specification. It's a string as JSON object. | ||
|
||
## Attribute Reference | ||
|
||
NA |
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
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
Oops, something went wrong.