Skip to content

Commit 786b5ee

Browse files
a-atriRebecca-Martinez007simon-dew
authored
Updated release documentation for GSI (#245)
Co-authored-by: Rebecca Martinez <167447972+Rebecca-Martinez007@users.noreply.github.com> Co-authored-by: Simon Dew <39966290+simon-dew@users.noreply.github.com>
1 parent c875a0a commit 786b5ee

2 files changed

Lines changed: 194 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## [v1.4.0](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/v1.4.0) (2024-12-09)
4+
5+
[Full Changelog](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/compare/v1.3.0...v1.4.0)
6+
7+
**Implemented enhancements:**
8+
- \[AV-90715\] Add support for `zones` in Cluster [\#241](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/241) ([PaulomeeCb](https://github.com/PaulomeeCb))
9+
- \[AV-82735\] Add support for Flush Bucket Data [\#234](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/234) ([Lagher0](https://github.com/Lagher0))
10+
- \[AV-76498\] Add support for GSI Index Management [\#233](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/233) ([l0n3star](https://github.com/l0n3star))
11+
- \[AV-87139\] Update gorunner version [\#229](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/229)([a-atri](https://github.com/a-atri))
12+
- \[AV-78889\] Add support for Azure VNET Peering [\#216](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/216) ([PaulomeeCb](https://github.com/PaulomeeCb))
13+
14+
**Fixed bugs:**
15+
- \[AV-90385\] Add check for unsupported `storage` and `IOPS` values in case of `Azure Premium Disk` [\#240](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/240) ([PaulomeeCb](https://github.com/PaulomeeCb))
16+
- \[AV-87077\] Resolve false positives in acceptance tests by correcting the handling of computed values [\#227](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/202) ([l0n3star](https://github.com/l0n3star))
17+
- \[AV-86105\] Initialize `autoexpansion` field with a null value [\#226](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/226) ([aniket-Kumar-c](https://github.com/aniket-Kumar-c))
18+
19+
20+
321
## [v1.3.0](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/v1.3.0) (2024-09-11)
422

523
[Full Changelog](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/compare/v1.2.1...v1.3.0)

docs/guides/1.4.0-upgrade-guide.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ New features in 1.4.0
1515
## New Features
1616
* Enable Flush Bucket [`couchbase-capella_flush`](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/resources/flush)
1717
* Enable Azure Network Peer [`couchbase-capella_network_peer`](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/resources/network_peer)
18+
* GSI [`couchbase-capella_query_indexes`](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/resources/query_indexes)
19+
20+
## Changes
21+
22+
There are no deprecations as part of this release.
23+
24+
1.4.0 also includes general improvements and bug fixes. See the [CHANGELOG](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/blob/master/CHANGELOG.md) for more specific information.
1825

1926

2027
## Flush Bucket
@@ -114,6 +121,175 @@ resource "couchbase-capella_network_peer" "new_network_peer" {
114121
```
115122
For more information, see the [network peer examples](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/main/examples/network_peer).
116123

124+
## GSI
125+
To create a deferred index, use the `query_indexes` resource as follows:
126+
```
127+
locals {
128+
index_template = templatefile("${path.module}/indexes.json", {
129+
organization_id = var.organization_id
130+
project_id = var.project_id
131+
cluster_id = var.cluster_id
132+
})
133+
134+
decoded_template = jsondecode(local.index_template)
135+
index_names = [for idx, details in local.decoded_template.resource["couchbase-capella_indexes"] : details.index_name]
136+
}
137+
```
138+
```
139+
{
140+
"resource": {
141+
"couchbase-capella_indexes": {
142+
"idx1": {
143+
"organization_id": "${organization_id}",
144+
"project_id": "${project_id}",
145+
"cluster_id": "${cluster_id}",
146+
"bucket_name": "test",
147+
"scope_name": "metrics",
148+
"scope_name": "memory",
149+
"index_name": "idx1",
150+
"index_keys": [
151+
"field1"
152+
],
153+
"with": {
154+
"defer_build": true
155+
}
156+
},
157+
"idx2": {
158+
"organization_id": "${organization_id}",
159+
"project_id": "${project_id}",
160+
"cluster_id": "${cluster_id}",
161+
"bucket_name": "test",
162+
"scope_name": "metrics",
163+
"scope_name": "memory",
164+
"index_name": "idx2",
165+
"index_keys": [
166+
"field2"
167+
],
168+
"with": {
169+
"defer_build": true
170+
}
171+
},
172+
"idx3": {
173+
"organization_id": "${organization_id}",
174+
"project_id": "${project_id}",
175+
"cluster_id": "${cluster_id}",
176+
"bucket_name": "test",
177+
"scope_name": "metrics",
178+
"scope_name": "memory",
179+
"index_name": "idx3",
180+
"index_keys": [
181+
"field3"
182+
],
183+
"with": {
184+
"defer_build": true
185+
}
186+
},
187+
"idx4": {
188+
"organization_id": "${organization_id}",
189+
"project_id": "${project_id}",
190+
"cluster_id": "${cluster_id}",
191+
"bucket_name": "test",
192+
"scope_name": "metrics",
193+
"scope_name": "memory",
194+
"index_name": "idx4",
195+
"index_keys": [
196+
"field5"
197+
],
198+
"with": {
199+
"defer_build": true
200+
}
201+
},
202+
"idx5": {
203+
"organization_id": "${organization_id}",
204+
"project_id": "${project_id}",
205+
"cluster_id": "${cluster_id}",
206+
"bucket_name": "test",
207+
"scope_name": "metrics",
208+
"scope_name": "memory",
209+
"index_name": "idx5",
210+
"index_keys": [
211+
"field5"
212+
],
213+
"with": {
214+
"defer_build": true
215+
}
216+
}
217+
}
218+
}
219+
}
220+
```
221+
```
222+
resource "couchbase-capella_query_indexes" "new_indexes" {
223+
for_each = jsondecode(local.index_template).resource["couchbase-capella_indexes"]
224+
organization_id = each.value.organization_id
225+
project_id = each.value.project_id
226+
cluster_id = each.value.cluster_id
227+
bucket_name = each.value.bucket_name
228+
scope_name = each.value.scope_name
229+
collection_name = each.value.collection_name
230+
index_name = each.value.index_name
231+
index_keys = each.value.index_keys
232+
with = {
233+
defer_build = each.value.with.defer_build
234+
}
235+
}
236+
```
237+
```
238+
resource "couchbase-capella_query_indexes" "build_idx" {
239+
organization_id = var.organization_id
240+
project_id = var.project_id
241+
cluster_id = var.cluster_id
242+
bucket_name = var.bucket_name
243+
scope_name = var.scope_name
244+
collection_name = var.collection_name
245+
build_indexes = local.index_names
246+
depends_on = [couchbase-capella_query_indexes.new_indexes]
247+
}
248+
```
249+
```
250+
data "couchbase-capella_query_index_monitor" "mon_indexes" {
251+
organization_id = var.organization_id
252+
project_id = var.project_id
253+
cluster_id = var.cluster_id
254+
bucket_name = var.bucket_name
255+
scope_name = var.scope_name
256+
collection_name = var.collection_name
257+
indexes = local.index_names
258+
259+
depends_on = [couchbase-capella_query_indexes.build_idx]
260+
}
261+
```
262+
```
263+
output "new_indexes" {
264+
value = couchbase-capella_query_indexes.new_indexes
265+
}
266+
```
267+
268+
269+
For more information, see the [deferred index examples](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/main/examples/gsi/deferred).
270+
271+
To create a non-deferred index, use the `query_indexes` resource as follows:
272+
```
273+
resource "couchbase-capella_query_indexes" "idx" {
274+
organization_id = var.organization_id
275+
project_id = var.project_id
276+
cluster_id = var.cluster_id
277+
278+
bucket_name = var.bucket_name
279+
scope_name = var.scope_name
280+
collection_name = var.collection_name
281+
282+
index_name = var.index_name
283+
index_keys = var.index_keys
284+
}
285+
```
286+
```
287+
output "idx" {
288+
value = couchbase-capella_query_indexes.idx
289+
}
290+
```
291+
For more information, see the [non-deferred index examples](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/main/examples/gsi/non_deferred).
292+
117293
### Helpful Links
118294

119295
- [Getting Started with the Terraform Provider](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/blob/master/examples/getting_started)

0 commit comments

Comments
 (0)