Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit c352eac

Browse files
authored
fix: remove configuration input variable as its not supported by ICD etcd (#41)
1 parent c2a746d commit c352eac

File tree

9 files changed

+23
-76
lines changed

9 files changed

+23
-76
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ You need the following permissions to run this module.
7979
| <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-etcd?topic=databases-for-etcd-autoscaling 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 |
8080
| <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 disk that holds deployment backups. Only used if var.kms\_encryption\_enabled is set to true. If no value passed, the value passed for the 'kms\_key\_crn' variable will be used. BYOK for backups is available only in US regions us-south and us-east, and 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, you must use a key from us-south or eu-de. Take note that Hyper Protect Crypto Services for IBM Cloud® Databases backups is not currently supported, so if no value is passed here, but a HPCS value is passed for var.kms\_key\_crn, databases backup encryption will use the default encryption keys. | `string` | `null` | no |
8181
| <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 |
82-
| <a name="input_configuration"></a> [configuration](#input\_configuration) | Database Configuration | <pre>object({<br> max_connections = optional(number)<br> max_prepared_transactions = optional(number)<br> deadlock_timeout = optional(number)<br> effective_io_concurrency = optional(number)<br> max_replication_slots = optional(number)<br> max_wal_senders = optional(number)<br> shared_buffers = optional(number)<br> synchronous_commit = optional(string)<br> wal_level = optional(string)<br> archive_timeout = optional(number)<br> log_min_duration_statement = optional(number)<br> })</pre> | `null` | no |
8382
| <a name="input_etcd_version"></a> [etcd\_version](#input\_etcd\_version) | Version of the etcd instance to provision. If no value passed, the current ICD preferred version is used. | `string` | `null` | no |
8483
| <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 and var.backup\_encryption\_key\_crn is coming from. Only required if var.kms\_encryption\_enabled is 'true', var.skip\_iam\_authorization\_policy is 'false', and passing a value for var.kms\_key\_crn and/or var.backup\_encryption\_key\_crn. | `string` | `null` | no |
8584
| <a name="input_kms_encryption_enabled"></a> [kms\_encryption\_enabled](#input\_kms\_encryption\_enabled) | Set this to true to control the encryption keys used to encrypt the data that you store in IBM Cloud® Databases. If set to false, the data is encrypted by using randomly generated keys. For more info on Key Protect integration, see https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect. For more info on HPCS integration, see https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs | `bool` | `false` | no |

examples/complete/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ An end-to-end example that provisions the following infrastructure:
55
- A resource group, if one is not passed in.
66
- A Key Protect instance with a root key.
77
- An instance of Databases for etcd with BYOK encryption and autoscaling.
8-
- Set 250 max connection for Databases for etcd instance.
98
- Service credentials for the database instance.

examples/complete/main.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,4 @@ module "etcd_db" {
4242
tags = var.resource_tags
4343
access_tags = var.access_tags
4444
service_credential_names = var.service_credential_names
45-
configuration = {
46-
max_connections = 250
47-
}
4845
}

main.tf

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,17 @@ resource "ibm_iam_authorization_policy" "policy" {
4040

4141
# Create etcd database
4242
resource "ibm_database" "etcd_db" {
43-
depends_on = [ibm_iam_authorization_policy.policy]
44-
resource_group_id = var.resource_group_id
45-
name = var.name
46-
service = "databases-for-etcd"
47-
location = var.region
48-
plan = "standard" # Only standard plan is available for etcd
49-
plan_validation = var.plan_validation
50-
version = var.etcd_version
51-
tags = var.tags
52-
adminpassword = var.admin_pass
53-
service_endpoints = var.service_endpoints
54-
# remove elements with null values: see https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/issues/273
55-
configuration = var.configuration != null ? jsonencode({ for k, v in var.configuration : k => v if v != null }) : null
56-
43+
depends_on = [ibm_iam_authorization_policy.policy]
44+
resource_group_id = var.resource_group_id
45+
name = var.name
46+
service = "databases-for-etcd"
47+
location = var.region
48+
plan = "standard" # Only standard plan is available for etcd
49+
plan_validation = var.plan_validation
50+
version = var.etcd_version
51+
tags = var.tags
52+
adminpassword = var.admin_pass
53+
service_endpoints = var.service_endpoints
5754
key_protect_key = var.kms_key_crn
5855
backup_encryption_key_crn = local.backup_encryption_key_crn
5956

module-metadata.json

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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-etcd?topic=databases-for-etcd-autoscaling in the IBM Cloud Docs.",
4242
"pos": {
4343
"filename": "variables.tf",
44-
"line": 151
44+
"line": 133
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 disk that holds deployment backups. Only used if var.kms_encryption_enabled is set to true. If no value passed, the value passed for the 'kms_key_crn' variable will be used. BYOK for backups is available only in US regions us-south and us-east, and 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, you must use a key from us-south or eu-de. Take note that Hyper Protect Crypto Services for IBM Cloud® Databases backups is not currently supported, so if no value is passed here, but a HPCS value is passed for var.kms_key_crn, databases backup encryption will use the default encryption keys.",
5151
"pos": {
5252
"filename": "variables.tf",
53-
"line": 202
53+
"line": 184
5454
}
5555
},
5656
"cbr_rules": {
@@ -67,19 +67,7 @@
6767
],
6868
"pos": {
6969
"filename": "variables.tf",
70-
"line": 228
71-
}
72-
},
73-
"configuration": {
74-
"name": "configuration",
75-
"type": "object({\n max_connections = optional(number)\n max_prepared_transactions = optional(number)\n deadlock_timeout = optional(number)\n effective_io_concurrency = optional(number)\n max_replication_slots = optional(number)\n max_wal_senders = optional(number)\n shared_buffers = optional(number)\n synchronous_commit = optional(string)\n wal_level = optional(string)\n archive_timeout = optional(number)\n log_min_duration_statement = optional(number)\n })",
76-
"description": "Database Configuration",
77-
"source": [
78-
"ibm_database.etcd_db.configuration"
79-
],
80-
"pos": {
81-
"filename": "variables.tf",
82-
"line": 118
70+
"line": 210
8371
}
8472
},
8573
"etcd_version": {
@@ -105,7 +93,7 @@
10593
],
10694
"pos": {
10795
"filename": "variables.tf",
108-
"line": 218
96+
"line": 200
10997
},
11098
"immutable": true,
11199
"computed": true
@@ -120,7 +108,7 @@
120108
],
121109
"pos": {
122110
"filename": "variables.tf",
123-
"line": 182
111+
"line": 164
124112
}
125113
},
126114
"kms_key_crn": {
@@ -132,7 +120,7 @@
132120
],
133121
"pos": {
134122
"filename": "variables.tf",
135-
"line": 188
123+
"line": 170
136124
},
137125
"immutable": true
138126
},
@@ -247,7 +235,7 @@
247235
],
248236
"pos": {
249237
"filename": "variables.tf",
250-
"line": 136
238+
"line": 118
251239
}
252240
},
253241
"service_endpoints": {
@@ -273,7 +261,7 @@
273261
"default": false,
274262
"pos": {
275263
"filename": "variables.tf",
276-
"line": 212
264+
"line": 194
277265
}
278266
},
279267
"tags": {
@@ -409,7 +397,6 @@
409397
"name": "etcd_db",
410398
"attributes": {
411399
"adminpassword": "admin_pass",
412-
"configuration": "configuration",
413400
"key_protect_key": "kms_key_crn",
414401
"location": "region",
415402
"name": "name",
@@ -456,7 +443,7 @@
456443
},
457444
"pos": {
458445
"filename": "main.tf",
459-
"line": 175
446+
"line": 172
460447
}
461448
},
462449
"ibm_resource_tag.etcd_tag": {
@@ -472,7 +459,7 @@
472459
},
473460
"pos": {
474461
"filename": "main.tf",
475-
"line": 124
462+
"line": 121
476463
}
477464
}
478465
},
@@ -492,7 +479,7 @@
492479
},
493480
"pos": {
494481
"filename": "main.tf",
495-
"line": 203
482+
"line": 200
496483
}
497484
}
498485
},
@@ -571,7 +558,7 @@
571558
},
572559
"pos": {
573560
"filename": "main.tf",
574-
"line": 135
561+
"line": 132
575562
}
576563
}
577564
}

