Skip to content

Commit 9d1dba5

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 0.5
* upstream/master: (28 commits) Update CHANGELOG.md and NOTICE Fix incorrect private link data for Azure eastus (#583) Update CHANGELOG.md and NOTICE Fix typo in GCP PSC datasource documentation (#571) Update CHANGELOG.md and NOTICE fix(deps): update module github.com/go-openapi/runtime to v0.25.0 (#564) Update CHANGELOG.md and NOTICE Utilise the migrate template API when applying changes to the deployment template id (#547) Update CHANGELOG.md and NOTICE fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.24.1 (#559) Update CHANGELOG.md and NOTICE docs: Add GCP PSC to Traffic Filter argument reference for type (#557) Update CHANGELOG.md and NOTICE chore(deps): update peterjgrainger/action-create-branch action to v2.3.0 (#560) Update CHANGELOG.md and NOTICE fix: remove strategy DiffSuppressFunc (#539) Update CHANGELOG.md and NOTICE fix(deps): update module github.com/stretchr/testify to v1.8.1 (#554) Update CHANGELOG.md and NOTICE Revert "Run acceptance tests in CI against 1.2.9 (#542)" (#553) ...
2 parents 33fb728 + baf44b8 commit 9d1dba5

25 files changed

+449
-199
lines changed

.changelog/547.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:feature
2+
resource/deployment: Utilise the template migration API to build the base update request when changing `deployment_template_id`. This results in more reliable changes between deployment templates.
3+
```

.github/workflows/branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
echo ::set-output name=BRANCH::$(echo ${BRANCH} | cut -d '.' -f1-2 | tr -d 'v')
3636
3737
- name: Create a github branch
38-
uses: peterjgrainger/action-create-branch@v2.2.0
38+
uses: peterjgrainger/action-create-branch@v2.3.0
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
4141
with:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 0.5.1 (Unreleased)
22

3+
FEATURES:
4+
5+
* resource/deployment: Utilise the template migration API to build the base update request when changing `deployment_template_id`. This results in more reliable changes between deployment templates. ([#547](https://github.com/elastic/terraform-provider-ec/issues/547))
6+
37
# 0.5.0 (Oct 12, 2022)
48

59
FEATURES:

NOTICE

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform-provider-ec
2-
Copyright 2022 Elasticsearch B.V.
2+
Copyright 2023 Elasticsearch B.V.
33

44
This product includes software developed at Elasticsearch B.V. and
55
third-party software developed by the licenses listed below.
@@ -10,6 +10,8 @@ github.com/davecgh/go-spew 0BSD
1010
github.com/agext/levenshtein Apache-2.0
1111
github.com/apparentlymart/go-textseg/v13 Apache-2.0
1212
github.com/elastic/cloud-sdk-go Apache-2.0
13+
github.com/go-logr/logr Apache-2.0
14+
github.com/go-logr/stdr Apache-2.0
1315
github.com/go-openapi/analysis Apache-2.0
1416
github.com/go-openapi/errors Apache-2.0
1517
github.com/go-openapi/jsonpointer Apache-2.0
@@ -24,6 +26,8 @@ github.com/oklog/run Apache-2.0
2426
github.com/oklog/ulid Apache-2.0
2527
github.com/opentracing/opentracing-go Apache-2.0
2628
go.mongodb.org/mongo-driver Apache-2.0
29+
go.opentelemetry.io/otel/trace Apache-2.0
30+
go.opentelemetry.io/otel Apache-2.0
2731
google.golang.org/appengine Apache-2.0
2832
google.golang.org/genproto Apache-2.0
2933
google.golang.org/grpc Apache-2.0
@@ -59,23 +63,23 @@ github.com/mitchellh/mapstructure MIT
5963
github.com/mitchellh/reflectwalk MIT
6064
github.com/stretchr/testify MIT
6165
github.com/zclconf/go-cty MIT
62-
github.com/hashicorp/go-checkpoint MPL-2.0
66+
github.com/hashicorp/errwrap MPL-2.0
67+
github.com/hashicorp/go-cleanhttp MPL-2.0
6368
github.com/hashicorp/go-uuid MPL-2.0
64-
github.com/hashicorp/hc-install MPL-2.0
69+
github.com/hashicorp/go-version MPL-2.0
6570
github.com/hashicorp/logutils MPL-2.0
66-
github.com/hashicorp/terraform-exec MPL-2.0
67-
github.com/hashicorp/terraform-plugin-log MPL-2.0
68-
github.com/hashicorp/terraform-plugin-sdk/v2 MPL-2.0
69-
github.com/hashicorp/terraform-svchost MPL-2.0
70-
github.com/hashicorp/yamux MPL-2.0
71-
github.com/hashicorp/errwrap MPL-2.0-no-copyleft-exception
72-
github.com/hashicorp/go-cleanhttp MPL-2.0-no-copyleft-exception
71+
github.com/hashicorp/go-checkpoint MPL-2.0-no-copyleft-exception
7372
github.com/hashicorp/go-multierror MPL-2.0-no-copyleft-exception
7473
github.com/hashicorp/go-plugin MPL-2.0-no-copyleft-exception
7574
github.com/hashicorp/go-version MPL-2.0-no-copyleft-exception
7675
github.com/hashicorp/hcl/v2 MPL-2.0-no-copyleft-exception
76+
github.com/hashicorp/terraform-exec MPL-2.0-no-copyleft-exception
7777
github.com/hashicorp/terraform-json MPL-2.0-no-copyleft-exception
7878
github.com/hashicorp/terraform-plugin-go MPL-2.0-no-copyleft-exception
79+
github.com/hashicorp/terraform-plugin-log MPL-2.0-no-copyleft-exception
80+
github.com/hashicorp/terraform-plugin-sdk/v2 MPL-2.0-no-copyleft-exception
7981
github.com/hashicorp/terraform-registry-address MPL-2.0-no-copyleft-exception
82+
github.com/hashicorp/terraform-svchost MPL-2.0-no-copyleft-exception
83+
github.com/hashicorp/yamux MPL-2.0-no-copyleft-exception
8084

8185
=========================================================================

build/Makefile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ endif
4242

4343
.PHONY: testacc-ci
4444
testacc-ci:
45-
@ EC_API_KEY=$(shell cat .ci/.apikey) TF_ACC_TERRAFORM_VERSION=1.2.9 $(MAKE) testacc
45+
@ EC_API_KEY=$(shell cat .ci/.apikey) $(MAKE) testacc
4646

4747
.PHONY: sweep-ci
4848
sweep-ci:

docs/data-sources/ec_gcp_private_service_connect_endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: |-
66

77
# Data Source: ec_gcp_private_service_connect_endpoint
88

9-
Use this data source to retrieve information about the Azure Private Link configuration for a given region. Further documentation on how to establish a PrivateLink connection can be found in the ESS [documentation](https://www.elastic.co/guide/en/cloud/current/ec-traffic-filtering-psc.html).
9+
Use this data source to retrieve information about the GCP Private Service Connect configuration for a given region. Further documentation on how to establish a PrivateLink connection can be found in the ESS [documentation](https://www.elastic.co/guide/en/cloud/current/ec-traffic-filtering-psc.html).
1010

1111
~> **NOTE:** This data source provides data relevant to the Elasticsearch Service (ESS) only, and should not be used for ECE.
1212

docs/resources/ec_deployment_traffic_filter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ resource "ec_deployment_traffic_filter" "gcp_psc" {
143143
The following arguments are supported:
144144

145145
* `name` - (Required) Name of the ruleset.
146-
* `type` - (Required) Type of the ruleset. It can be `"ip"`, `"vpce"` or `"azure_private_endpoint"`.
146+
* `type` - (Required) Type of the ruleset. It can be `"ip"`, `"vpce"`, `"azure_private_endpoint"`, or `"gcp_private_service_connect_endpoint"`.
147147
* `region` - (Required) Filter region, the ruleset can only be attached to deployments in the specific region.
148148
* `rule` (Required) Rule block, which can be specified multiple times for multiple rules.
149149
* `include_by_default` - (Optional) To automatically include the ruleset in the new deployments. Defaults to `false`.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// Licensed to Elasticsearch B.V. under one or more contributor
2+
// license agreements. See the NOTICE file distributed with
3+
// this work for additional information regarding copyright
4+
// ownership. Elasticsearch B.V. licenses this file to you under
5+
// the Apache License, Version 2.0 (the "License"); you may
6+
// not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package acc
19+
20+
import (
21+
"testing"
22+
23+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
24+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
25+
)
26+
27+
func TestAccDeployment_template_migration(t *testing.T) {
28+
resName := "ec_deployment.compute_optimized"
29+
randomName := prefix + acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
30+
basicCfg := "testdata/deployment_compute_optimized_1.tf"
31+
region := getRegion()
32+
cfg := fixtureAccDeploymentResourceBasicDefaults(t, basicCfg, randomName, region, computeOpTemplate)
33+
secondConfigCfg := fixtureAccDeploymentResourceBasicDefaults(t, basicCfg, randomName, region, memoryOpTemplate)
34+
35+
resource.ParallelTest(t, resource.TestCase{
36+
PreCheck: func() { testAccPreCheck(t) },
37+
ProviderFactories: testAccProviderFactory,
38+
CheckDestroy: testAccDeploymentDestroy,
39+
Steps: []resource.TestStep{
40+
{
41+
// Create a Compute Optimized deployment with the default settings.
42+
Config: cfg,
43+
Check: resource.ComposeAggregateTestCheckFunc(
44+
resource.TestCheckResourceAttr(resName, "deployment_template_id", setDefaultTemplate(region, computeOpTemplate)),
45+
resource.TestCheckResourceAttr(resName, "elasticsearch.#", "1"),
46+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.#", "1"),
47+
resource.TestCheckResourceAttrSet(resName, "elasticsearch.0.topology.0.instance_configuration_id"),
48+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size", "8g"),
49+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size_resource", "memory"),
50+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_data", ""),
51+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_ingest", ""),
52+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_master", ""),
53+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_ml", ""),
54+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.id", "hot_content"),
55+
resource.TestCheckResourceAttrSet(resName, "elasticsearch.0.topology.0.node_roles.#"),
56+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.zone_count", "2"),
57+
resource.TestCheckResourceAttr(resName, "kibana.#", "1"),
58+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.0.zone_count", "1"),
59+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.#", "1"),
60+
resource.TestCheckResourceAttrSet(resName, "kibana.0.topology.0.instance_configuration_id"),
61+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.0.size", "1g"),
62+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.0.size_resource", "memory"),
63+
resource.TestCheckResourceAttr(resName, "apm.#", "0"),
64+
resource.TestCheckResourceAttr(resName, "enterprise_search.#", "0"),
65+
),
66+
},
67+
{
68+
// Change the deployment to memory optimized
69+
Config: secondConfigCfg,
70+
Check: resource.ComposeAggregateTestCheckFunc(
71+
resource.TestCheckResourceAttr(resName, "deployment_template_id", setDefaultTemplate(region, memoryOpTemplate)),
72+
resource.TestCheckResourceAttr(resName, "elasticsearch.#", "1"),
73+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.#", "1"),
74+
resource.TestCheckResourceAttrSet(resName, "elasticsearch.0.topology.0.instance_configuration_id"),
75+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size", "8g"),
76+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size_resource", "memory"),
77+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_data", ""),
78+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_ingest", ""),
79+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_master", ""),
80+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.node_type_ml", ""),
81+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.id", "hot_content"),
82+
resource.TestCheckResourceAttrSet(resName, "elasticsearch.0.topology.0.node_roles.#"),
83+
resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.zone_count", "2"),
84+
resource.TestCheckResourceAttr(resName, "kibana.#", "1"),
85+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.0.zone_count", "1"),
86+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.#", "1"),
87+
resource.TestCheckResourceAttrSet(resName, "kibana.0.topology.0.instance_configuration_id"),
88+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.0.size", "1g"),
89+
resource.TestCheckResourceAttr(resName, "kibana.0.topology.0.size_resource", "memory"),
90+
resource.TestCheckResourceAttr(resName, "apm.#", "0"),
91+
resource.TestCheckResourceAttr(resName, "enterprise_search.#", "0"),
92+
),
93+
},
94+
},
95+
})
96+
}

ec/acc/testdata/deployment_basic_defaults_hw_2.tf

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ resource "ec_deployment" "defaults" {
99
version = data.ec_stack.latest.version
1010
deployment_template_id = "%s"
1111

12-
elasticsearch {}
12+
elasticsearch {
13+
topology {
14+
id = "hot_content"
15+
size = "4g"
16+
}
17+
topology {
18+
id = "warm"
19+
size = "4g"
20+
}
21+
}
1322

1423
kibana {}
15-
}
24+
}

ec/ecdatasource/privatelinkdatasource/regionPrivateLinkMap.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
},
290290
"eastus": {
291291
"service_alias": "eastus-prod-010-privatelink-service.b5765cd8-1fc8-45e9-91fc-a9b208369f9a.eastus.azure.privatelinkservice",
292-
"domain_name": "privatelink.eastus2.azure.elastic-cloud.com"
292+
"domain_name": "privatelink.eastus.azure.elastic-cloud.com"
293293
},
294294
"southcentralus": {
295295
"service_alias": "southcentralus-prod-013-privatelink-service.f8030986-5fb9-4b0e-8463-69604233b07e.southcentralus.azure.privatelinkservice",

0 commit comments

Comments
 (0)