From 862798668a1be7896bd5c294d40ad2616e3ad3a5 Mon Sep 17 00:00:00 2001 From: Bryan Barajas Date: Mon, 19 Feb 2024 17:50:40 +0000 Subject: [PATCH] FIX: BigAnimal Modules - biganimal fails on repeated applies if pgvector is not set. Set a default and allow user overrides. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- edbterraform/data/templates/aws/biganimal.tf.j2 | 3 ++- edbterraform/data/templates/azure/biganimal.tf.j2 | 1 + edbterraform/data/templates/gcloud/biganimal.tf.j2 | 3 ++- edbterraform/data/terraform/aws/modules/biganimal/main.tf | 1 + .../data/terraform/aws/modules/biganimal/variables.tf | 6 ++++++ .../data/terraform/aws/modules/specification/variables.tf | 1 + edbterraform/data/terraform/azure/modules/biganimal/main.tf | 1 + .../data/terraform/azure/modules/biganimal/variables.tf | 6 ++++++ .../data/terraform/azure/modules/specification/variables.tf | 1 + .../data/terraform/gcloud/modules/biganimal/main.tf | 1 + .../data/terraform/gcloud/modules/biganimal/variables.tf | 6 ++++++ .../terraform/gcloud/modules/specification/variables.tf | 1 + 12 files changed, 29 insertions(+), 2 deletions(-) diff --git a/edbterraform/data/templates/aws/biganimal.tf.j2 b/edbterraform/data/templates/aws/biganimal.tf.j2 index 90b03d25..3384d3be 100644 --- a/edbterraform/data/templates/aws/biganimal.tf.j2 +++ b/edbterraform/data/templates/aws/biganimal.tf.j2 @@ -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 diff --git a/edbterraform/data/templates/azure/biganimal.tf.j2 b/edbterraform/data/templates/azure/biganimal.tf.j2 index d77cf82d..3384d3be 100644 --- a/edbterraform/data/templates/azure/biganimal.tf.j2 +++ b/edbterraform/data/templates/azure/biganimal.tf.j2 @@ -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 diff --git a/edbterraform/data/templates/gcloud/biganimal.tf.j2 b/edbterraform/data/templates/gcloud/biganimal.tf.j2 index 90b03d25..3384d3be 100644 --- a/edbterraform/data/templates/gcloud/biganimal.tf.j2 +++ b/edbterraform/data/templates/gcloud/biganimal.tf.j2 @@ -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 diff --git a/edbterraform/data/terraform/aws/modules/biganimal/main.tf b/edbterraform/data/terraform/aws/modules/biganimal/main.tf index 6e27c9a2..7fde3f5c 100644 --- a/edbterraform/data/terraform/aws/modules/biganimal/main.tf +++ b/edbterraform/data/terraform/aws/modules/biganimal/main.tf @@ -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 { diff --git a/edbterraform/data/terraform/aws/modules/biganimal/variables.tf b/edbterraform/data/terraform/aws/modules/biganimal/variables.tf index 65b7fcce..57614e4f 100644 --- a/edbterraform/data/terraform/aws/modules/biganimal/variables.tf +++ b/edbterraform/data/terraform/aws/modules/biganimal/variables.tf @@ -4,6 +4,12 @@ variable "project" { }) } +variable "pgvector" { + type = bool + default = false + nullable = false +} + variable "name" {} variable "name_id" {} variable "cloud_account" { diff --git a/edbterraform/data/terraform/aws/modules/specification/variables.tf b/edbterraform/data/terraform/aws/modules/specification/variables.tf index 8174b8c5..2a9dee44 100644 --- a/edbterraform/data/terraform/aws/modules/specification/variables.tf +++ b/edbterraform/data/terraform/aws/modules/specification/variables.tf @@ -170,6 +170,7 @@ variable "spec" { throughput = optional(number) })) password = string + pgvector = optional(bool) settings = optional(list(object({ name = string value = string diff --git a/edbterraform/data/terraform/azure/modules/biganimal/main.tf b/edbterraform/data/terraform/azure/modules/biganimal/main.tf index 1908f57b..8459e98f 100644 --- a/edbterraform/data/terraform/azure/modules/biganimal/main.tf +++ b/edbterraform/data/terraform/azure/modules/biganimal/main.tf @@ -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 { diff --git a/edbterraform/data/terraform/azure/modules/biganimal/variables.tf b/edbterraform/data/terraform/azure/modules/biganimal/variables.tf index bf25933b..56352755 100644 --- a/edbterraform/data/terraform/azure/modules/biganimal/variables.tf +++ b/edbterraform/data/terraform/azure/modules/biganimal/variables.tf @@ -4,6 +4,12 @@ variable "project" { }) } +variable "pgvector" { + type = bool + default = false + nullable = false +} + variable "name" {} variable "name_id" {} variable "cloud_account" { diff --git a/edbterraform/data/terraform/azure/modules/specification/variables.tf b/edbterraform/data/terraform/azure/modules/specification/variables.tf index c546fed7..4d3fa156 100644 --- a/edbterraform/data/terraform/azure/modules/specification/variables.tf +++ b/edbterraform/data/terraform/azure/modules/specification/variables.tf @@ -129,6 +129,7 @@ variable "spec" { throughput = optional(number) })) password = string + pgvector = optional(bool) settings = optional(list(object({ name = string value = string diff --git a/edbterraform/data/terraform/gcloud/modules/biganimal/main.tf b/edbterraform/data/terraform/gcloud/modules/biganimal/main.tf index 1f9b7dfe..e0d7d901 100644 --- a/edbterraform/data/terraform/gcloud/modules/biganimal/main.tf +++ b/edbterraform/data/terraform/gcloud/modules/biganimal/main.tf @@ -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 { diff --git a/edbterraform/data/terraform/gcloud/modules/biganimal/variables.tf b/edbterraform/data/terraform/gcloud/modules/biganimal/variables.tf index 39a2897c..0c4bc7a5 100644 --- a/edbterraform/data/terraform/gcloud/modules/biganimal/variables.tf +++ b/edbterraform/data/terraform/gcloud/modules/biganimal/variables.tf @@ -4,6 +4,12 @@ variable "project" { }) } +variable "pgvector" { + type = bool + default = false + nullable = false +} + variable "name" {} variable "name_id" {} variable "cloud_account" { diff --git a/edbterraform/data/terraform/gcloud/modules/specification/variables.tf b/edbterraform/data/terraform/gcloud/modules/specification/variables.tf index 80ff08df..a1df498b 100644 --- a/edbterraform/data/terraform/gcloud/modules/specification/variables.tf +++ b/edbterraform/data/terraform/gcloud/modules/specification/variables.tf @@ -142,6 +142,7 @@ variable "spec" { throughput = optional(number) })) password = string + pgvector = optional(bool) settings = optional(list(object({ name = string value = string