Skip to content

Commit 6c135c6

Browse files
committed
feat(postgres): Set edition to enterprise by default
1 parent 67d7b74 commit 6c135c6

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

google_cloudsql_postgres/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ output "postgres_database" {
5151
| Name | Description | Type | Default | Required |
5252
|------|-------------|------|---------|:--------:|
5353
| <a name="input_application"></a> [application](#input\_application) | Application e.g., bouncer. | `any` | n/a | yes |
54-
| <a name="input_environment"></a> [environment](#input\_environment) | Environment e.g., stage. | `any` | n/a | yes |
55-
| <a name="input_realm"></a> [realm](#input\_realm) | Realm e.g., nonprod. | `any` | n/a | yes |
5654
| <a name="input_authorized_networks"></a> [authorized\_networks](#input\_authorized\_networks) | n/a | `list` | `[]` | no |
5755
| <a name="input_availability_type"></a> [availability\_type](#input\_availability\_type) | high availability (REGIONAL) or single zone (ZONAL) | `string` | `"REGIONAL"` | no |
5856
| <a name="input_component"></a> [component](#input\_component) | A logical component of an application | `string` | `"db"` | no |
@@ -64,16 +62,19 @@ output "postgres_database" {
6462
| <a name="input_db_mem_gb"></a> [db\_mem\_gb](#input\_db\_mem\_gb) | See: https://cloud.google.com/sql/pricing#2nd-gen-pricing | `string` | `"12"` | no |
6563
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | Whether the instance is protected from deletion (TF) | `bool` | `true` | no |
6664
| <a name="input_deletion_protection_enabled"></a> [deletion\_protection\_enabled](#input\_deletion\_protection\_enabled) | Whether the instance is protected from deletion (API) | `bool` | `true` | no |
65+
| <a name="input_edition"></a> [edition](#input\_edition) | Sets the edition, default to ENTERPRISE | `string` | `"ENTERPRISE"` | no |
6766
| <a name="input_enable_insights_config_on_replica"></a> [enable\_insights\_config\_on\_replica](#input\_enable\_insights\_config\_on\_replica) | If true, will allow enable insights config on replica | `bool` | `false` | no |
6867
| <a name="input_enable_private_path_for_google_cloud_services"></a> [enable\_private\_path\_for\_google\_cloud\_services](#input\_enable\_private\_path\_for\_google\_cloud\_services) | If true, will allow Google Cloud Services access over private IP. | `bool` | `false` | no |
6968
| <a name="input_enable_public_ip"></a> [enable\_public\_ip](#input\_enable\_public\_ip) | If true, will assign a public IP to database instance. | `bool` | `false` | no |
69+
| <a name="input_environment"></a> [environment](#input\_environment) | Environment e.g., stage. | `any` | n/a | yes |
7070
| <a name="input_instance_version"></a> [instance\_version](#input\_instance\_version) | Version of database. Use this field if you need to spin up a new database instance. | `string` | `"v1"` | no |
7171
| <a name="input_ip_configuration_require_ssl"></a> [ip\_configuration\_require\_ssl](#input\_ip\_configuration\_require\_ssl) | n/a | `bool` | `true` | no |
7272
| <a name="input_maintenance_window_day"></a> [maintenance\_window\_day](#input\_maintenance\_window\_day) | n/a | `number` | `1` | no |
7373
| <a name="input_maintenance_window_hour"></a> [maintenance\_window\_hour](#input\_maintenance\_window\_hour) | n/a | `number` | `17` | no |
7474
| <a name="input_maintenance_window_update_track"></a> [maintenance\_window\_update\_track](#input\_maintenance\_window\_update\_track) | n/a | `string` | `"stable"` | no |
7575
| <a name="input_network"></a> [network](#input\_network) | Network where the private peering should attach. | `string` | `"default"` | no |
7676
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | `null` | no |
77+
| <a name="input_realm"></a> [realm](#input\_realm) | Realm e.g., nonprod. | `any` | n/a | yes |
7778
| <a name="input_region"></a> [region](#input\_region) | Region where database should be provisioned. | `string` | `"us-west1"` | no |
7879
| <a name="input_replica_availability_type"></a> [replica\_availability\_type](#input\_replica\_availability\_type) | Allow setting availability configuration of replica | `string` | `"ZONAL"` | no |
7980
| <a name="input_replica_count"></a> [replica\_count](#input\_replica\_count) | n/a | `number` | `0` | no |

google_cloudsql_postgres/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ resource "google_sql_database_instance" "primary" {
3333
deletion_protection_enabled = var.deletion_protection_enabled
3434
tier = local.tier
3535
availability_type = var.availability_type
36+
edition = var.edition
3637

3738
backup_configuration {
3839
enabled = true
@@ -112,6 +113,7 @@ resource "google_sql_database_instance" "replica" {
112113
deletion_protection_enabled = var.deletion_protection_enabled
113114
tier = local.replica_tier
114115
availability_type = var.replica_availability_type
116+
edition = var.edition
115117

116118
dynamic "insights_config" {
117119
for_each = var.enable_insights_config_on_replica ? range(1) : []

google_cloudsql_postgres/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,8 @@ variable "replica_region_override" {
156156
description = "This OVERRIDES var.region for replicas (replicas use var.region per default)."
157157
default = null
158158
}
159+
160+
variable "edition" {
161+
description = "Sets the edition, default to ENTERPRISE"
162+
default = "ENTERPRISE"
163+
}

0 commit comments

Comments
 (0)