-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for provisioning PgBouncer with PostgreSQL (#158)
* Bumped version & added support for PgBouncer bundle * Added tests for valid/invalid pgbouncer plan * Updated comments * Renamed test to show intent * Included PgBouncer in postgresql example * Update integration test * Updated version and poolMode schema docs * - Added options to `AddOnBundle`, and handled addon bundle options mapping. - Updated doc with new docs link. * Added tests for addon bundle decoding * Added test steps for reapplying * Bump version * Updated postgres version after merge
- Loading branch information
1 parent
cd1f8aa
commit 47f9a44
Showing
10 changed files
with
398 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
acc_test/data/invalid_postgresql_pgbouncer_cluster_create.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
provider "instaclustr" { | ||
username = "%s" | ||
api_key = "%s" | ||
api_hostname = "%s" | ||
} | ||
|
||
resource "instaclustr_cluster" "invalidPostgresqlWithPgBouncer" { | ||
cluster_name = "testcluster" | ||
node_size = "PGS-DEV-t3.small-5" | ||
data_centre = "US_WEST_2" | ||
sla_tier = "NON_PRODUCTION" | ||
cluster_network = "192.168.0.0/18" | ||
cluster_provider = { | ||
name = "AWS_VPC" | ||
} | ||
rack_allocation = { | ||
nodes_per_rack = 1 | ||
number_of_racks = 1 | ||
} | ||
|
||
bundle { | ||
bundle = "POSTGRESQL" | ||
version = "14.1" | ||
options = { | ||
postgresql_node_count = 1, | ||
client_encryption = false, | ||
replication_mode = "SYNCHRONOUS", | ||
} | ||
} | ||
//Will fail due to invalid pool_mode | ||
bundle { | ||
bundle = "PGBOUNCER" | ||
version = "1.17.0" | ||
options = { | ||
pool_mode = "foobar" | ||
} | ||
} | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
acc_test/data/valid_postgresql_cluster_with_pgbouncer_create.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
provider "instaclustr" { | ||
username = "%s" | ||
api_key = "%s" | ||
api_hostname = "%s" | ||
} | ||
|
||
resource "instaclustr_cluster" "validPostgresqlWithPgBouncer" { | ||
cluster_name = "testcluster" | ||
node_size = "PGS-DEV-t3.small-5" | ||
data_centre = "US_WEST_2" | ||
sla_tier = "NON_PRODUCTION" | ||
cluster_network = "192.168.0.0/18" | ||
cluster_provider = { | ||
name = "AWS_VPC" | ||
} | ||
rack_allocation = { | ||
nodes_per_rack = 1 | ||
number_of_racks = 1 | ||
} | ||
|
||
bundle { | ||
bundle = "POSTGRESQL" | ||
version = "14.1" | ||
options = { | ||
postgresql_node_count = 1, | ||
client_encryption = false, | ||
replication_mode = "SYNCHRONOUS", | ||
} | ||
} | ||
|
||
bundle { | ||
bundle = "PGBOUNCER" | ||
version = "1.17.0" | ||
options = { | ||
pool_mode = "SESSION" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.