Skip to content

Commit 3eec007

Browse files
fix: removed validation from variables so they don't become out of date, and point to official docs instead (#151)
1 parent 9a5fc4f commit 3eec007

File tree

3 files changed

+14
-38
lines changed

3 files changed

+14
-38
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ You need the following permissions to run this module.
7474
| <a name="input_backup_encryption_key_crn"></a> [backup\_encryption\_key\_crn](#input\_backup\_encryption\_key\_crn) | (Optional) The CRN of a Key Protect Key to use for encrypting backups. If left null, the value passed for the 'kms\_key\_crn' variable will be used. Take note that Hyper Protect Crypto Services for IBM Cloud® Databases backups is not currently supported. | `string` | `null` | no |
7575
| <a name="input_cbr_rules"></a> [cbr\_rules](#input\_cbr\_rules) | (Optional, list) List of CBR rules to create | <pre>list(object({<br> description = string<br> account_id = string<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> }))</pre> | `[]` | no |
7676
| <a name="input_configuration"></a> [configuration](#input\_configuration) | Database Configuration in JSON format. | <pre>object({<br> maxmemory = optional(number)<br> maxmemory-policy = optional(string)<br> appendonly = optional(string)<br> maxmemory-samples = optional(number)<br> stop-writes-on-bgsave-error = optional(string)<br> })</pre> | `null` | no |
77-
| <a name="input_cpu_count"></a> [cpu\_count](#input\_cpu\_count) | Number of CPU cores available to the mongodb instance | `number` | `7` | no |
78-
| <a name="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb) | Disk available to the mongodb instance | `number` | `20480` | no |
77+
| <a name="input_cpu_count"></a> [cpu\_count](#input\_cpu\_count) | The number of CPU cores available to the database instance. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `7` | no |
78+
| <a name="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb) | Disk space available to the database instance. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `20480` | no |
7979
| <a name="input_endpoints"></a> [endpoints](#input\_endpoints) | Endpoints available to the mongodb instance (public, private, public-and-private) | `string` | `"private"` | no |
8080
| <a name="input_existing_kms_instance_guid"></a> [existing\_kms\_instance\_guid](#input\_existing\_kms\_instance\_guid) | The GUID of the Hyper Protect or Key Protect instance in which the key specified in var.kms\_key\_crn is coming from. Only required if skip\_iam\_authorization\_policy is false | `string` | `null` | no |
8181
| <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | Name of the MongoDB instance | `string` | n/a | yes |
8282
| <a name="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn) | (Optional) The root key CRN of a Key Management Service like Key Protect or Hyper Protect Crypto Service (HPCS) that you want to use for disk encryption. If `null`, database is encrypted by using randomly generated keys. See https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok for current list of supported regions for BYOK | `string` | `null` | no |
8383
| <a name="input_members"></a> [members](#input\_members) | Allocated number of members | `number` | `3` | no |
84-
| <a name="input_memory_mb"></a> [memory\_mb](#input\_memory\_mb) | Memory available to the mongodb instance | `number` | `1024` | no |
84+
| <a name="input_memory_mb"></a> [memory\_mb](#input\_memory\_mb) | Memory available to the database instance in MB. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `1024` | no |
8585
| <a name="input_mongodb_version"></a> [mongodb\_version](#input\_mongodb\_version) | The version of the mongodb to be provisioned | `string` | `null` | no |
8686
| <a name="input_plan"></a> [plan](#input\_plan) | The name of the service plan that you choose for your mongodb instance | `string` | `"standard"` | no |
8787
| <a name="input_region"></a> [region](#input\_region) | The region MongoDB is to be created on. The region must support BYOK region if Key Protect Key is used or KYOK region if Hyper Protect Crypto Service (HPCS) is used. | `string` | `"us-south"` | no |

module-metadata.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"description": "Configure rules to allow your database to automatically increase its resources. Single block of autoscaling is allowed at once.",
1818
"pos": {
1919
"filename": "variables.tf",
20-
"line": 166
20+
"line": 142
2121
}
2222
},
2323
"backup_encryption_key_crn": {
@@ -43,7 +43,7 @@
4343
],
4444
"pos": {
4545
"filename": "variables.tf",
46-
"line": 201
46+
"line": 177
4747
}
4848
},
4949
"configuration": {
@@ -61,21 +61,21 @@
6161
"cpu_count": {
6262
"name": "cpu_count",
6363
"type": "number",
64-
"description": "Number of CPU cores available to the mongodb instance",
64+
"description": "The number of CPU cores available to the database instance. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member",
6565
"default": 7,
6666
"pos": {
6767
"filename": "variables.tf",
68-
"line": 138
68+
"line": 122
6969
}
7070
},
7171
"disk_mb": {
7272
"name": "disk_mb",
7373
"type": "number",
74-
"description": "Disk available to the mongodb instance",
74+
"description": "Disk space available to the database instance. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member",
7575
"default": 20480,
7676
"pos": {
7777
"filename": "variables.tf",
78-
"line": 124
78+
"line": 116
7979
}
8080
},
8181
"endpoints": {
@@ -139,13 +139,13 @@
139139
"default": 3,
140140
"pos": {
141141
"filename": "variables.tf",
142-
"line": 153
142+
"line": 129
143143
}
144144
},
145145
"memory_mb": {
146146
"name": "memory_mb",
147147
"type": "number",
148-
"description": "Memory available to the mongodb instance",
148+
"description": "Memory available to the database instance in MB. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member",
149149
"default": 1024,
150150
"pos": {
151151
"filename": "variables.tf",

variables.tf

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -109,44 +109,20 @@ variable "backup_encryption_key_crn" {
109109

110110
variable "memory_mb" {
111111
type = number
112-
description = "Memory available to the mongodb instance"
112+
description = "Memory available to the database instance in MB. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member"
113113
default = 1024
114-
115-
validation {
116-
condition = alltrue([
117-
var.memory_mb >= 1024,
118-
var.memory_mb <= 114688
119-
])
120-
error_message = "Member group memory must be >= 1024 and <= 114688 in increments of 128."
121-
}
122114
}
123115

124116
variable "disk_mb" {
125117
type = number
126-
description = "Disk available to the mongodb instance"
118+
description = "Disk space available to the database instance. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member"
127119
default = 20480
128-
129-
validation {
130-
condition = alltrue([
131-
var.disk_mb >= 5120,
132-
var.disk_mb <= 4194304
133-
])
134-
error_message = "Member group disk must be >= 5120 and <= 4194304 in increments of 1024."
135-
}
136120
}
137121

138122
variable "cpu_count" {
139123
type = number
140-
description = "Number of CPU cores available to the mongodb instance"
124+
description = "The number of CPU cores available to the database instance. For more information refer to the docs https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member"
141125
default = 7
142-
143-
validation {
144-
condition = alltrue([
145-
var.cpu_count >= 6,
146-
var.cpu_count <= 28
147-
])
148-
error_message = "Number of cpus must be >= 6 and <= 28 in increments of 1."
149-
}
150126
}
151127

152128

0 commit comments

Comments
 (0)