Skip to content

Commit

Permalink
FIX: BigAnimal Modules - biganimal fails on repeated applies if pgvec…
Browse files Browse the repository at this point in the history
…tor is not set.

Set a default and allow user overrides.

Error:
│ Error: Provider returned invalid result object after apply
│
│ After the apply operation, the provider still indicated an unknown value for
│ module.biganimal_us_east_1["mydb2"].biganimal_cluster.instance[0].pgvector. All values must be known
│ after apply, so this is always a bug in the provider and should be reported in the provider's own
│ repository. Terraform will still save the other known object values in the state.
  • Loading branch information
bryan-bar committed Feb 21, 2024
1 parent dd2085c commit 8627986
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion edbterraform/data/templates/aws/biganimal.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ module "biganimal_{{ region_ }}" {
volume = each.value.spec.volume
wal_volume = each.value.spec.wal_volume
password = each.value.spec.password
pgvector = each.value.spec.pgvector
allowed_ip_ranges = each.value.spec.allowed_ip_ranges

settings = each.value.spec.settings

tags = each.value.spec.tags
Expand Down
1 change: 1 addition & 0 deletions edbterraform/data/templates/azure/biganimal.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module "biganimal_{{ region_ }}" {
volume = each.value.spec.volume
wal_volume = each.value.spec.wal_volume
password = each.value.spec.password
pgvector = each.value.spec.pgvector
allowed_ip_ranges = each.value.spec.allowed_ip_ranges

settings = each.value.spec.settings
Expand Down
3 changes: 2 additions & 1 deletion edbterraform/data/templates/gcloud/biganimal.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ module "biganimal_{{ region_ }}" {
volume = each.value.spec.volume
wal_volume = each.value.spec.wal_volume
password = each.value.spec.password
pgvector = each.value.spec.pgvector
allowed_ip_ranges = each.value.spec.allowed_ip_ranges

settings = each.value.spec.settings

tags = each.value.spec.tags
Expand Down
1 change: 1 addition & 0 deletions edbterraform/data/terraform/aws/modules/biganimal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ resource "biganimal_cluster" "instance" {
password = var.password
pg_type = var.engine
pg_version = var.engine_version
pgvector = var.pgvector
project_id = var.project.id
region = var.region
storage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ variable "project" {
})
}

variable "pgvector" {
type = bool
default = false
nullable = false
}

variable "name" {}
variable "name_id" {}
variable "cloud_account" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ variable "spec" {
throughput = optional(number)
}))
password = string
pgvector = optional(bool)
settings = optional(list(object({
name = string
value = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ resource "biganimal_cluster" "instance" {
password = var.password
pg_type = var.engine
pg_version = var.engine_version
pgvector = var.pgvector
project_id = var.project.id
region = var.region
storage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ variable "project" {
})
}

variable "pgvector" {
type = bool
default = false
nullable = false
}

variable "name" {}
variable "name_id" {}
variable "cloud_account" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ variable "spec" {
throughput = optional(number)
}))
password = string
pgvector = optional(bool)
settings = optional(list(object({
name = string
value = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ resource "biganimal_cluster" "instance" {
password = var.password
pg_type = var.engine
pg_version = var.engine_version
pgvector = var.pgvector
project_id = var.project.id
region = var.region
storage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ variable "project" {
})
}

variable "pgvector" {
type = bool
default = false
nullable = false
}

variable "name" {}
variable "name_id" {}
variable "cloud_account" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ variable "spec" {
throughput = optional(number)
}))
password = string
pgvector = optional(bool)
settings = optional(list(object({
name = string
value = string
Expand Down

0 comments on commit 8627986

Please sign in to comment.