Skip to content

Commit

Permalink
Merge branch 'main' into ww-pg-restore
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/resources/cluster.md
#	examples/resources/biganimal_cluster/ha/resource.tf
#	examples/resources/biganimal_cluster/single_node/aws/resource.tf
#	examples/resources/biganimal_cluster/single_node/azure/resource.tf
#	examples/resources/biganimal_cluster/single_node/bah_aws/resource.tf
#	examples/resources/biganimal_cluster/single_node/bah_azure/resource.tf
#	examples/resources/biganimal_cluster/single_node/bah_gcp/resource.tf
#	examples/resources/biganimal_cluster/single_node/gcp/resource.tf
#	examples/resources/biganimal_cluster/single_node/resource.tf
#	pkg/provider/resource_cluster.go
  • Loading branch information
wai-wong-edb committed Jan 10, 2024
2 parents b7dbad7 + 55fc063 commit e0d4b45
Show file tree
Hide file tree
Showing 21 changed files with 547 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:

# pre-commit hook to verify commit messages are conventional commit compliant
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.2.1
rev: v3.13.0
hooks:
- id: commitizen
stages: [commit-msg]
Expand Down
2 changes: 2 additions & 0 deletions .wordlist-en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ nestedblock
nestedobjatt
pgd
pgextended
pgBouncer
pgvector
postgres
prj
ssd
Expand Down
23 changes: 23 additions & 0 deletions docs/data-sources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ output "service_account_ids" {
- `faraway_replica_ids` (Set of String)
- `most_recent` (Boolean) Show the most recent cluster when there are multiple clusters with the same name.
- `pe_allowed_principal_ids` (Set of String)
- `pg_bouncer` (Attributes) Pg bouncer. (see [below for nested schema](#nestedatt--pg_bouncer))
- `service_account_ids` (Set of String)

### Read-Only
Expand Down Expand Up @@ -179,6 +180,28 @@ Read-Only:
- `description` (String) CIDR block description.


<a id="nestedatt--pg_bouncer"></a>
### Nested Schema for `pg_bouncer`

Required:

- `is_enabled` (Boolean) Is pg bouncer enabled.

Optional:

- `settings` (Attributes Set) PgBouncer Configuration Settings. (see [below for nested schema](#nestedatt--pg_bouncer--settings))

<a id="nestedatt--pg_bouncer--settings"></a>
### Nested Schema for `pg_bouncer.settings`

Required:

- `name` (String) Name.
- `operation` (String) Operation.
- `value` (String) Value.



<a id="nestedatt--cluster_architecture"></a>
### Nested Schema for `cluster_architecture`

Expand Down
57 changes: 57 additions & 0 deletions docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ resource "biganimal_cluster" "single_node_cluster" {
# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"
pgvector = false
pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}
output "password" {
Expand Down Expand Up @@ -192,6 +209,23 @@ resource "biganimal_cluster" "ha_cluster" {
# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"
pgvector = false
pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}
output "password" {
Expand Down Expand Up @@ -246,6 +280,7 @@ Here are the steps to restore a cluster:
- `maintenance_window` (Attributes) Custom maintenance window. (see [below for nested schema](#nestedatt--maintenance_window))
- `most_recent` (Boolean) Show the most recent cluster when there are multiple clusters with the same name.
- `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.
- `pg_bouncer` (Attributes) Pg bouncer. (see [below for nested schema](#nestedatt--pg_bouncer))
- `pg_config` (Block Set) Database configuration parameters. See [Modifying database configuration parameters](https://www.enterprisedb.com/docs/biganimal/latest/using_cluster/03_modifying_your_cluster/05_db_configuration_parameters/) for details. (see [below for nested schema](#nestedblock--pg_config))
- `pgvector` (Boolean) Is pgvector extension enabled. Adds support for vector storage and vector similarity search to Postgres.
- `private_networking` (Boolean) Is private networking enabled.
Expand Down Expand Up @@ -311,6 +346,28 @@ Optional:
- `start_time` (String) Start time. "hh:mm", for example: "23:59".


<a id="nestedatt--pg_bouncer"></a>
### Nested Schema for `pg_bouncer`

Required:

- `is_enabled` (Boolean) Is pg bouncer enabled.

Optional:

- `settings` (Attributes Set) PgBouncer Configuration Settings. (see [below for nested schema](#nestedatt--pg_bouncer--settings))

<a id="nestedatt--pg_bouncer--settings"></a>
### Nested Schema for `pg_bouncer.settings`

Required:

- `name` (String) Name.
- `operation` (String) Operation.
- `value` (String) Value.



<a id="nestedblock--pg_config"></a>
### Nested Schema for `pg_config`

Expand Down
19 changes: 18 additions & 1 deletion examples/resources/biganimal_cluster/ha/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,27 @@ resource "biganimal_cluster" "ha_cluster" {
read_only_connections = true
region = "us-east-1"
superuser_access = true
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
19 changes: 18 additions & 1 deletion examples/resources/biganimal_cluster/single_node/aws/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,27 @@ resource "biganimal_cluster" "single_node_cluster" {
read_only_connections = false
region = "us-east-1"
superuser_access = true
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,27 @@ resource "biganimal_cluster" "single_node_cluster" {
read_only_connections = false
region = "eastus2"
superuser_access = true
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,27 @@ resource "biganimal_cluster" "single_node_cluster" {
cloud_provider = "bah:aws"
read_only_connections = false
region = "us-east-1"
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,28 @@ resource "biganimal_cluster" "single_node_cluster" {
cloud_provider = "bah:azure"
read_only_connections = false
region = "eastus2"
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}

# pe_allowed_principal_ids = [
# <example_value> # ex: "9334e5e6-7f47-aE61-5A4F-ee067daeEf4A"
# ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,27 @@ resource "biganimal_cluster" "single_node_cluster" {
cloud_provider = "bah:gcp"
read_only_connections = false
region = "europe-west1"
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
19 changes: 18 additions & 1 deletion examples/resources/biganimal_cluster/single_node/gcp/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,27 @@ resource "biganimal_cluster" "single_node_cluster" {
read_only_connections = false
region = "us-east1"
superuser_access = true
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
19 changes: 18 additions & 1 deletion examples/resources/biganimal_cluster/single_node/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,27 @@ resource "biganimal_cluster" "single_node_cluster" {
read_only_connections = false
region = "eastus2"
superuser_access = true
pgvector = true
pgvector = false

# restore_cluster_id = "p-123456789" # uncomment to restore cluster
# restore_from_deleted = true
# restore_point = "2006-01-02T15:04:05-0700"

pg_bouncer = {
is_enabled = false
# settings = [ # If is_enabled is true, remove the comment and enter the settings. Should you prefer something different from the defaults.
# {
# name = "autodb_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "5000"
# },
# {
# name = "client_idle_timeout"
# operation = "read-write" #valid values ["read-write", "read-only"]. "read-only" is only valid for ha clusters with read_only_connections set to true
# value = "6000"
# },
# ]
}
}

output "password" {
Expand Down
Loading

0 comments on commit e0d4b45

Please sign in to comment.