Skip to content

Commit c2af86d

Browse files
authored
fix: remove configuration input variable as it is not supported by ICD mongoDB (#228)
1 parent 7be0573 commit c2af86d

File tree

8 files changed

+33
-78
lines changed

8 files changed

+33
-78
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ You need the following permissions to run this module.
7878
| <a name="input_auto_scaling"></a> [auto\_scaling](#input\_auto\_scaling) | Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. See https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-autoscaling&interface=cli#autoscaling-considerations in the IBM Cloud Docs. | <pre>object({<br> disk = object({<br> capacity_enabled = optional(bool, false)<br> free_space_less_than_percent = optional(number, 10)<br> io_above_percent = optional(number, 90)<br> io_enabled = optional(bool, false)<br> io_over_period = optional(string, "15m")<br> rate_increase_percent = optional(number, 10)<br> rate_limit_mb_per_member = optional(number, 3670016)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "mb")<br> })<br> memory = object({<br> io_above_percent = optional(number, 90)<br> io_enabled = optional(bool, false)<br> io_over_period = optional(string, "15m")<br> rate_increase_percent = optional(number, 10)<br> rate_limit_mb_per_member = optional(number, 114688)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "mb")<br> })<br> })</pre> | `null` | no |
7979
| <a name="input_backup_encryption_key_crn"></a> [backup\_encryption\_key\_crn](#input\_backup\_encryption\_key\_crn) | The CRN of a Key Protect key that you want to use for encrypting the disk that holds deployment backups. Only used if var.kms\_encryption\_enabled is set to true. BYOK for backups is available only in US regions us-south and us-east, and in eu-de. Only keys in the us-south and eu-de are durable to region failures. To ensure that your backups are available even if a region failure occurs, use a key from us-south or eu-de. Hyper Protect Crypto Services for IBM Cloud Databases backups is not currently supported. If no value is passed here, the value passed for the 'kms\_key\_crn' variable is used. And if a HPCS value is passed for var.kms\_key\_crn, the database backup encryption uses the default encryption keys. | `string` | `null` | no |
8080
| <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 |
81-
| <a name="input_configuration"></a> [configuration](#input\_configuration) | Database Configuration. | <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 |
8281
| <a name="input_cpu_count"></a> [cpu\_count](#input\_cpu\_count) | Allocated dedicated CPU per member. For shared CPU, set to 0. For more information, see https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `0` | no |
8382
| <a name="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb) | Allocated disk per member. For more information, see https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `10240` | no |
8483
| <a name="input_endpoints"></a> [endpoints](#input\_endpoints) | Specify whether you want to enable the public, private, or both service endpoints. Supported values are 'public', 'private', or 'public-and-private'. | `string` | `"private"` | no |

examples/complete/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ module "mongodb" {
8383
access_tags = var.access_tags
8484
tags = var.resource_tags
8585
service_credential_names = var.service_credential_names
86-
configuration = {
87-
max_connections = 250
88-
}
8986
cbr_rules = [
9087
{
9188
description = "${var.prefix}-mongodb access only from vpc"

main.tf

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,17 @@ resource "time_sleep" "wait_for_authorization_policy" {
4545
}
4646

4747
resource "ibm_database" "mongodb" {
48-
depends_on = [ibm_iam_authorization_policy.kms_policy]
49-
name = var.instance_name
50-
location = var.region
51-
plan = var.plan
52-
service = "databases-for-mongodb"
53-
version = var.mongodb_version
54-
resource_group_id = var.resource_group_id
55-
adminpassword = var.admin_pass
56-
tags = var.tags
57-
service_endpoints = var.endpoints
58-
plan_validation = var.plan_validation
59-
# remove elements with null values: see https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/issues/273
60-
configuration = var.configuration != null ? jsonencode({ for k, v in var.configuration : k => v if v != null }) : null
48+
depends_on = [ibm_iam_authorization_policy.kms_policy]
49+
name = var.instance_name
50+
location = var.region
51+
plan = var.plan
52+
service = "databases-for-mongodb"
53+
version = var.mongodb_version
54+
resource_group_id = var.resource_group_id
55+
adminpassword = var.admin_pass
56+
tags = var.tags
57+
service_endpoints = var.endpoints
58+
plan_validation = var.plan_validation
6159
key_protect_key = var.kms_key_crn
6260
backup_encryption_key_crn = local.backup_encryption_key_crn
6361

module-metadata.json

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
],
3333
"pos": {
3434
"filename": "variables.tf",
35-
"line": 135
35+
"line": 123
3636
}
3737
},
3838
"auto_scaling": {
@@ -41,7 +41,7 @@
4141
"description": "Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. See https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-autoscaling\u0026interface=cli#autoscaling-considerations in the IBM Cloud Docs.",
4242
"pos": {
4343
"filename": "variables.tf",
44-
"line": 154
44+
"line": 142
4545
}
4646
},
4747
"backup_encryption_key_crn": {
@@ -50,7 +50,7 @@
5050
"description": "The CRN of a Key Protect key that you want to use for encrypting the disk that holds deployment backups. Only used if var.kms_encryption_enabled is set to true. BYOK for backups is available only in US regions us-south and us-east, and in eu-de. Only keys in the us-south and eu-de are durable to region failures. To ensure that your backups are available even if a region failure occurs, use a key from us-south or eu-de. Hyper Protect Crypto Services for IBM Cloud Databases backups is not currently supported. If no value is passed here, the value passed for the 'kms_key_crn' variable is used. And if a HPCS value is passed for var.kms_key_crn, the database backup encryption uses the default encryption keys.",
5151
"pos": {
5252
"filename": "variables.tf",
53-
"line": 205
53+
"line": 193
5454
}
5555
},
5656
"cbr_rules": {
@@ -67,19 +67,7 @@
6767
],
6868
"pos": {
6969
"filename": "variables.tf",
70-
"line": 231
71-
}
72-
},
73-
"configuration": {
74-
"name": "configuration",
75-
"type": "object({\n maxmemory = optional(number)\n maxmemory-policy = optional(string)\n appendonly = optional(string)\n maxmemory-samples = optional(number)\n stop-writes-on-bgsave-error = optional(string)\n })",
76-
"description": "Database Configuration.",
77-
"source": [
78-
"ibm_database.mongodb.configuration"
79-
],
80-
"pos": {
81-
"filename": "variables.tf",
82-
"line": 48
70+
"line": 219
8371
}
8472
},
8573
"cpu_count": {
@@ -89,7 +77,7 @@
8977
"default": 0,
9078
"pos": {
9179
"filename": "variables.tf",
92-
"line": 110
80+
"line": 98
9381
}
9482
},
9583
"disk_mb": {
@@ -99,7 +87,7 @@
9987
"default": 10240,
10088
"pos": {
10189
"filename": "variables.tf",
102-
"line": 103
90+
"line": 91
10391
}
10492
},
10593
"endpoints": {
@@ -114,7 +102,7 @@
114102
],
115103
"pos": {
116104
"filename": "variables.tf",
117-
"line": 85
105+
"line": 73
118106
},
119107
"options": "public, private, public-and-private"
120108
},
@@ -127,7 +115,7 @@
127115
],
128116
"pos": {
129117
"filename": "variables.tf",
130-
"line": 221
118+
"line": 209
131119
},
132120
"immutable": true,
133121
"computed": true
@@ -155,7 +143,7 @@
155143
],
156144
"pos": {
157145
"filename": "variables.tf",
158-
"line": 185
146+
"line": 173
159147
}
160148
},
161149
"kms_key_crn": {
@@ -167,7 +155,7 @@
167155
],
168156
"pos": {
169157
"filename": "variables.tf",
170-
"line": 191
158+
"line": 179
171159
},
172160
"immutable": true
173161
},
@@ -178,7 +166,7 @@
178166
"default": 3,
179167
"pos": {
180168
"filename": "variables.tf",
181-
"line": 117
169+
"line": 105
182170
}
183171
},
184172
"memory_mb": {
@@ -188,7 +176,7 @@
188176
"default": 1024,
189177
"pos": {
190178
"filename": "variables.tf",
191-
"line": 96
179+
"line": 84
192180
}
193181
},
194182
"mongodb_version": {
@@ -200,7 +188,7 @@
200188
],
201189
"pos": {
202190
"filename": "variables.tf",
203-
"line": 60
191+
"line": 48
204192
},
205193
"immutable": true,
206194
"computed": true
@@ -261,7 +249,7 @@
261249
],
262250
"pos": {
263251
"filename": "variables.tf",
264-
"line": 74
252+
"line": 62
265253
},
266254
"cloud_data_type": "resource_group",
267255
"immutable": true,
@@ -280,7 +268,7 @@
280268
],
281269
"pos": {
282270
"filename": "variables.tf",
283-
"line": 124
271+
"line": 112
284272
}
285273
},
286274
"skip_iam_authorization_policy": {
@@ -290,7 +278,7 @@
290278
"default": false,
291279
"pos": {
292280
"filename": "variables.tf",
293-
"line": 215
281+
"line": 203
294282
}
295283
},
296284
"tags": {
@@ -303,7 +291,7 @@
303291
],
304292
"pos": {
305293
"filename": "variables.tf",
306-
"line": 79
294+
"line": 67
307295
}
308296
},
309297
"users": {
@@ -319,7 +307,7 @@
319307
],
320308
"pos": {
321309
"filename": "variables.tf",
322-
"line": 142
310+
"line": 130
323311
}
324312
}
325313
},
@@ -432,7 +420,6 @@
432420
"name": "mongodb",
433421
"attributes": {
434422
"adminpassword": "admin_pass",
435-
"configuration": "configuration",
436423
"key_protect_key": "kms_key_crn",
437424
"location": "region",
438425
"name": "instance_name",
@@ -481,7 +468,7 @@
481468
},
482469
"pos": {
483470
"filename": "main.tf",
484-
"line": 183
471+
"line": 181
485472
}
486473
},
487474
"ibm_resource_tag.mongodb_tag": {
@@ -497,7 +484,7 @@
497484
},
498485
"pos": {
499486
"filename": "main.tf",
500-
"line": 132
487+
"line": 130
501488
}
502489
},
503490
"time_sleep.wait_for_authorization_policy": {
@@ -529,7 +516,7 @@
529516
},
530517
"pos": {
531518
"filename": "main.tf",
532-
"line": 211
519+
"line": 209
533520
}
534521
}
535522
},
@@ -608,7 +595,7 @@
608595
},
609596
"pos": {
610597
"filename": "main.tf",
611-
"line": 143
598+
"line": 141
612599
}
613600
}
614601
}