modules/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-etcd?topic=databases-for-etcd-autoscaling 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_etcd_version"></a> [etcd\_version](#input\_etcd\_version) | Version of the etcd instance to provision. If no value passed, the current ICD preferred version is used. | `string` | `null` | no |
4140
| <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 |
4241
| <a name="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn) | The root key CRN of the Hyper Protect Crypto Service (HPCS) to use for disk encryption. | `string` | n/a | yes |

modules/fscloud/main.tf

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

modules/fscloud/variables.tf

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

27-
variable "configuration" {
28-
description = "Database Configuration."
29-
type = object({
30-
maxmemory = optional(number)
31-
maxmemory-policy = optional(string)
32-
appendonly = optional(string)
33-
maxmemory-samples = optional(number)
34-
stop-writes-on-bgsave-error = optional(string)
35-
})
36-
default = null
37-
}
38-
3927
variable "member_memory_mb" {
4028
type = number
4129
description = "Allocated memory per-member. See the following doc for supported values: https://cloud.ibm.com/docs/databases-for-etcd?topic=databases-for-etcd-resources-scaling"

variables.tf

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,6 @@ variable "access_tags" {
115115
}
116116
}
117117

118-
variable "configuration" {
119-
description = "Database Configuration"
120-
type = object({
121-
max_connections = optional(number)
122-
max_prepared_transactions = optional(number)
123-
deadlock_timeout = optional(number)
124-
effective_io_concurrency = optional(number)
125-
max_replication_slots = optional(number)
126-
max_wal_senders = optional(number)
127-
shared_buffers = optional(number)
128-
synchronous_commit = optional(string)
129-
wal_level = optional(string)
130-
archive_timeout = optional(number)
131-
log_min_duration_statement = optional(number)
132-
})
133-
default = null
134-
}
135-
136118
variable "service_credential_names" {
137119
description = "Map of name, role for service credentials that you want to create for the database"
138120
type = map(string)

0 commit comments

Comments
 (0)