|
| 1 | +variable "ibmcloud_api_key" { |
| 2 | + type = string |
| 3 | + description = "The IBM Cloud API Key" |
| 4 | + sensitive = true |
| 5 | +} |
| 6 | + |
| 7 | +variable "region" { |
| 8 | + type = string |
| 9 | + description = "Region to provision all resources created by this example." |
| 10 | + default = "us-south" |
| 11 | +} |
| 12 | + |
| 13 | +variable "prefix" { |
| 14 | + type = string |
| 15 | + description = "Prefix to append to all resources created by this example" |
| 16 | + default = "pg" |
| 17 | +} |
| 18 | + |
| 19 | +variable "resource_group" { |
| 20 | + type = string |
| 21 | + description = "An existing resource group name to use for this example, if unset a new resource group will be created" |
| 22 | + default = null |
| 23 | +} |
| 24 | + |
| 25 | +variable "resource_tags" { |
| 26 | + type = list(string) |
| 27 | + description = "Optional list of tags to be added to created resources" |
| 28 | + default = [] |
| 29 | +} |
| 30 | + |
| 31 | +variable "configuration" { |
| 32 | + description = "(Optional, Json String) Database Configuration in JSON format." |
| 33 | + type = object({ |
| 34 | + max_connections = optional(number) |
| 35 | + max_prepared_transactions = optional(number) |
| 36 | + deadlock_timeout = optional(number) |
| 37 | + effective_io_concurrency = optional(number) |
| 38 | + max_replication_slots = optional(number) |
| 39 | + max_wal_senders = optional(number) |
| 40 | + shared_buffers = optional(number) |
| 41 | + synchronous_commit = optional(string) |
| 42 | + wal_level = optional(string) |
| 43 | + archive_timeout = optional(number) |
| 44 | + log_min_duration_statement = optional(number) |
| 45 | + }) |
| 46 | + default = null |
| 47 | +} |
| 48 | + |
| 49 | +variable "pitr_id" { |
| 50 | + type = string |
| 51 | + description = "The ID of the postgresql instance that you want to recover back to. Here ID of the postgresql instance is expected to be up and in running state." |
| 52 | +} |
| 53 | + |
| 54 | +variable "member_memory_mb" { |
| 55 | + type = string |
| 56 | + description = "Memory allocation required for postgresql read-only replica database" |
| 57 | + default = "7680" |
| 58 | + validation { |
| 59 | + condition = alltrue([ |
| 60 | + var.member_memory_mb >= 3072, |
| 61 | + var.member_memory_mb <= 114688 |
| 62 | + ]) |
| 63 | + error_message = "member group memory must be >= 3072 and <= 114688 in increments of 384" |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +variable "member_disk_mb" { |
| 68 | + type = string |
| 69 | + description = "Disk allocation required for postgresql read-only replica database" |
| 70 | + default = "15360" |
| 71 | + validation { |
| 72 | + condition = alltrue([ |
| 73 | + var.member_disk_mb >= 15360, |
| 74 | + var.member_disk_mb <= 4194304 |
| 75 | + ]) |
| 76 | + error_message = "member group disk must be >= 15360 and <= 4194304 in increments of 1536" |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +variable "member_cpu_count" { |
| 81 | + type = string |
| 82 | + description = "CPU allocation required for the postgresql read-only replica database" |
| 83 | + default = "9" |
| 84 | + validation { |
| 85 | + condition = alltrue([ |
| 86 | + var.member_cpu_count >= 9, |
| 87 | + var.member_cpu_count <= 28 |
| 88 | + ]) |
| 89 | + error_message = "member group cpu must be >= 9 and <= 28 in increments of 1" |
| 90 | + } |
| 91 | +} |
0 commit comments