Skip to content

Commit

Permalink
Updated release documentation for GSI (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: Rebecca Martinez <[email protected]>
Co-authored-by: Simon Dew <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent c875a0a commit 786b5ee
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [v1.4.0](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/v1.4.0) (2024-12-09)

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

**Implemented enhancements:**
- \[AV-90715\] Add support for `zones` in Cluster [\#241](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/241) ([PaulomeeCb](https://github.com/PaulomeeCb))
- \[AV-82735\] Add support for Flush Bucket Data [\#234](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/234) ([Lagher0](https://github.com/Lagher0))
- \[AV-76498\] Add support for GSI Index Management [\#233](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/233) ([l0n3star](https://github.com/l0n3star))
- \[AV-87139\] Update gorunner version [\#229](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/229)([a-atri](https://github.com/a-atri))
- \[AV-78889\] Add support for Azure VNET Peering [\#216](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/pull/216) ([PaulomeeCb](https://github.com/PaulomeeCb))

**Fixed bugs:**
- \[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))
- \[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))
- \[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))



## [v1.3.0](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/v1.3.0) (2024-09-11)

[Full Changelog](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/compare/v1.2.1...v1.3.0)
Expand Down
176 changes: 176 additions & 0 deletions docs/guides/1.4.0-upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ New features in 1.4.0
## New Features
* Enable Flush Bucket [`couchbase-capella_flush`](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/resources/flush)
* Enable Azure Network Peer [`couchbase-capella_network_peer`](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/resources/network_peer)
* GSI [`couchbase-capella_query_indexes`](https://registry.terraform.io/providers/couchbasecloud/couchbase-capella/latest/docs/resources/query_indexes)

## Changes

There are no deprecations as part of this release.

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.


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

## GSI
To create a deferred index, use the `query_indexes` resource as follows:
```
locals {
index_template = templatefile("${path.module}/indexes.json", {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
})
decoded_template = jsondecode(local.index_template)
index_names = [for idx, details in local.decoded_template.resource["couchbase-capella_indexes"] : details.index_name]
}
```
```
{
"resource": {
"couchbase-capella_indexes": {
"idx1": {
"organization_id": "${organization_id}",
"project_id": "${project_id}",
"cluster_id": "${cluster_id}",
"bucket_name": "test",
"scope_name": "metrics",
"scope_name": "memory",
"index_name": "idx1",
"index_keys": [
"field1"
],
"with": {
"defer_build": true
}
},
"idx2": {
"organization_id": "${organization_id}",
"project_id": "${project_id}",
"cluster_id": "${cluster_id}",
"bucket_name": "test",
"scope_name": "metrics",
"scope_name": "memory",
"index_name": "idx2",
"index_keys": [
"field2"
],
"with": {
"defer_build": true
}
},
"idx3": {
"organization_id": "${organization_id}",
"project_id": "${project_id}",
"cluster_id": "${cluster_id}",
"bucket_name": "test",
"scope_name": "metrics",
"scope_name": "memory",
"index_name": "idx3",
"index_keys": [
"field3"
],
"with": {
"defer_build": true
}
},
"idx4": {
"organization_id": "${organization_id}",
"project_id": "${project_id}",
"cluster_id": "${cluster_id}",
"bucket_name": "test",
"scope_name": "metrics",
"scope_name": "memory",
"index_name": "idx4",
"index_keys": [
"field5"
],
"with": {
"defer_build": true
}
},
"idx5": {
"organization_id": "${organization_id}",
"project_id": "${project_id}",
"cluster_id": "${cluster_id}",
"bucket_name": "test",
"scope_name": "metrics",
"scope_name": "memory",
"index_name": "idx5",
"index_keys": [
"field5"
],
"with": {
"defer_build": true
}
}
}
}
}
```
```
resource "couchbase-capella_query_indexes" "new_indexes" {
for_each = jsondecode(local.index_template).resource["couchbase-capella_indexes"]
organization_id = each.value.organization_id
project_id = each.value.project_id
cluster_id = each.value.cluster_id
bucket_name = each.value.bucket_name
scope_name = each.value.scope_name
collection_name = each.value.collection_name
index_name = each.value.index_name
index_keys = each.value.index_keys
with = {
defer_build = each.value.with.defer_build
}
}
```
```
resource "couchbase-capella_query_indexes" "build_idx" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
bucket_name = var.bucket_name
scope_name = var.scope_name
collection_name = var.collection_name
build_indexes = local.index_names
depends_on = [couchbase-capella_query_indexes.new_indexes]
}
```
```
data "couchbase-capella_query_index_monitor" "mon_indexes" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
bucket_name = var.bucket_name
scope_name = var.scope_name
collection_name = var.collection_name
indexes = local.index_names
depends_on = [couchbase-capella_query_indexes.build_idx]
}
```
```
output "new_indexes" {
value = couchbase-capella_query_indexes.new_indexes
}
```


For more information, see the [deferred index examples](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/main/examples/gsi/deferred).

To create a non-deferred index, use the `query_indexes` resource as follows:
```
resource "couchbase-capella_query_indexes" "idx" {
organization_id = var.organization_id
project_id = var.project_id
cluster_id = var.cluster_id
bucket_name = var.bucket_name
scope_name = var.scope_name
collection_name = var.collection_name
index_name = var.index_name
index_keys = var.index_keys
}
```
```
output "idx" {
value = couchbase-capella_query_indexes.idx
}
```
For more information, see the [non-deferred index examples](https://github.com/couchbasecloud/terraform-provider-couchbase-capella/tree/main/examples/gsi/non_deferred).

### Helpful Links

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

0 comments on commit 786b5ee

Please sign in to comment.