You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support added for in-place version upgrade and deletion protection (#307) <br> - Supporting Terraform Deletion Protection with new input deletion_protection <br> - Allow for in-place major version upgrade (use new input version_upgrade_skip_backup to control backup in this scenario) <br> - **NOTE:** Database will be unavailable during upgrade, plan accordingly
* feat: major inplace upgrade, deletion protection
* fix: remove reference to redis
* fix: review comments
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,7 @@ To attach access management tags to resources in this module, you need the follo
121
121
| <aname="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/> tags = optional(list(object({<br/> name = string<br/> value = string<br/> })))<br/> }))</pre> |`[]`| no |
122
122
| <a name="input_configuration"></a> [configuration](#input\_configuration) | Database configuration parameters, see https://cloud.ibm.com/docs/databases-for-mysql?topic=databases-for-mysql-changing-configuration&interface=api for more details. | <pre>object({<br/> default_authentication_plugin = optional(string) # sha256_password,caching_sha2_password,mysql_native_password<br/> innodb_buffer_pool_size_percentage = optional(number) # 10 ≤ value ≤ 100<br/> innodb_flush_log_at_trx_commit = optional(number) # 0 ≤ value ≤ 2<br/> innodb_log_buffer_size = optional(number) # 1048576 ≤ value ≤ 4294967295<br/> innodb_log_file_size = optional(number) # 4194304 ≤ value ≤ 274877906900<br/> innodb_lru_scan_depth = optional(number) # 128 ≤ value ≤ 2048<br/> innodb_read_io_threads = optional(number) # 1 ≤ value ≤ 64<br/> innodb_write_io_threads = optional(number) # 1 ≤ value ≤ 64<br/> max_allowed_packet = optional(number) # 1024 ≤ value ≤ 1073741824<br/> max_connections = optional(number) # 100 ≤ value ≤ 200000<br/> max_prepared_stmt_count = optional(number) # 0 ≤ value ≤ 4194304<br/> mysql_max_binlog_age_sec = optional(number) # 300 ≤ value ≤ 1073741823 Default: 1800<br/> net_read_timeout = optional(number) # 1 ≤ value ≤ 7200<br/> net_write_timeout = optional(number) # 1 ≤ value ≤ 7200<br/> sql_mode = optional(string) # The comma-separated list of SQL modes applied on this server globally<br/> wait_timeout = optional(number) # 1 ≤ value ≤ 31536000<br/> })</pre> | `null` | no |
123
123
| <aname="input_cpu_count"></a> [cpu\_count](#input\_cpu\_count)| Allocated dedicated CPU per member. For shared CPU, set to 0. [Learn more](https://cloud.ibm.com/docs/databases-for-mysql?topic=databases-for-mysql-resources-scaling)|`number`|`0`| no |
124
+
| <aname="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection)| Enable deletion protection within terraform. This is not a property of the resource and does not prevent deletion outside of terraform. The database can not be deleted by terraform when this value is set to 'true'. In order to delete with terraform the value must be set to 'false' and a terraform apply performed before the destroy is performed. The default is 'true'. |`bool`|`true`| no |
124
125
| <aname="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb)| Allocated disk per member. [Learn more](https://cloud.ibm.com/docs/databases-for-mysql?topic=databases-for-mysql-resources-scaling)|`number`|`10240`| no |
125
126
| <aname="input_kms_key_crn"></a> [kms\_key\_crn](#input\_kms\_key\_crn)| The CRN of a Key Protect or Hyper Protect Crypto Services encryption key to encrypt your data. Applies only if `use_ibm_owned_encryption_key` is false. By default this key is used for both deployment data and backups, but this behaviour can be altered using the `use_same_kms_key_for_backups` and `backup_encryption_key_crn` inputs. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups). |`string`|`null`| no |
126
127
| <aname="input_member_host_flavor"></a> [member\_host\_flavor](#input\_member\_host\_flavor)| Allocated host flavor per member. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/database#host_flavor). |`string`|`null`| no |
@@ -137,10 +138,12 @@ To attach access management tags to resources in this module, you need the follo
137
138
| <aname="input_service_endpoints"></a> [service\_endpoints](#input\_service\_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 |
138
139
| <aname="input_skip_iam_authorization_policy"></a> [skip\_iam\_authorization\_policy](#input\_skip\_iam\_authorization\_policy)| Set to true to skip the creation of IAM authorization policies that permits all Databases for MySQL instances in the given resource group 'Reader' access to the Key Protect or Hyper Protect Crypto Services key that was provided in the `kms_key_crn` and `backup_encryption_key_crn` inputs. This policy is required in order to enable KMS encryption, so only skip creation if there is one already present in your account. No policy is created if `use_ibm_owned_encryption_key` is true. |`bool`|`false`| no |
139
140
| <aname="input_tags"></a> [tags](#input\_tags)| Optional list of tags to be added to the MySQL instance. |`list(string)`|`[]`| no |
141
+
| <aname="input_timeouts_update"></a> [timeouts\_update](#input\_timeouts\_update)| A database update may require a longer timeout for the update to complete. The default is 120 minutes. Set this variable to change the `update` value in the `timeouts` block. [Learn more](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts). |`string`|`"120m"`| no |
140
142
| <aname="input_use_default_backup_encryption_key"></a> [use\_default\_backup\_encryption\_key](#input\_use\_default\_backup\_encryption\_key)| When `use_ibm_owned_encryption_key` is set to false, backups will be encrypted with either the key specified in `kms_key_crn`, or in `backup_encryption_key_crn` if a value is passed. If you do not want to use your own key for backups encryption, you can set this to `true` to use the IBM Cloud Databases default encryption for backups. Alternatively set `use_ibm_owned_encryption_key` to true to use the default encryption for both backups and deployment data. |`bool`|`false`| no |
141
143
| <aname="input_use_ibm_owned_encryption_key"></a> [use\_ibm\_owned\_encryption\_key](#input\_use\_ibm\_owned\_encryption\_key)| IBM Cloud Databases will secure your deployment's data at rest automatically with an encryption key that IBM hold. Alternatively, you may select your own Key Management System instance and encryption key (Key Protect or Hyper Protect Crypto Services) by setting this to false. If setting to false, a value must be passed for the `kms_key_crn` input. |`bool`|`true`| no |
142
144
| <aname="input_use_same_kms_key_for_backups"></a> [use\_same\_kms\_key\_for\_backups](#input\_use\_same\_kms\_key\_for\_backups)| Set this to false if you wan't to use a different key that you own to encrypt backups. When set to false, a value is required for the `backup_encryption_key_crn` input. Alternatiely set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. Applies only if `use_ibm_owned_encryption_key` is false. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups). |`bool`|`true`| no |
143
145
| <aname="input_users"></a> [users](#input\_users)| A list of users that you want to create on the database. Multiple blocks are allowed. The user password must be in the range of 10-32 characters. Be warned that in most case using IAM service credentials (via the var.service\_credential\_names) is sufficient to control access to the MySQL instance. These blocks creates native MySQL database users, more info on that can be found here https://cloud.ibm.com/docs/databases-for-mysql?topic=databases-for-mysql-user-management| <pre>list(object({<br/> name = string<br/> password = string # pragma: allowlist secret<br/> type = optional(string)<br/> role = optional(string)<br/> }))</pre> |`[]`| no |
146
+
| <aname="input_version_upgrade_skip_backup"></a> [version\_upgrade\_skip\_backup](#input\_version\_upgrade\_skip\_backup)| Whether to skip taking a backup before upgrading the database version. Attention: Skipping a backup is not recommended. Skipping a backup before a version upgrade is dangerous and may result in data loss if the upgrade fails at any stage — there will be no immediate backup to restore from. |`bool`|`false`| no |
An end-to-end example that uses the module's default variable values. This example uses the IBM Cloud terraform provider to:
3
+
An end-to-end example that creates the following infrastructure:
4
4
5
-
-Create a new resource group if one is not passed in.
6
-
-Create a new ICD MySQL database instance.
7
-
-Create a read-only replica of the leader MySQL database instance. For more info on Read-only Replicas, see [Configuring Read-only Replicas](https://cloud.ibm.com/docs/databases-for-mysql?topic=databases-for-mysql-read-replicas)
5
+
-A resource group, if one is not passed in.
6
+
-An ICD MySQL database instance.
7
+
-A read-only replica of the leader MySQL database instance. For more info on Read-only Replicas, see [Configuring Read-only Replicas](https://cloud.ibm.com/docs/databases-for-mysql?topic=databases-for-mysql-read-replicas)
Copy file name to clipboardExpand all lines: examples/basic/variables.tf
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ variable "ibmcloud_api_key" {
6
6
7
7
variable"region" {
8
8
type=string
9
-
description="Region to provision all resources created by this example."
9
+
description="Region to provision all resources created by this example"
10
10
default="us-south"
11
11
}
12
12
@@ -16,27 +16,27 @@ variable "prefix" {
16
16
default="mysql"
17
17
}
18
18
19
-
variable"mysql_version" {
20
-
description="Version of the mysql instance. If no value passed, the current ICD preferred version is used."
21
-
type=string
22
-
default=null
23
-
}
24
-
25
19
variable"resource_group" {
26
20
type=string
27
21
description="An existing resource group name to use for this example, if unset a new resource group will be created"
28
22
default=null
29
23
}
30
24
31
-
variable"resource_tags" {
25
+
variable"access_tags" {
32
26
type=list(string)
33
-
description="Optional list of tags to be added to created resources"
27
+
description="A list of access tags to apply to the MySQL instance created by the module, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial for more details"
34
28
default=[]
35
29
}
36
30
37
-
variable"access_tags" {
31
+
variable"mysql_version" {
32
+
type=string
33
+
description="Version of the mysql instance. If no value passed, the current ICD preferred version is used."
34
+
default=null
35
+
}
36
+
37
+
variable"resource_tags" {
38
38
type=list(string)
39
-
description="A list of access tags to apply to the MySQL instance created by the module, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial for more details"
39
+
description="Optional list of tags to be added to created resources"
0 commit comments