You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,23 @@
1
-
# 0.5.0 (Unreleased)
1
+
# 0.6.0 (Unreleased)
2
2
3
3
FEATURES:
4
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
+
7
+
# 0.5.0 (Oct 12, 2022)
8
+
9
+
FEATURES:
10
+
11
+
* datasource/privatelink: Adds data sources to obtain AWS/Azure Private Link, and GCP Private Service Connect configuration data. ([#533](https://github.com/elastic/terraform-provider-ec/issues/533))
12
+
* resource/deployment: Adds fleet_https_endpoint and apm_https_endpoint to integrations server resources. This allows consumers to explicitly capture service urls for dependent modules. ([#548](https://github.com/elastic/terraform-provider-ec/issues/548))
5
13
* resource/elasticsearch: Adds support for the `strategy` property to the `elasticsearch` resource. This allows users to define how different plan changes are coordinated. ([#507](https://github.com/elastic/terraform-provider-ec/issues/507))
6
14
15
+
BUG FIXES:
16
+
17
+
* resource/deployment: Correctly restrict stateless (Kibana/Enterprise Search/Integrations Server) resources to a single topology element. Fixes a provider crash when multiple elements without an instance_configuration_id were specified. ([#536](https://github.com/elastic/terraform-provider-ec/issues/536))
18
+
* resource/elasticsearchkeystore: Correctly delete keystore items when removed from the module definition. ([#546](https://github.com/elastic/terraform-provider-ec/issues/546))
19
+
* resource: Updates all nested field accesses to validate type casts. This prevents a provider crash when a field is explicitly set to `null`. ([#534](https://github.com/elastic/terraform-provider-ec/issues/534))
After doing so, you can navigate to any of our examples in `./examples` and try one.
123
+
124
+
### Moving to TF Framework and schema change for `ec_deployment` resource.
125
+
126
+
v6.0.0 contains migration to [the TF Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework) and intoducing version 2 for `ec_deployment` resource:
127
+
128
+
- switching to attributes syntax instead of blocks for almost all definitions that used to be blocks. It means that, for example, a definition like `config {}` has to be changed to `config = {}`, e.g.
129
+
130
+
```hcl
131
+
resource "ec_deployment" "defaults" {
132
+
name = "example"
133
+
region = "us-east-1"
134
+
version = data.ec_stack.latest.version
135
+
deployment_template_id = "aws-io-optimized-v2"
136
+
137
+
elasticsearch = {
138
+
hot = {
139
+
autoscaling = {}
140
+
}
141
+
}
142
+
143
+
kibana = {
144
+
topology = {}
145
+
}
146
+
147
+
enterprise_search = {
148
+
zone_count = 1
149
+
}
150
+
}
151
+
```
152
+
153
+
-`topology` attribute of `elasticsearch` is replaced with a number of dedicated attributes, one per tier, e.g.
154
+
155
+
```
156
+
elasticsearch {
157
+
topology {
158
+
id = "hot_content"
159
+
size = "1g"
160
+
autoscaling {
161
+
max_size = "8g"
162
+
}
163
+
}
164
+
topology {
165
+
id = "warm"
166
+
size = "2g"
167
+
autoscaling {
168
+
max_size = "15g"
169
+
}
170
+
}
171
+
}
172
+
```
173
+
174
+
has to be converted to
175
+
176
+
```
177
+
elasticsearch = {
178
+
hot = {
179
+
size = "1g"
180
+
autoscaling = {
181
+
max_size = "8g"
182
+
}
183
+
}
184
+
185
+
warm = {
186
+
size = "2g"
187
+
autoscaling = {
188
+
max_size = "15g"
189
+
}
190
+
}
191
+
}
192
+
193
+
```
194
+
195
+
- due to some existing limitations of TF, nested attributes that are nested inside other nested attributes cannot be `Computed`. It means that all such attributes have to be mentioned in configurations even if they are empty. E.g., a definition of `elasticsearch` has to include all topology elements (tiers) that have non-zero size or can be scaled up (if autoscaling is enabled) in the corresponding template. For example, the simplest definition of `elasticsearch` for `aws-io-optimized-v2` template is
196
+
197
+
```hcl
198
+
resource "ec_deployment" "defaults" {
199
+
name = "example"
200
+
region = "us-east-1"
201
+
version = data.ec_stack.latest.version
202
+
deployment_template_id = "aws-io-optimized-v2"
203
+
204
+
elasticsearch = {
205
+
hot = {
206
+
autoscaling = {}
207
+
}
208
+
}
209
+
}
210
+
```
211
+
212
+
Please note that the configuration explicitly mentions `hot` tier and the tier has `autoscaling` and `config` attributes even despite the fact that they are empty. If they were omitted, TF (at least up to version 1.3.3) could complain `Error: Provider produced inconsistent result after apply`.
213
+
214
+
- a lot of attributes that used to be collections (e.g. lists and sets) are converted to sigletons, e.g. `elasticsearch`, `apm`, `kibana`, `enterprise_search`, `observability`, `topology`, `autoscaling`, etc. Please note that, generally, users are not expected to make any change to their existing configuration to address this particular change (besides moving from block to attribute syntax). All these components used to exist in single instances, so the change is mostly syntactical, taking into account the switch to attributes instead of blocks (otherwise if we kept list for configs, `config {}` had to be rewritten in `config = [{}]` with the move to the attribute syntax). However this change is a breaking one from the schema perspective and requires state upgrade for existing resources that is performed by TF (by calling the provider's API).
215
+
216
+
-[`strategy` attribute](https://registry.terraform.io/providers/elastic/ec/latest/docs/resources/ec_deployment#strategy) is converted to string with the same set of values that was used for its `type` attribute previously;
217
+
218
+
- switching to TF protocol 6. From user perspective it should not require any change in their existing configurations.
219
+
220
+
#### Migration guide.
221
+
222
+
The schema modifications means that a current TF state cannot work as is with the provider version 0.6.0 and higher.
- state upgrade that is performed by TF by calling the provider's API so no action is required from user perspective
228
+
229
+
Currently the state upgrade functionality is still in development so importing existing resources is the recommended way to deal with existing TF states.
230
+
231
+
#### Known issues.
232
+
233
+
For the migrated version (0.6.0 or higher), `terraform plan` output can contain more changes comparing to the older versions of the provider (that use TF SDK).
234
+
This happens because TF Framework treats all `computed` attributes as `unknown` (known after apply) once configuration changes.
235
+
`ec_deployment` schema contains quite a few of such attributes, so `terraform plan`'s output can be quite big for the resource due to the mentioned reason.
236
+
However, it doesn't mean that all attributes that marked as `unknown` in the plan will get new values after apply.
237
+
To mitigitate the problem, the provider uses plan modifiers that is a recommended way to reduce plan output.
238
+
However, currently plan modifiers don't cover the all `computed` attributes.
0 commit comments