From e569a167e5b7ebd171078a58d38205c7afced2ab Mon Sep 17 00:00:00 2001 From: "PC-2NR0VQ3\\wai.wong" Date: Tue, 30 Jul 2024 20:12:53 +0100 Subject: [PATCH] ci: Prepare for the 0.11.1 draft --- .goreleaser.yml | 2 +- CHANGELOG.md | 4 + GNUmakefile | 2 +- README.md | 2 +- docs/data-sources/pgd.md | 2 +- docs/resources/aws_connection.md | 2 +- docs/resources/azure_connection.md | 2 +- docs/resources/cluster.md | 4 +- docs/resources/faraway_replica.md | 4 +- docs/resources/pgd.md | 24 +++--- docs/resources/project.md | 2 +- docs/resources/region.md | 2 +- .../biganimal_analytics_cluster/provider.tf | 2 +- .../biganimal_aws_connection/provider.tf | 2 +- .../biganimal_cluster/provider.tf | 2 +- .../biganimal_faraway_replica/provider.tf | 2 +- .../data-sources/biganimal_pgd/provider.tf | 2 +- .../biganimal_projects/provider.tf | 2 +- .../data-sources/biganimal_region/provider.tf | 2 +- .../aws/resource.tf | 2 +- .../biganimal_aws_connection/resource.tf | 2 +- .../biganimal_azure_connection/resource.tf | 2 +- .../biganimal_cluster/ha/resource.tf | 2 +- .../single_node/aws/resource.tf | 2 +- .../single_node/azure/resource.tf | 2 +- .../single_node/bah_aws/resource.tf | 2 +- .../single_node/bah_azure/resource.tf | 2 +- .../single_node/bah_gcp/resource.tf | 2 +- .../single_node/gcp/resource.tf | 2 +- .../biganimal_cluster/single_node/resource.tf | 2 +- .../biganimal_faraway_replica/aws/resource.tf | 2 +- .../azure/resource.tf | 2 +- .../cluster_and_faraway_replica/resource.tf | 2 +- .../biganimal_faraway_replica/gcp/resource.tf | 2 +- .../biganimal_faraway_replica/resource.tf | 2 +- .../aws/bah_data_group/resource.tf | 2 +- .../resource.tf | 2 +- .../biganimal_pgd/aws/data_group/resource.tf | 2 +- .../resource.tf | 2 +- .../azure/bah_data_group/resource.tf | 2 +- .../resource.tf | 2 +- .../azure/data_group/resource.tf | 2 +- .../resource.tf | 2 +- .../gcp/bah_data_group/resource.tf | 2 +- .../resource.tf | 2 +- .../biganimal_pgd/gcp/data_group/resource.tf | 2 +- .../resource.tf | 2 +- .../resources/biganimal_project/resource.tf | 2 +- .../resources/biganimal_region/resource.tf | 2 +- pkg/plan_modifier/pg_bouncer.go | 83 ++++++++++--------- 50 files changed, 108 insertions(+), 101 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index b3e7a72a..43c92bf4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -55,6 +55,6 @@ release: - glob: 'terraform-registry-manifest.json' name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' # If you want to manually examine the release before its live, uncomment this line: - draft: false + draft: true changelog: skip: true diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c82d03..c5385a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.11.1 (July 31. 2024) +Bug Fixes: +* Testing pg bouncer settings = null will always show changes on update + ## v0.11.0 (June 20. 2024) Features: * New Resource to manage Analytical clusters: `biganimal_analytics_cluster` diff --git a/GNUmakefile b/GNUmakefile index 766475bf..396d1c5c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -4,7 +4,7 @@ HOSTNAME=registry.terraform.io NAMESPACE=EnterpriseDB NAME=biganimal BINARY=terraform-provider-${NAME} -VERSION=0.11.0 +VERSION=0.11.1 # Figure out the OS and ARCH of the # builder machine diff --git a/README.md b/README.md index c4a13ba6..0a77e8ad 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/docs/data-sources/pgd.md b/docs/data-sources/pgd.md index 788d9db5..83c62774 100644 --- a/docs/data-sources/pgd.md +++ b/docs/data-sources/pgd.md @@ -74,7 +74,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/docs/resources/aws_connection.md b/docs/resources/aws_connection.md index 563b2c59..46d944e4 100644 --- a/docs/resources/aws_connection.md +++ b/docs/resources/aws_connection.md @@ -19,7 +19,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/docs/resources/azure_connection.md b/docs/resources/azure_connection.md index d0e31b72..4d860d9c 100644 --- a/docs/resources/azure_connection.md +++ b/docs/resources/azure_connection.md @@ -19,7 +19,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 29a71385..d8197f00 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -13,7 +13,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -127,7 +127,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/docs/resources/faraway_replica.md b/docs/resources/faraway_replica.md index 2fc90eab..cf5ad522 100644 --- a/docs/resources/faraway_replica.md +++ b/docs/resources/faraway_replica.md @@ -9,7 +9,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -102,7 +102,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/docs/resources/pgd.md b/docs/resources/pgd.md index d3134269..04822219 100644 --- a/docs/resources/pgd.md +++ b/docs/resources/pgd.md @@ -10,7 +10,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -110,7 +110,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -279,7 +279,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -382,7 +382,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -557,7 +557,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -657,7 +657,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -826,7 +826,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -929,7 +929,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -1104,7 +1104,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -1204,7 +1204,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -1373,7 +1373,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" @@ -1480,7 +1480,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/docs/resources/project.md b/docs/resources/project.md index a9bf8f1d..e2497628 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -20,7 +20,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/docs/resources/region.md b/docs/resources/region.md index 3d5186f7..dc0f48d8 100644 --- a/docs/resources/region.md +++ b/docs/resources/region.md @@ -9,7 +9,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_analytics_cluster/provider.tf b/examples/data-sources/biganimal_analytics_cluster/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_analytics_cluster/provider.tf +++ b/examples/data-sources/biganimal_analytics_cluster/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_aws_connection/provider.tf b/examples/data-sources/biganimal_aws_connection/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_aws_connection/provider.tf +++ b/examples/data-sources/biganimal_aws_connection/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_cluster/provider.tf b/examples/data-sources/biganimal_cluster/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_cluster/provider.tf +++ b/examples/data-sources/biganimal_cluster/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_faraway_replica/provider.tf b/examples/data-sources/biganimal_faraway_replica/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_faraway_replica/provider.tf +++ b/examples/data-sources/biganimal_faraway_replica/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_pgd/provider.tf b/examples/data-sources/biganimal_pgd/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_pgd/provider.tf +++ b/examples/data-sources/biganimal_pgd/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_projects/provider.tf b/examples/data-sources/biganimal_projects/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_projects/provider.tf +++ b/examples/data-sources/biganimal_projects/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/data-sources/biganimal_region/provider.tf b/examples/data-sources/biganimal_region/provider.tf index 5ac773cb..ec7f2411 100644 --- a/examples/data-sources/biganimal_region/provider.tf +++ b/examples/data-sources/biganimal_region/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/resources/biganimal_analytics_cluster/aws/resource.tf b/examples/resources/biganimal_analytics_cluster/aws/resource.tf index 4acbb74a..2fd5d345 100644 --- a/examples/resources/biganimal_analytics_cluster/aws/resource.tf +++ b/examples/resources/biganimal_analytics_cluster/aws/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_aws_connection/resource.tf b/examples/resources/biganimal_aws_connection/resource.tf index 8711e4dd..a5c45506 100644 --- a/examples/resources/biganimal_aws_connection/resource.tf +++ b/examples/resources/biganimal_aws_connection/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/resources/biganimal_azure_connection/resource.tf b/examples/resources/biganimal_azure_connection/resource.tf index 1ac21f05..0b0c2abc 100644 --- a/examples/resources/biganimal_azure_connection/resource.tf +++ b/examples/resources/biganimal_azure_connection/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/resources/biganimal_cluster/ha/resource.tf b/examples/resources/biganimal_cluster/ha/resource.tf index 062e2f94..1a1809fd 100644 --- a/examples/resources/biganimal_cluster/ha/resource.tf +++ b/examples/resources/biganimal_cluster/ha/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_cluster/single_node/aws/resource.tf b/examples/resources/biganimal_cluster/single_node/aws/resource.tf index 7a82e664..1e201a15 100644 --- a/examples/resources/biganimal_cluster/single_node/aws/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/aws/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_cluster/single_node/azure/resource.tf b/examples/resources/biganimal_cluster/single_node/azure/resource.tf index f381d596..92ad6045 100644 --- a/examples/resources/biganimal_cluster/single_node/azure/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/azure/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_cluster/single_node/bah_aws/resource.tf b/examples/resources/biganimal_cluster/single_node/bah_aws/resource.tf index 50b8778f..c4f6cb2d 100644 --- a/examples/resources/biganimal_cluster/single_node/bah_aws/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/bah_aws/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_cluster/single_node/bah_azure/resource.tf b/examples/resources/biganimal_cluster/single_node/bah_azure/resource.tf index fba39945..a623aea0 100644 --- a/examples/resources/biganimal_cluster/single_node/bah_azure/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/bah_azure/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_cluster/single_node/bah_gcp/resource.tf b/examples/resources/biganimal_cluster/single_node/bah_gcp/resource.tf index 39602080..27645f35 100644 --- a/examples/resources/biganimal_cluster/single_node/bah_gcp/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/bah_gcp/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/examples/resources/biganimal_cluster/single_node/gcp/resource.tf b/examples/resources/biganimal_cluster/single_node/gcp/resource.tf index ce51d1dd..f35a9916 100644 --- a/examples/resources/biganimal_cluster/single_node/gcp/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/gcp/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_cluster/single_node/resource.tf b/examples/resources/biganimal_cluster/single_node/resource.tf index f381d596..92ad6045 100644 --- a/examples/resources/biganimal_cluster/single_node/resource.tf +++ b/examples/resources/biganimal_cluster/single_node/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_faraway_replica/aws/resource.tf b/examples/resources/biganimal_faraway_replica/aws/resource.tf index f8390544..d6ca7d51 100644 --- a/examples/resources/biganimal_faraway_replica/aws/resource.tf +++ b/examples/resources/biganimal_faraway_replica/aws/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_faraway_replica/azure/resource.tf b/examples/resources/biganimal_faraway_replica/azure/resource.tf index c642f5eb..4550e504 100644 --- a/examples/resources/biganimal_faraway_replica/azure/resource.tf +++ b/examples/resources/biganimal_faraway_replica/azure/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_faraway_replica/cluster_and_faraway_replica/resource.tf b/examples/resources/biganimal_faraway_replica/cluster_and_faraway_replica/resource.tf index 993e17db..7fc6ee89 100644 --- a/examples/resources/biganimal_faraway_replica/cluster_and_faraway_replica/resource.tf +++ b/examples/resources/biganimal_faraway_replica/cluster_and_faraway_replica/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_faraway_replica/gcp/resource.tf b/examples/resources/biganimal_faraway_replica/gcp/resource.tf index 6e722b37..f36a3912 100644 --- a/examples/resources/biganimal_faraway_replica/gcp/resource.tf +++ b/examples/resources/biganimal_faraway_replica/gcp/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_faraway_replica/resource.tf b/examples/resources/biganimal_faraway_replica/resource.tf index f8390544..d6ca7d51 100644 --- a/examples/resources/biganimal_faraway_replica/resource.tf +++ b/examples/resources/biganimal_faraway_replica/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/aws/bah_data_group/resource.tf b/examples/resources/biganimal_pgd/aws/bah_data_group/resource.tf index 5031fc87..cb08bd0f 100644 --- a/examples/resources/biganimal_pgd/aws/bah_data_group/resource.tf +++ b/examples/resources/biganimal_pgd/aws/bah_data_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/aws/bah_data_groups_with_witness_group/resource.tf b/examples/resources/biganimal_pgd/aws/bah_data_groups_with_witness_group/resource.tf index 4af25c8a..235b5ae9 100644 --- a/examples/resources/biganimal_pgd/aws/bah_data_groups_with_witness_group/resource.tf +++ b/examples/resources/biganimal_pgd/aws/bah_data_groups_with_witness_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/aws/data_group/resource.tf b/examples/resources/biganimal_pgd/aws/data_group/resource.tf index aaac1d5f..a0c03cc6 100644 --- a/examples/resources/biganimal_pgd/aws/data_group/resource.tf +++ b/examples/resources/biganimal_pgd/aws/data_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/aws/data_groups_with_witness_group/resource.tf b/examples/resources/biganimal_pgd/aws/data_groups_with_witness_group/resource.tf index 5b47c5f9..a2f582c0 100644 --- a/examples/resources/biganimal_pgd/aws/data_groups_with_witness_group/resource.tf +++ b/examples/resources/biganimal_pgd/aws/data_groups_with_witness_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/azure/bah_data_group/resource.tf b/examples/resources/biganimal_pgd/azure/bah_data_group/resource.tf index 52e38352..4b707704 100644 --- a/examples/resources/biganimal_pgd/azure/bah_data_group/resource.tf +++ b/examples/resources/biganimal_pgd/azure/bah_data_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/azure/bah_data_groups_with_witness_group/resource.tf b/examples/resources/biganimal_pgd/azure/bah_data_groups_with_witness_group/resource.tf index 73d6ff2a..2313ad20 100644 --- a/examples/resources/biganimal_pgd/azure/bah_data_groups_with_witness_group/resource.tf +++ b/examples/resources/biganimal_pgd/azure/bah_data_groups_with_witness_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/azure/data_group/resource.tf b/examples/resources/biganimal_pgd/azure/data_group/resource.tf index 3bfd7a7b..f7922636 100644 --- a/examples/resources/biganimal_pgd/azure/data_group/resource.tf +++ b/examples/resources/biganimal_pgd/azure/data_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/azure/data_groups_with_witness_group/resource.tf b/examples/resources/biganimal_pgd/azure/data_groups_with_witness_group/resource.tf index fbd60074..0754b1ef 100644 --- a/examples/resources/biganimal_pgd/azure/data_groups_with_witness_group/resource.tf +++ b/examples/resources/biganimal_pgd/azure/data_groups_with_witness_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/gcp/bah_data_group/resource.tf b/examples/resources/biganimal_pgd/gcp/bah_data_group/resource.tf index 01e8c18c..7aa9a612 100644 --- a/examples/resources/biganimal_pgd/gcp/bah_data_group/resource.tf +++ b/examples/resources/biganimal_pgd/gcp/bah_data_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/gcp/bah_data_groups_with_witness_group/resource.tf b/examples/resources/biganimal_pgd/gcp/bah_data_groups_with_witness_group/resource.tf index 66c448ed..3519041b 100644 --- a/examples/resources/biganimal_pgd/gcp/bah_data_groups_with_witness_group/resource.tf +++ b/examples/resources/biganimal_pgd/gcp/bah_data_groups_with_witness_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/gcp/data_group/resource.tf b/examples/resources/biganimal_pgd/gcp/data_group/resource.tf index c527e56e..60432798 100644 --- a/examples/resources/biganimal_pgd/gcp/data_group/resource.tf +++ b/examples/resources/biganimal_pgd/gcp/data_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_pgd/gcp/data_groups_with_witness_group/resource.tf b/examples/resources/biganimal_pgd/gcp/data_groups_with_witness_group/resource.tf index 66fc713f..7b2784be 100644 --- a/examples/resources/biganimal_pgd/gcp/data_groups_with_witness_group/resource.tf +++ b/examples/resources/biganimal_pgd/gcp/data_groups_with_witness_group/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_project/resource.tf b/examples/resources/biganimal_project/resource.tf index 55a74404..3116d0a8 100644 --- a/examples/resources/biganimal_project/resource.tf +++ b/examples/resources/biganimal_project/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_region/resource.tf b/examples/resources/biganimal_region/resource.tf index 5290e020..f8efaf78 100644 --- a/examples/resources/biganimal_region/resource.tf +++ b/examples/resources/biganimal_region/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.11.0" + version = "0.11.1" } } } diff --git a/pkg/plan_modifier/pg_bouncer.go b/pkg/plan_modifier/pg_bouncer.go index ff7b6d23..0694ce03 100644 --- a/pkg/plan_modifier/pg_bouncer.go +++ b/pkg/plan_modifier/pg_bouncer.go @@ -28,69 +28,72 @@ func (m CustomPgBouncerModifier) MarkdownDescription(_ context.Context) string { // PlanModifyObject implements the plan modification logic. func (m CustomPgBouncerModifier) PlanModifyObject(ctx context.Context, req planmodifier.ObjectRequest, resp *planmodifier.ObjectResponse) { - reqPlanSettings := req.PlanValue.Attributes()["settings"].(basetypes.SetValue) - respPlanSettings := resp.PlanValue.Attributes()["settings"].(basetypes.SetValue) - reqStateSettings := req.StateValue.Attributes()["settings"].(basetypes.SetValue) - reqConfigSettings := req.ConfigValue.Attributes()["settings"].(basetypes.SetValue) - reqPlanIsEnabled := req.PlanValue.Attributes()["is_enabled"].(basetypes.BoolValue) - if req.PlanValue.IsUnknown() { resp.PlanValue = basetypes.NewObjectValueMust( req.StateValue.AttributeTypes(ctx), map[string]attr.Value{ "is_enabled": basetypes.NewBoolValue(false), - "settings": basetypes.NewSetNull(reqStateSettings.ElementType(ctx)), + "settings": basetypes.NewSetNull(req.StateValue.AttributeTypes(ctx)["settings"].(types.SetType).ElemType), }, ) return } - // have plan settings combine with state settings if planned settings len > 0 - if !req.PlanValue.IsNull() && len(reqPlanSettings.Elements()) > 0 { - if !reqPlanIsEnabled.ValueBool() { - if !req.PlanValue.Attributes()["settings"].(basetypes.SetValue).IsNull() { - resp.Diagnostics.AddError("if pg_bouncer.is_enabled = false then pg_bouncer.settings should be removed", "please remove pg_bouncer.settings if pg_bouncer.is_enabled = false") - return - } - } else if reqPlanIsEnabled.ValueBool() { - newPlanWithPrefilledPlannedSettings := respPlanSettings.Elements() - stateSettings := []attr.Value{} - if len(req.StateValue.Attributes()) != 0 { - stateSettings = reqStateSettings.Elements() - } + if !req.PlanValue.IsNull() { + reqPlanSettings := req.PlanValue.Attributes()["settings"].(basetypes.SetValue) + // have plan settings combine with state settings if planned settings len > 0 + if len(reqPlanSettings.Elements()) > 0 { + reqPlanIsEnabled := req.PlanValue.Attributes()["is_enabled"].(basetypes.BoolValue) + if !reqPlanIsEnabled.ValueBool() { + if !req.PlanValue.Attributes()["settings"].(basetypes.SetValue).IsNull() { + resp.Diagnostics.AddError("if pg_bouncer.is_enabled = false then pg_bouncer.settings should be removed", "please remove pg_bouncer.settings if pg_bouncer.is_enabled = false") + return + } + } else if reqPlanIsEnabled.ValueBool() { + respPlanSettings := resp.PlanValue.Attributes()["settings"].(basetypes.SetValue) + newPlanWithPrefilledPlannedSettings := respPlanSettings.Elements() + stateSettings := []attr.Value{} + if len(req.StateValue.Attributes()) != 0 { + stateSettings = req.StateValue.Attributes()["settings"].(basetypes.SetValue).Elements() + } - // combine state settings with plan settings - for _, sSetting := range stateSettings { - stateSettingName := sSetting.(basetypes.ObjectValue).Attributes()["name"] - for _, pSetting := range newPlanWithPrefilledPlannedSettings { - planSettingName := pSetting.(basetypes.ObjectValue).Attributes()["name"] - if stateSettingName.Equal(planSettingName) { - continue - } + // combine state settings with plan settings + for _, sSetting := range stateSettings { + stateSettingName := sSetting.(basetypes.ObjectValue).Attributes()["name"] + for _, pSetting := range newPlanWithPrefilledPlannedSettings { + planSettingName := pSetting.(basetypes.ObjectValue).Attributes()["name"] + if stateSettingName.Equal(planSettingName) { + continue + } - newPlanWithPrefilledPlannedSettings = append(newPlanWithPrefilledPlannedSettings, sSetting) + newPlanWithPrefilledPlannedSettings = append(newPlanWithPrefilledPlannedSettings, sSetting) + } } - } - resp.PlanValue = basetypes.NewObjectValueMust( - req.StateValue.AttributeTypes(ctx), - map[string]attr.Value{ - "is_enabled": basetypes.NewBoolValue(true), - "settings": basetypes.NewSetValueMust(req.StateValue.AttributeTypes(ctx)["settings"].(types.SetType).ElemType, newPlanWithPrefilledPlannedSettings), - }, - ) + resp.PlanValue = basetypes.NewObjectValueMust( + req.StateValue.AttributeTypes(ctx), + map[string]attr.Value{ + "is_enabled": basetypes.NewBoolValue(true), + "settings": basetypes.NewSetValueMust(req.StateValue.AttributeTypes(ctx)["settings"].(types.SetType).ElemType, newPlanWithPrefilledPlannedSettings), + }, + ) - return + return + } } - } else if !req.PlanValue.IsNull() { + // if is_enabled = true and settings = [] + reqPlanIsEnabled := req.PlanValue.Attributes()["is_enabled"].(basetypes.BoolValue) if reqPlanIsEnabled.ValueBool() && !reqPlanSettings.IsUnknown() && len(reqPlanSettings.Elements()) == 0 { resp.Diagnostics.AddError("if pg_bouncer.is_enabled = true then pg_bouncer.settings cannot be []", "please remove pg_bouncer.settings or set pg_bouncer.settings") return } // if is_enabled = false and settings is null and state setting is null then use state value for unknown - if !reqPlanIsEnabled.ValueBool() && reqConfigSettings.IsNull() && reqStateSettings.IsNull() { + if !reqPlanIsEnabled.ValueBool() && + req.ConfigValue.Attributes()["settings"].(basetypes.SetValue).IsNull() && + len(req.StateValue.Attributes()) != 0 && + req.StateValue.Attributes()["settings"].(basetypes.SetValue).IsNull() { resp.PlanValue = req.StateValue return }