Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV-76498 | GSI index support #233

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/getting_started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ In this demo, we will perform the following operations:
15. Create a new audit log settings.
16. Enable private endpoint service on the cluster.
17. Create a new network peer.
18. Create an index.

## Pre-Requisites:

Expand Down
19 changes: 19 additions & 0 deletions examples/getting_started/gsi.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "couchbase-capella_query_indexes" "idx" {
organization_id = var.organization_id
project_id = couchbase-capella_project.new_project.id
cluster_id = couchbase-capella_cluster.new_cluster.id

bucket_name = couchbase-capella_bucket.new_bucket.name
scope_name = couchbase-capella_scope.new_scope.scope_name
collection_name = couchbase-capella_collection.new_collection.collection_name

index_name = var.index_name
index_keys = var.index_keys
partition_by = var.partition_by

with = {
defer_build = var.with.defer_build
num_replica = var.with.num_replica
num_partition = var.with.num_partition
}
}
14 changes: 14 additions & 0 deletions examples/getting_started/terraform.template.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,18 @@ aws_config = {
vpc_id = "vpc-141f0fffff141aa00"
region = "us-east-1"
cidr = "10.0.0.0/16"
}

bucket_name = "test"
scope_name = "test"
collection_name = "test"

index_name = "idx_pe9"
index_keys = ["sourceairport", "destinationairport", "stops", "airline", "id", "ARRAY_COUNT(schedule)"]
partition_by = ["sourceairport", "destinationairport"]

with = {
defer_build = false
num_replica = 1
num_partition = 8
}
22 changes: 22 additions & 0 deletions examples/getting_started/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,25 @@ variable "aws_config" {
region = optional(string)
})
}

variable "index_name" {
description = "index Name"
}

variable "index_keys" {
description = "index keys"
}

variable "partition_by" {
description = "partition_by"
}

variable "with" {
description = "WITH clause"

type = object({
defer_build = bool
num_replica = number
num_partition = number
})
}
Loading
Loading