From 7d7d4b6aa1e4e9ac752ae5f2da8afec7304059cc Mon Sep 17 00:00:00 2001 From: ocofaigh Date: Wed, 17 May 2023 13:03:48 +0100 Subject: [PATCH] fix: add workaround for auto scale provider bug --- README.md | 2 +- module-metadata.json | 17 +++++++++++------ profiles/fscloud/README.md | 2 +- profiles/fscloud/variables.tf | 6 +++++- variables.tf | 6 +++++- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b38499a..34f5f9a 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ You need the following permissions to run this module. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [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. |
object({
cpu = object({
rate_increase_percent = optional(number, 10)
rate_limit_count_per_member = optional(number, 20)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "count")
})
disk = object({
capacity_enabled = optional(bool, false)
free_space_less_than_percent = optional(number, 10)
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 3670016)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
memory = object({
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 114688)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
})
| `null` | no | +| [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. |
object({
cpu = object({
rate_increase_percent = optional(number, 10)
rate_limit_count_per_member = optional(number, 20)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "count")
})
disk = object({
capacity_enabled = optional(bool, false)
free_space_less_than_percent = optional(number, 10)
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 3670016)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
memory = object({
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 114688)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
})
|
{
"cpu": {},
"disk": {},
"memory": {}
}
| no | | [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 | | [cbr\_rules](#input\_cbr\_rules) | (Optional, list) List of CBR rules to create |
list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
}))
| `[]` | no | | [configuration](#input\_configuration) | Database Configuration. |
object({
maxmemory = optional(number)
maxmemory-policy = optional(string)
appendonly = optional(string)
maxmemory-samples = optional(number)
stop-writes-on-bgsave-error = optional(string)
})
| `null` | no | diff --git a/module-metadata.json b/module-metadata.json index fda04cd..d237d26 100644 --- a/module-metadata.json +++ b/module-metadata.json @@ -5,6 +5,11 @@ "name": "auto_scaling", "type": "object({\n cpu = object({\n rate_increase_percent = optional(number, 10)\n rate_limit_count_per_member = optional(number, 20)\n rate_period_seconds = optional(number, 900)\n rate_units = optional(string, \"count\")\n })\n disk = object({\n capacity_enabled = optional(bool, false)\n free_space_less_than_percent = optional(number, 10)\n io_above_percent = optional(number, 90)\n io_enabled = optional(bool, false)\n io_over_period = optional(string, \"15m\")\n rate_increase_percent = optional(number, 10)\n rate_limit_mb_per_member = optional(number, 3670016)\n rate_period_seconds = optional(number, 900)\n rate_units = optional(string, \"mb\")\n })\n memory = object({\n io_above_percent = optional(number, 90)\n io_enabled = optional(bool, false)\n io_over_period = optional(string, \"15m\")\n rate_increase_percent = optional(number, 10)\n rate_limit_mb_per_member = optional(number, 114688)\n rate_period_seconds = optional(number, 900)\n rate_units = optional(string, \"mb\")\n })\n })", "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.", + "default": { + "cpu": {}, + "disk": {}, + "memory": {} + }, "pos": { "filename": "variables.tf", "line": 122 @@ -16,7 +21,7 @@ "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.", "pos": { "filename": "variables.tf", - "line": 179 + "line": 183 } }, "cbr_rules": { @@ -33,7 +38,7 @@ ], "pos": { "filename": "variables.tf", - "line": 205 + "line": 209 } }, "configuration": { @@ -91,7 +96,7 @@ ], "pos": { "filename": "variables.tf", - "line": 195 + "line": 199 }, "immutable": true, "computed": true @@ -119,7 +124,7 @@ ], "pos": { "filename": "variables.tf", - "line": 159 + "line": 163 } }, "kms_key_crn": { @@ -131,7 +136,7 @@ ], "pos": { "filename": "variables.tf", - "line": 165 + "line": 169 }, "immutable": true }, @@ -253,7 +258,7 @@ "default": false, "pos": { "filename": "variables.tf", - "line": 189 + "line": 193 } }, "tags": { diff --git a/profiles/fscloud/README.md b/profiles/fscloud/README.md index c706bec..ffbf85f 100644 --- a/profiles/fscloud/README.md +++ b/profiles/fscloud/README.md @@ -30,7 +30,7 @@ No resources. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [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. |
object({
cpu = object({
rate_increase_percent = optional(number, 10)
rate_limit_count_per_member = optional(number, 20)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "count")
})
disk = object({
capacity_enabled = optional(bool, false)
free_space_less_than_percent = optional(number, 10)
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 3670016)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
memory = object({
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 114688)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
})
| `null` | no | +| [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. |
object({
cpu = object({
rate_increase_percent = optional(number, 10)
rate_limit_count_per_member = optional(number, 20)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "count")
})
disk = object({
capacity_enabled = optional(bool, false)
free_space_less_than_percent = optional(number, 10)
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 3670016)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
memory = object({
io_above_percent = optional(number, 90)
io_enabled = optional(bool, false)
io_over_period = optional(string, "15m")
rate_increase_percent = optional(number, 10)
rate_limit_mb_per_member = optional(number, 114688)
rate_period_seconds = optional(number, 900)
rate_units = optional(string, "mb")
})
})
|
{
"cpu": {},
"disk": {},
"memory": {}
}
| no | | [cbr\_rules](#input\_cbr\_rules) | (Optional, list) List of CBR rules to create |
list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
}))
| `[]` | no | | [configuration](#input\_configuration) | Database Configuration. |
object({
maxmemory = optional(number)
maxmemory-policy = optional(string)
appendonly = optional(string)
maxmemory-samples = optional(number)
stop-writes-on-bgsave-error = optional(string)
})
| `null` | no | | [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 | diff --git a/profiles/fscloud/variables.tf b/profiles/fscloud/variables.tf index 8060855..5b2802d 100644 --- a/profiles/fscloud/variables.tf +++ b/profiles/fscloud/variables.tf @@ -140,7 +140,11 @@ variable "auto_scaling" { }) }) 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&interface=cli#autoscaling-considerations in the IBM Cloud Docs." - default = null + default = { + cpu = {} + disk = {} + memory = {} + } } ############################################################## diff --git a/variables.tf b/variables.tf index 7a57180..af74a6f 100644 --- a/variables.tf +++ b/variables.tf @@ -149,7 +149,11 @@ variable "auto_scaling" { }) }) 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&interface=cli#autoscaling-considerations in the IBM Cloud Docs." - default = null + default = { + cpu = {} + disk = {} + memory = {} + } } ##############################################################