-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: BAH Azure for PG clusters (#363)
- Loading branch information
1 parent
1e796f2
commit 8bad36b
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
examples/resources/biganimal_cluster/single_node/bah_azure/resource.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,93 @@ | ||
terraform { | ||
required_providers { | ||
biganimal = { | ||
source = "EnterpriseDB/biganimal" | ||
version = "0.6.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.5.1" | ||
} | ||
} | ||
} | ||
|
||
resource "random_password" "password" { | ||
length = 16 | ||
special = true | ||
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
} | ||
|
||
variable "cluster_name" { | ||
type = string | ||
description = "The name of the cluster." | ||
} | ||
|
||
variable "project_id" { | ||
type = string | ||
description = "BigAnimal Project ID" | ||
} | ||
|
||
resource "biganimal_cluster" "single_node_cluster" { | ||
cluster_name = var.cluster_name | ||
project_id = var.project_id | ||
|
||
allowed_ip_ranges { | ||
cidr_block = "127.0.0.1/32" | ||
description = "localhost" | ||
} | ||
|
||
allowed_ip_ranges { | ||
cidr_block = "192.168.0.1/32" | ||
description = "description!" | ||
} | ||
|
||
backup_retention_period = "6d" | ||
cluster_architecture { | ||
id = "single" | ||
nodes = 1 | ||
} | ||
csp_auth = false | ||
|
||
instance_type = "azure:Standard_D2s_v3" | ||
password = resource.random_password.password.result | ||
pg_config { | ||
name = "application_name" | ||
value = "created through terraform" | ||
} | ||
|
||
pg_config { | ||
name = "array_nulls" | ||
value = "off" | ||
} | ||
|
||
storage { | ||
volume_type = "azurepremiumstorage" | ||
volume_properties = "P1" | ||
size = "4 Gi" | ||
} | ||
|
||
maintenance_window = { | ||
is_enabled = true | ||
start_day = 6 | ||
start_time = "03:00" | ||
} | ||
|
||
pg_type = "epas" | ||
pg_version = "15" | ||
private_networking = false | ||
cloud_provider = "bah:azure" | ||
read_only_connections = false | ||
region = "eastus2" | ||
# pe_allowed_principal_ids = [ | ||
# <example_value> # ex: "9334e5e6-7f47-aE61-5A4F-ee067daeEf4A" | ||
# ] | ||
} | ||
|
||
output "password" { | ||
sensitive = true | ||
value = resource.biganimal_cluster.single_node_cluster.password | ||
} | ||
|
||
output "faraway_replica_ids" { | ||
value = biganimal_cluster.single_node_cluster.faraway_replica_ids | ||
} |