Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ You need the following permissions to run this module.
| <a name="input_backup_crn"></a> [backup\_crn](#input\_backup\_crn) | The CRN of a backup resource to restore from. The backup is created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format crn:v1:<…>:backup:. If omitted, the database is provisioned empty. | `string` | `null` | no |
| <a name="input_backup_encryption_key_crn"></a> [backup\_encryption\_key\_crn](#input\_backup\_encryption\_key\_crn) | The CRN of a Key Protect or Hyper Protect Crypto Services encryption key that you want to use for encrypting the disk that holds deployment backups. Applies only if `use_ibm_owned_encryption_key` is false and `use_same_kms_key_for_backups` is false. If no value is passed, and `use_same_kms_key_for_backups` is true, the value of `kms_key_crn` is used. Alternatively set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. 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 |
| <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 parameters, see https://cloud.ibm.com/docs/databases-for-rabbitmq?topic=databases-for-rabbitmq-changing-configuration&interface=api for more details. | <pre>object({<br/> delete_undefined_queues = optional(bool)<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. [Learn more](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-resources-scaling) | `number` | `0` | no |
| <a name="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb) | Allocated disk per member. [Learn more](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-resources-scaling) | `number` | `1024` | no |
| <a name="input_endpoints"></a> [endpoints](#input\_endpoints) | Endpoints available to the database instance (public, private, public-and-private) | `string` | `"private"` | no |
Expand Down
3 changes: 3 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@
},
{
"key": "use_default_backup_encryption_key"
},
{
"key": "configuration"
}
]
}
Expand Down
18 changes: 10 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,16 @@ resource "time_sleep" "wait_for_backup_kms_authorization_policy" {
########################################################################################################################

resource "ibm_database" "rabbitmq_database" {
depends_on = [time_sleep.wait_for_authorization_policy]
name = var.instance_name
plan = var.plan
location = var.region
service = "messages-for-rabbitmq"
version = var.rabbitmq_version
resource_group_id = var.resource_group_id
service_endpoints = var.endpoints
depends_on = [time_sleep.wait_for_authorization_policy]
name = var.instance_name
plan = var.plan
location = var.region
service = "messages-for-rabbitmq"
version = var.rabbitmq_version
resource_group_id = var.resource_group_id
service_endpoints = var.endpoints
# remove elements with null values: see https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/issues/273
configuration = var.configuration != null ? jsonencode({ for k, v in var.configuration : k => v if v != null }) : null
tags = var.tags
key_protect_key = var.kms_key_crn
backup_encryption_key_crn = local.backup_encryption_key_crn
Expand Down
1 change: 1 addition & 0 deletions modules/fscloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ No resources.
| <a name="input_backup_crn"></a> [backup\_crn](#input\_backup\_crn) | The CRN of a backup resource to restore from. The backup is created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format crn:v1:<…>:backup:. If omitted, the database is provisioned empty. | `string` | `null` | no |
| <a name="input_backup_encryption_key_crn"></a> [backup\_encryption\_key\_crn](#input\_backup\_encryption\_key\_crn) | The CRN of a Key Protect or Hyper Protect Crypto Services encryption key that you want to use for encrypting the disk that holds deployment backups. Applies only if `use_ibm_owned_encryption_key` is false and `use_same_kms_key_for_backups` is false. If no value is passed, and `use_same_kms_key_for_backups` is true, the value of `kms_key_crn` is used. Alternatively set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. 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 |
| <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 parameters, see https://cloud.ibm.com/docs/databases-for-rabbitmq?topic=databases-for-rabbitmq-changing-configuration&interface=api for more details. | <pre>object({<br/> delete_undefined_queues = optional(bool)<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. [Learn more](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-resources-scaling) | `number` | `0` | no |
| <a name="input_disk_mb"></a> [disk\_mb](#input\_disk\_mb) | Allocated disk per member. [Learn more](https://cloud.ibm.com/docs/messages-for-rabbitmq?topic=messages-for-rabbitmq-resources-scaling) | `number` | `1024` | no |
| <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | The name of the RabbitMQ instance | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions modules/fscloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ module "rabbitmq_database" {
member_host_flavor = var.member_host_flavor
auto_scaling = var.auto_scaling
cbr_rules = var.cbr_rules
configuration = var.configuration
}
8 changes: 8 additions & 0 deletions modules/fscloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ variable "access_tags" {
default = []
}

variable "configuration" {
type = object({
delete_undefined_queues = optional(bool)
})
description = "Database configuration parameters, see https://cloud.ibm.com/docs/databases-for-rabbitmq?topic=databases-for-rabbitmq-changing-configuration&interface=api for more details."
default = null
}

##############################################################
# Auto Scaling
##############################################################
Expand Down
25 changes: 25 additions & 0 deletions solutions/standard/DA-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,28 @@ The following example shows values for both disk and memory for the `auto_scalin
}
}
```

## Configuration <a name="configuration"></a>

The Configuration variable tunes messages for RabbitMQ to suit different use case. For more information, see [Configuration](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#updatedatabaseconfiguration-request).

- Variable name: `configuration`
- Type: An object with multiple attributes i.e. `delete_undefined_queues`

### Options for configuration

The configuration object in the input contains the following options

**Available Settings. [Learn more](https://cloud.ibm.com/apidocs/cloud-databases-api/cloud-databases-api-v5#updatedatabaseconfiguration-request)**

- `delete_undefined_queues`: Automatically delete undefined queues. (default: `???`).

### Example configuration

The following example shows values for the `configuration` input.

```hcl
{
delete_undefined_queues = true
}
```
1 change: 1 addition & 0 deletions solutions/standard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ module "rabbitmq" {
disk_mb = var.member_disk_mb
cpu_count = var.member_cpu_count
auto_scaling = var.auto_scaling
configuration = var.configuration
service_credential_names = var.service_credential_names
backup_crn = var.backup_crn
}
Expand Down
11 changes: 11 additions & 0 deletions solutions/standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ variable "access_tags" {
default = []
}

variable "configuration" {
type = object({
delete_undefined_queues = optional(bool)
})
description = "Database configuration parameters, see https://cloud.ibm.com/docs/databases-for-rabbitmq?topic=databases-for-rabbitmq-changing-configuration&interface=api for more details."
default = {
delete_undefined_queues = true
}

}

##############################################################
# Encryption
##############################################################
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ variable "access_tags" {
}
}

variable "configuration" {
type = object({
delete_undefined_queues = optional(bool)
})
description = "Database configuration parameters, see https://cloud.ibm.com/docs/databases-for-rabbitmq?topic=databases-for-rabbitmq-changing-configuration&interface=api for more details."
default = null
}

##############################################################
# Auto Scaling
##############################################################
Expand Down