Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: auto workaround for auto scale provider bug #160

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ You need the following permissions to run this module.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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> cpu = object({<br> rate_increase_percent = optional(number, 10)<br> rate_limit_count_per_member = optional(number, 20)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "count")<br> })<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 |
| <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> cpu = object({<br> rate_increase_percent = optional(number, 10)<br> rate_limit_count_per_member = optional(number, 20)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "count")<br> })<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> | <pre>{<br> "cpu": {},<br> "disk": {},<br> "memory": {}<br>}</pre> | no |
| <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 |
| <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 |
| <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 |
Expand Down
17 changes: 11 additions & 6 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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": {
Expand All @@ -33,7 +38,7 @@
],
"pos": {
"filename": "variables.tf",
"line": 205
"line": 209
}
},
"configuration": {
Expand Down Expand Up @@ -91,7 +96,7 @@
],
"pos": {
"filename": "variables.tf",
"line": 195
"line": 199
},
"immutable": true,
"computed": true
Expand Down Expand Up @@ -119,7 +124,7 @@
],
"pos": {
"filename": "variables.tf",
"line": 159
"line": 163
}
},
"kms_key_crn": {
Expand All @@ -131,7 +136,7 @@
],
"pos": {
"filename": "variables.tf",
"line": 165
"line": 169
},
"immutable": true
},
Expand Down Expand Up @@ -253,7 +258,7 @@
"default": false,
"pos": {
"filename": "variables.tf",
"line": 189
"line": 193
}
},
"tags": {
Expand Down
2 changes: 1 addition & 1 deletion profiles/fscloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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> cpu = object({<br> rate_increase_percent = optional(number, 10)<br> rate_limit_count_per_member = optional(number, 20)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "count")<br> })<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 |
| <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> cpu = object({<br> rate_increase_percent = optional(number, 10)<br> rate_limit_count_per_member = optional(number, 20)<br> rate_period_seconds = optional(number, 900)<br> rate_units = optional(string, "count")<br> })<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> | <pre>{<br> "cpu": {},<br> "disk": {},<br> "memory": {}<br>}</pre> | no |
| <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 |
| <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 |
| <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 |
Expand Down
6 changes: 5 additions & 1 deletion profiles/fscloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}
}

##############################################################
Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}
}

##############################################################
Expand Down