diff --git a/.wordlist-en-custom.txt b/.wordlist-en-custom.txt index b098eb08..d52ac354 100644 --- a/.wordlist-en-custom.txt +++ b/.wordlist-en-custom.txt @@ -10,6 +10,7 @@ InstanceType MPL PGD Postgres +analytics aws awsconnection azureconnection diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b3c1670..a1c82d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v0.11.0 (June 20. 2024) +Features: +* New Resource to manage Analytical clusters: `biganimal_analytics_cluster` +* New Data Source: `biganimal_analytics_cluster` + ## v0.10.0 (May 13. 2024) Features: * PostGIS support for `biganimal_cluster` resources diff --git a/GNUmakefile b/GNUmakefile index 4b02b3ea..766475bf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -4,7 +4,7 @@ HOSTNAME=registry.terraform.io NAMESPACE=EnterpriseDB NAME=biganimal BINARY=terraform-provider-${NAME} -VERSION=0.10.0 +VERSION=0.11.0 # Figure out the OS and ARCH of the # builder machine diff --git a/README.md b/README.md index b3ad7442..c4a13ba6 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } } } diff --git a/docs/data-sources/analytics_cluster.md b/docs/data-sources/analytics_cluster.md new file mode 100644 index 00000000..215b21d7 --- /dev/null +++ b/docs/data-sources/analytics_cluster.md @@ -0,0 +1,166 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "biganimal_analytics_cluster Data Source - terraform-provider-biganimal" +subcategory: "" +description: |- + The analytics cluster resource is used to manage BigAnimal analytics clusters. +--- + +# biganimal_analytics_cluster (Data Source) + +The analytics cluster resource is used to manage BigAnimal analytics clusters. + +## Example Usage + +```terraform +variable "cluster_id" { + type = string + description = "The id of the cluster" +} + +variable "project_id" { + type = string + description = "BigAnimal Project ID" +} + +data "biganimal_analytics_cluster" "this" { + cluster_id = var.cluster_id + project_id = var.project_id +} + +output "backup_retention_period" { + value = data.biganimal_analytics_cluster.this.backup_retention_period +} + +output "cluster_name" { + value = data.biganimal_analytics_cluster.this.cluster_name +} + +output "created_at" { + value = data.biganimal_analytics_cluster.this.created_at +} + +output "csp_auth" { + value = coalesce(data.biganimal_analytics_cluster.this.csp_auth, false) +} + +output "instance_type" { + value = data.biganimal_analytics_cluster.this.instance_type +} + +output "metrics_url" { + value = data.biganimal_analytics_cluster.this.metrics_url +} + +output "logs_url" { + value = data.biganimal_analytics_cluster.this.logs_url +} + +output "pg_type" { + value = data.biganimal_analytics_cluster.this.pg_type +} + +output "pg_version" { + value = data.biganimal_analytics_cluster.this.pg_version +} + +output "phase" { + value = data.biganimal_analytics_cluster.this.phase +} + +output "private_networking" { + value = coalesce(data.biganimal_analytics_cluster.this.private_networking, false) +} + +output "cloud_provider" { + value = data.biganimal_analytics_cluster.this.cloud_provider +} + +output "region" { + value = data.biganimal_analytics_cluster.this.region +} + +output "resizing_pvc" { + value = data.biganimal_analytics_cluster.this.resizing_pvc +} + +output "pe_allowed_principal_ids" { + value = data.biganimal_analytics_cluster.this.pe_allowed_principal_ids +} + +output "service_account_ids" { + value = data.biganimal_analytics_cluster.this.service_account_ids +} +``` + + +## Schema + +### Required + +- `cluster_id` (String) Cluster ID. +- `project_id` (String) BigAnimal Project ID. + +### Optional + +- `allowed_ip_ranges` (Attributes Set) Allowed IP ranges. (see [below for nested schema](#nestedatt--allowed_ip_ranges)) +- `backup_retention_period` (String) Backup retention period. For example, "7d", "2w", or "3m". +- `csp_auth` (Boolean) Is authentication handled by the cloud service provider. +- `maintenance_window` (Attributes) Custom maintenance window. (see [below for nested schema](#nestedatt--maintenance_window)) +- `pause` (Boolean) Pause cluster. If true it will put the cluster on pause and set the phase as paused, if false it will resume the cluster and set the phase as healthy. Pausing a cluster allows you to save on compute costs without losing data or cluster configuration settings. While paused, clusters aren't upgraded or patched, but changes are applied when the cluster resumes. Pausing a high availability cluster shuts down all cluster nodes +- `pe_allowed_principal_ids` (Set of String) Cloud provider subscription/account ID, need to be specified when cluster is deployed on BigAnimal's cloud account. +- `service_account_ids` (Set of String) A Google Cloud Service Account is used for logs. If you leave this blank, then you will be unable to access log details for this cluster. Required when cluster is deployed on BigAnimal's cloud account. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `cloud_provider` (String) Cloud provider. For example, "aws" or "bah:aws". +- `cluster_name` (String) Name of the cluster. +- `connection_uri` (String) Cluster connection URI. +- `created_at` (String) Cluster creation time. +- `first_recoverability_point_at` (String) Earliest backup recover time. +- `id` (String) Resource ID of the cluster. +- `instance_type` (String) Instance type. For example, "azure:Standard_D2s_v3", "aws:c5.large" or "gcp:e2-highcpu-4". +- `logs_url` (String) The URL to find the logs of this cluster. +- `metrics_url` (String) The URL to find the metrics of this cluster. +- `password` (String) Password for the user edb_admin. It must be 12 characters or more. +- `pg_type` (String) Postgres type. For example, "epas" or "pgextended". +- `pg_version` (String) Postgres version. For example 16 +- `phase` (String) Current phase of the cluster. +- `private_networking` (Boolean) Is private networking enabled. +- `region` (String) Region to deploy the cluster. See [Supported regions](https://www.enterprisedb.com/docs/biganimal/latest/overview/03a_region_support/) for supported regions. +- `resizing_pvc` (List of String) Resizing PVC. + + +### Nested Schema for `allowed_ip_ranges` + +Required: + +- `cidr_block` (String) CIDR block + +Optional: + +- `description` (String) Description of CIDR block + + + +### Nested Schema for `maintenance_window` + +Required: + +- `is_enabled` (Boolean) Is maintenance window enabled. + +Optional: + +- `start_day` (Number) The day of week, 0 represents Sunday, 1 is Monday, and so on. +- `start_time` (String) Start time. "hh:mm", for example: "23:59". + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/docs/data-sources/pgd.md b/docs/data-sources/pgd.md index c9168987..788d9db5 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.10.0" + version = "0.11.0" } } } diff --git a/docs/resources/analytics_cluster.md b/docs/resources/analytics_cluster.md new file mode 100644 index 00000000..4fe5aa55 --- /dev/null +++ b/docs/resources/analytics_cluster.md @@ -0,0 +1,94 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "biganimal_analytics_cluster Resource - terraform-provider-biganimal" +subcategory: "" +description: |- + The analytics cluster resource is used to manage BigAnimal analytics clusters. +--- + +# biganimal_analytics_cluster (Resource) + +The analytics cluster resource is used to manage BigAnimal analytics clusters. + + + + +## Schema + +### Required + +- `cloud_provider` (String) Cloud provider. For example, "aws" or "bah:aws". +- `cluster_name` (String) Name of the cluster. +- `instance_type` (String) Instance type. For example, "azure:Standard_D2s_v3", "aws:c5.large" or "gcp:e2-highcpu-4". +- `password` (String) Password for the user edb_admin. It must be 12 characters or more. +- `pg_type` (String) Postgres type. For example, "epas" or "pgextended". +- `pg_version` (String) Postgres version. For example 16 +- `project_id` (String) BigAnimal Project ID. +- `region` (String) Region to deploy the cluster. See [Supported regions](https://www.enterprisedb.com/docs/biganimal/latest/overview/03a_region_support/) for supported regions. + +### Optional + +- `allowed_ip_ranges` (Attributes Set) Allowed IP ranges. (see [below for nested schema](#nestedatt--allowed_ip_ranges)) +- `backup_retention_period` (String) Backup retention period. For example, "7d", "2w", or "3m". +- `csp_auth` (Boolean) Is authentication handled by the cloud service provider. +- `maintenance_window` (Attributes) Custom maintenance window. (see [below for nested schema](#nestedatt--maintenance_window)) +- `pause` (Boolean) Pause cluster. If true it will put the cluster on pause and set the phase as paused, if false it will resume the cluster and set the phase as healthy. Pausing a cluster allows you to save on compute costs without losing data or cluster configuration settings. While paused, clusters aren't upgraded or patched, but changes are applied when the cluster resumes. Pausing a high availability cluster shuts down all cluster nodes +- `pe_allowed_principal_ids` (Set of String) Cloud provider subscription/account ID, need to be specified when cluster is deployed on BigAnimal's cloud account. +- `private_networking` (Boolean) Is private networking enabled. +- `service_account_ids` (Set of String) A Google Cloud Service Account is used for logs. If you leave this blank, then you will be unable to access log details for this cluster. Required when cluster is deployed on BigAnimal's cloud account. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `cluster_id` (String) Cluster ID. +- `connection_uri` (String) Cluster connection URI. +- `created_at` (String) Cluster creation time. +- `first_recoverability_point_at` (String) Earliest backup recover time. +- `id` (String) Resource ID of the cluster. +- `logs_url` (String) The URL to find the logs of this cluster. +- `metrics_url` (String) The URL to find the metrics of this cluster. +- `phase` (String) Current phase of the cluster. +- `resizing_pvc` (List of String) Resizing PVC. + + +### Nested Schema for `allowed_ip_ranges` + +Required: + +- `cidr_block` (String) CIDR block + +Optional: + +- `description` (String) Description of CIDR block + + + +### Nested Schema for `maintenance_window` + +Required: + +- `is_enabled` (Boolean) Is maintenance window enabled. + +Optional: + +- `start_day` (Number) The day of week, 0 represents Sunday, 1 is Monday, and so on. +- `start_time` (String) Start time. "hh:mm", for example: "23:59". + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + +## Import + +Import is supported using the following syntax: + +```shell +# terraform import biganimal_analytics_cluster. / +terraform import biganimal_analytics_cluster.analytics_cluster prj_deadbeef01234567/p-abcd123456 +``` diff --git a/docs/resources/aws_connection.md b/docs/resources/aws_connection.md index cc33fcb9..563b2c59 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.10.0" + version = "0.11.0" } } } diff --git a/docs/resources/azure_connection.md b/docs/resources/azure_connection.md index b8664ac7..d0e31b72 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.10.0" + version = "0.11.0" } } } diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 483cee6b..29a71385 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -13,7 +13,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -127,7 +127,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/docs/resources/faraway_replica.md b/docs/resources/faraway_replica.md index 41bc427b..2fc90eab 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.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -102,7 +102,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/docs/resources/pgd.md b/docs/resources/pgd.md index 0b714981..d3134269 100644 --- a/docs/resources/pgd.md +++ b/docs/resources/pgd.md @@ -10,7 +10,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -110,7 +110,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -279,7 +279,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -382,7 +382,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -557,7 +557,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -657,7 +657,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -826,7 +826,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -929,7 +929,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -1104,7 +1104,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -1204,7 +1204,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -1373,7 +1373,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -1480,7 +1480,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/docs/resources/project.md b/docs/resources/project.md index 48997a81..a9bf8f1d 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -20,7 +20,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/docs/resources/region.md b/docs/resources/region.md index 8fc26fa4..3d5186f7 100644 --- a/docs/resources/region.md +++ b/docs/resources/region.md @@ -9,7 +9,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_analytics_cluster/provider.tf b/examples/data-sources/biganimal_analytics_cluster/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_aws_connection/provider.tf b/examples/data-sources/biganimal_aws_connection/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_cluster/provider.tf b/examples/data-sources/biganimal_cluster/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_faraway_replica/provider.tf b/examples/data-sources/biganimal_faraway_replica/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_pgd/provider.tf b/examples/data-sources/biganimal_pgd/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_projects/provider.tf b/examples/data-sources/biganimal_projects/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/data-sources/biganimal_region/provider.tf b/examples/data-sources/biganimal_region/provider.tf index 94e312eb..5ac773cb 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.10.0" + version = "0.11.0" } } } diff --git a/examples/resources/biganimal_analytics_cluster/resource.tf b/examples/resources/biganimal_analytics_cluster/aws/resource.tf similarity index 82% rename from examples/resources/biganimal_analytics_cluster/resource.tf rename to examples/resources/biganimal_analytics_cluster/aws/resource.tf index 0def46ca..4acbb74a 100644 --- a/examples/resources/biganimal_analytics_cluster/resource.tf +++ b/examples/resources/biganimal_analytics_cluster/aws/resource.tf @@ -2,7 +2,7 @@ terraform { required_providers { biganimal = { source = "EnterpriseDB/biganimal" - version = "0.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" @@ -61,10 +61,7 @@ resource "biganimal_analytics_cluster" "analytics_cluster" { cloud_provider = "bah:aws" region = "ap-south-1" # pe_allowed_principal_ids = [ - # # AWS example: "123456789012", Azure example: "9334e5e6-7f47-aE61-5A4F-ee067daeEf4A", GCP example: "development-data-123456" - # ] - # service_account_ids = [ - # # ex: "test@development-data-123456.iam.gserviceaccount.com" + # # ex: 123456789012 # ] } diff --git a/examples/resources/biganimal_aws_connection/resource.tf b/examples/resources/biganimal_aws_connection/resource.tf index 2de693c2..8711e4dd 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.10.0" + version = "0.11.0" } } } diff --git a/examples/resources/biganimal_azure_connection/resource.tf b/examples/resources/biganimal_azure_connection/resource.tf index 17b5e7e6..1ac21f05 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.10.0" + version = "0.11.0" } } } diff --git a/examples/resources/biganimal_cluster/ha/resource.tf b/examples/resources/biganimal_cluster/ha/resource.tf index 680c1432..062e2f94 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.10.0" + version = "0.11.0" } 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 ac1dcd18..7a82e664 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.10.0" + version = "0.11.0" } 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 95545117..f381d596 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.10.0" + version = "0.11.0" } 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 42c39566..50b8778f 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.10.0" + version = "0.11.0" } 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 808b2935..fba39945 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.10.0" + version = "0.11.0" } 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 50e827eb..39602080 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.10.0" + version = "0.11.0" } } } diff --git a/examples/resources/biganimal_cluster/single_node/gcp/resource.tf b/examples/resources/biganimal_cluster/single_node/gcp/resource.tf index ba8c99ae..ce51d1dd 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.10.0" + version = "0.11.0" } 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 95545117..f381d596 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.10.0" + version = "0.11.0" } 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 46944e94..f8390544 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.10.0" + version = "0.11.0" } 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 a97d305f..c642f5eb 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.10.0" + version = "0.11.0" } 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 2bab64e8..993e17db 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.10.0" + version = "0.11.0" } 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 56cfb3f8..6e722b37 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.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_faraway_replica/resource.tf b/examples/resources/biganimal_faraway_replica/resource.tf index 46944e94..f8390544 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.10.0" + version = "0.11.0" } 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 80e526ec..5031fc87 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.10.0" + version = "0.11.0" } 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 d1bf3509..4af25c8a 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.10.0" + version = "0.11.0" } 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 75ae73f5..aaac1d5f 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.10.0" + version = "0.11.0" } 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 bbbedb0a..5b47c5f9 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.10.0" + version = "0.11.0" } 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 2211fc7d..52e38352 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.10.0" + version = "0.11.0" } 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 8a4a745a..73d6ff2a 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.10.0" + version = "0.11.0" } 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 9bedfbd0..3bfd7a7b 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.10.0" + version = "0.11.0" } 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 728a397e..fbd60074 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.10.0" + version = "0.11.0" } 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 1eec96d1..01e8c18c 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.10.0" + version = "0.11.0" } 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 329f3a97..66c448ed 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.10.0" + version = "0.11.0" } 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 c21170db..c527e56e 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.10.0" + version = "0.11.0" } 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 f00831c2..66fc713f 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.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_project/resource.tf b/examples/resources/biganimal_project/resource.tf index eec7dc29..55a74404 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.10.0" + version = "0.11.0" } random = { source = "hashicorp/random" diff --git a/examples/resources/biganimal_region/resource.tf b/examples/resources/biganimal_region/resource.tf index f28211aa..5290e020 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.10.0" + version = "0.11.0" } } } diff --git a/pkg/provider/resource_analytics_cluster.go b/pkg/provider/resource_analytics_cluster.go index 636e9708..0b1219f2 100644 --- a/pkg/provider/resource_analytics_cluster.go +++ b/pkg/provider/resource_analytics_cluster.go @@ -271,7 +271,7 @@ func (r *analyticsClusterResource) Create(ctx context.Context, req resource.Crea return } - clusterModel, err := generateGenericAnalyticsClusterModel(ctx, r.client, config) + clusterModel, err := generateAnalyticsClusterModelCreate(ctx, r.client, config) if err != nil { if !appendDiagFromBAErr(err, &resp.Diagnostics) { resp.Diagnostics.AddError("Error creating cluster", err.Error()) @@ -333,7 +333,24 @@ func (r *analyticsClusterResource) Create(ctx context.Context, req resource.Crea resp.Diagnostics.Append(resp.State.Set(ctx, config)...) } -func generateGenericAnalyticsClusterModel(ctx context.Context, client *api.ClusterClient, clusterResource analyticsClusterResourceModel) (models.Cluster, error) { +// uses generateAnalyticsClusterModelCreate but just comments out some fields that are not needed for update +func generateAnalyticsClusterModelUpdate(ctx context.Context, client *api.ClusterClient, clusterResource analyticsClusterResourceModel) (models.Cluster, error) { + cluster, err := generateAnalyticsClusterModelCreate(ctx, client, clusterResource) + if err != nil { + return models.Cluster{}, err + } + + cluster.ClusterId = nil + cluster.PgType = nil + cluster.PgVersion = nil + cluster.Provider = nil + cluster.Region = nil + + return cluster, nil +} + +// used for create operation +func generateAnalyticsClusterModelCreate(ctx context.Context, client *api.ClusterClient, clusterResource analyticsClusterResourceModel) (models.Cluster, error) { cluster := models.Cluster{ ClusterType: utils.ToPointer("analytical"), ClusterName: clusterResource.ClusterName.ValueStringPointer(), @@ -555,7 +572,7 @@ func (r *analyticsClusterResource) Update(ctx context.Context, req resource.Upda } } - clusterModel, err := generateGenericAnalyticsClusterModel(ctx, r.client.ClusterClient(), plan) + clusterModel, err := generateAnalyticsClusterModelUpdate(ctx, r.client.ClusterClient(), plan) if err != nil { if !appendDiagFromBAErr(err, &resp.Diagnostics) { resp.Diagnostics.AddError("Error updating cluster", err.Error())