profiles/fscloud/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ No resources.
3636
| <a name="input_admin_pass"></a> [admin\_pass](#input\_admin\_pass) | The password for the database administrator. If the admin password is null then the admin user ID cannot be accessed. More users can be specified in a user block. The admin password must be in the range of 10-32 characters. | `string` | `null` | no |
3737
| <a name="input_auto_scaling"></a> [auto\_scaling](#input\_auto\_scaling) | Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. See https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-autoscaling&interface=cli#autoscaling-considerations in the IBM Cloud Docs. | <pre>object({<br> disk = object({<br> capacity_enabled = optional(bool, false)<br> free_space_less_than_percent = optional(number, 10)<br> io_above_percent = optional(number, 90)<br> io_enabled = optional(bool, false)<br> io_over_period = optional(string, "15m")<br> rate_increase_percent = optional(number, 10)<br> rate_limit_mb_per_member = optional(number, 3670016)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "mb")<br> })<br> memory = object({<br> io_above_percent = optional(number, 90)<br> io_enabled = optional(bool, false)<br> io_over_period = optional(string, "15m")<br> rate_increase_percent = optional(number, 10)<br> rate_limit_mb_per_member = optional(number, 114688)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "mb")<br> })<br> })</pre> | `null` | no |
3838
| <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 |
39-
| <a name="input_configuration"></a> [configuration](#input\_configuration) | Database Configuration. | <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 |
4039
| <a name="input_cpu_count"></a> [cpu\_count](#input\_cpu\_count) | Allocated dedicated CPU per member. For shared CPU, set to 0. For more information, see https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `6` | no |
4140
| <a name="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb) | Allocated disk per member. For more information, see https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-pricing#mongodb-scale-member | `number` | `20480` | no |
4241
| <a name="input_existing_kms_instance_guid"></a> [existing\_kms\_instance\_guid](#input\_existing\_kms\_instance\_guid) | The GUID of the Hyper Protect Crypto Services instance. | `string` | n/a | yes |

profiles/fscloud/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module "mongodb" {
1313
cbr_rules = var.cbr_rules
1414
access_tags = var.access_tags
1515
tags = var.tags
16-
configuration = var.configuration
1716
plan = var.plan
1817
members = var.members
1918
memory_mb = var.memory_mb

profiles/fscloud/variables.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@ variable "region" {
2525
default = "us-south"
2626
}
2727

28-
variable "configuration" {
29-
description = "Database Configuration."
30-
type = object({
31-
maxmemory = optional(number)
32-
maxmemory-policy = optional(string)
33-
appendonly = optional(string)
34-
maxmemory-samples = optional(number)
35-
stop-writes-on-bgsave-error = optional(string)
36-
})
37-
default = null
38-
}
39-
4028
variable "plan" {
4129
type = string
4230
description = "The name of the service plan that you choose for your MongoDB instance"

variables.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ variable "access_tags" {
4545
}
4646
}
4747

48-
variable "configuration" {
49-
description = "Database Configuration."
50-
type = object({
51-
maxmemory = optional(number)
52-
maxmemory-policy = optional(string)
53-
appendonly = optional(string)
54-
maxmemory-samples = optional(number)
55-
stop-writes-on-bgsave-error = optional(string)
56-
})
57-
default = null
58-
}
59-
6048
variable "mongodb_version" {
6149
type = string
6250
description = "The version of the MongoDB to provision. If no value passed, the current ICD preferred version is used."

0 commit comments

Comments
 (0)