From a72cde21ef48cbcbb582cbc89b1b92899899f083 Mon Sep 17 00:00:00 2001 From: disaster37 Date: Thu, 7 Nov 2019 13:26:47 +0000 Subject: [PATCH 1/4] Fix go mod module name --- go.mod | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 369f0957..4ab19675 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/disaster37/terraform-provider-elasticsearch +module github.com/disaster37/terraform-provider-elasticsearch/v7 go 1.12 diff --git a/main.go b/main.go index dba7f891..0ecade90 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,7 @@ Read the doc to use it: https://github.com/disaster37/terraform-provider-elastic package main import ( - "github.com/disaster37/terraform-provider-elasticsearch/es" + "github.com/disaster37/terraform-provider-elasticsearch/v7/es" "github.com/hashicorp/terraform-plugin-sdk/plugin" ) From dce3592c501f36135ab5f96440539ca0cd088b1c Mon Sep 17 00:00:00 2001 From: disaster37 Date: Thu, 7 Nov 2019 13:28:55 +0000 Subject: [PATCH 2/4] Upgrade to ES 7.4.2 on circleci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ffca85c..3a00c5b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: - ELASTICSEARCH_URLS: "http://es:9200" - ELASTICSEARCH_USERNAME: "elastic" - ELASTICSEARCH_PASSWORD: "changeme" - - image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0 + - image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2 name: es environment: - cluster.name: "test" From 087572b61524f2109bd1c718b6af955c19bd2cbb Mon Sep 17 00:00:00 2001 From: disaster37 Date: Fri, 20 Dec 2019 15:32:48 +0000 Subject: [PATCH 3/4] add retention parameter on slm --- README.md | 27 ++++++++++++------- ...elasticsearch_snapshot_lifecycle_policy.go | 8 ++++++ ...icsearch_snapshot_lifecycle_policy_test.go | 14 ++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e3cff445..f9fec53a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ We fork this project for the following items: ## Installation -[Download a binary](https://github.com/phillbaker/terraform-provider-elasticsearch/releases), and put it in a good spot on your system. Then update your `~/.terraformrc` to refer to the binary: +[Download a binary](https://github.com/disaster37/terraform-provider-elasticsearch/releases), and put it in a good spot on your system. Then update your `~/.terraformrc` to refer to the binary: ```hcl providers { @@ -66,7 +66,7 @@ You can see the API documentation: https://www.elastic.co/guide/en/elasticsearch ***Sample:*** ```tf -resource "elasticsearch_role" "test" { +resource elasticsearch_role "test" { name = "terraform-test" indices { names = ["logstash-*"] @@ -114,7 +114,7 @@ You can see the API documentation: https://www.elastic.co/guide/en/elasticsearch ***Sample***: ```tf -resource "elasticsearch_role_mapping" "test" { +resource elasticsearch_role_mapping "test" { name = "terraform-test" enabled = "true" roles = ["superuser"] @@ -149,7 +149,7 @@ You can see the API documenation: https://www.elastic.co/guide/en/elasticsearch/ ***Sample:*** ```tf -resource "elasticsearch_user" "test" { +resource elasticsearch_user "test" { username = "terraform-test" enabled = "true" email = "no@no.no" @@ -182,7 +182,7 @@ You can see the API documentation: https://www.elastic.co/guide/en/elasticsearch ***Sample:*** ```tf -resource "elasticsearch_index_lifecycle_policy" "test" { +resource elasticsearch_index_lifecycle_policy "test" { name = "terraform-test" policy = < Date: Fri, 20 Dec 2019 16:10:30 +0000 Subject: [PATCH 4/4] Upgrade to Elasticsearch 7.5 --- .circleci/config.yml | 2 +- es/resource_elasticsearch_snapshot_lifecycle_policy_test.go | 2 +- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a00c5b1..4cd264b6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: - ELASTICSEARCH_URLS: "http://es:9200" - ELASTICSEARCH_USERNAME: "elastic" - ELASTICSEARCH_PASSWORD: "changeme" - - image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2 + - image: docker.elastic.co/elasticsearch/elasticsearch:7.5.1 name: es environment: - cluster.name: "test" diff --git a/es/resource_elasticsearch_snapshot_lifecycle_policy_test.go b/es/resource_elasticsearch_snapshot_lifecycle_policy_test.go index 375fd3cd..da1d0b1b 100644 --- a/es/resource_elasticsearch_snapshot_lifecycle_policy_test.go +++ b/es/resource_elasticsearch_snapshot_lifecycle_policy_test.go @@ -39,7 +39,7 @@ func TestAccElasticsearchSnapshotLifecyclePolicy(t *testing.T) { ResourceName: "elasticsearch_snapshot_lifecycle_policy.test", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"configs"}, + ImportStateVerifyIgnore: []string{"configs", "retention"}, }, }, }) diff --git a/go.mod b/go.mod index 4ab19675..8cabe7f2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/disaster37/terraform-provider-elasticsearch/v7 go 1.12 require ( - github.com/elastic/go-elasticsearch/v7 v7.4.1 + github.com/elastic/go-elasticsearch/v7 v7.5.0 github.com/hashicorp/terraform-plugin-sdk v1.1.1 github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/pkg/errors v0.8.1 diff --git a/go.sum b/go.sum index d2d32c4c..f2eabdac 100644 --- a/go.sum +++ b/go.sum @@ -83,6 +83,8 @@ github.com/elastic/go-elasticsearch/v7 v7.4.0 h1:3gLL9l1hazy0ZYLpSoD40Z7hpuYvKlL github.com/elastic/go-elasticsearch/v7 v7.4.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elastic/go-elasticsearch/v7 v7.4.1 h1:Kd/cwKNF5+tABpJ0t39Aucvb5QtYc8RAzy4nwVn1NnM= github.com/elastic/go-elasticsearch/v7 v7.4.1/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= +github.com/elastic/go-elasticsearch/v7 v7.5.0 h1:kXW+EKls2BwsyQujTmVrxANb3U0qoz9wEq8Zkf/JEco= +github.com/elastic/go-elasticsearch/v7 v7.5.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=