Skip to content

Commit 864f0a7

Browse files
authored
feat: updated the queue_manager_version input to allow no value to be passed, meaning it will default to the current latest (#81)
1 parent d2a85b5 commit 864f0a7

File tree

12 files changed

+54
-40
lines changed

12 files changed

+54
-40
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ module "mq_on_cloud" {
8686
queue_manager_display_name = "queue-manager"
8787
queue_manager_name = "qm"
8888
queue_manager_size = "xsmall"
89-
queue_manager_version = "9.4.0_3"
9089
9190
applications = {
9291
"application" = {
@@ -180,7 +179,7 @@ No resources.
180179
| <a name="input_queue_manager_location"></a> [queue\_manager\_location](#input\_queue\_manager\_location) | The location in which the queue manager will be deployed. Defaults to using the first location in the created service instance | `string` | `null` | no |
181180
| <a name="input_queue_manager_name"></a> [queue\_manager\_name](#input\_queue\_manager\_name) | A queue manager name conforming to MQ restrictions. 1 to 48 characters matching regular expression '/^[a-zA-Z0-9.\_]*$/' . | `string` | n/a | yes |
182181
| <a name="input_queue_manager_size"></a> [queue\_manager\_size](#input\_queue\_manager\_size) | The queue manager deployment sizes. Valid values are `xsmall`, `small`, `medium`, `large` . | `string` | `"xsmall"` | no |
183-
| <a name="input_queue_manager_version"></a> [queue\_manager\_version](#input\_queue\_manager\_version) | The MQ version of the queue manager. | `string` | n/a | yes |
182+
| <a name="input_queue_manager_version"></a> [queue\_manager\_version](#input\_queue\_manager\_version) | The MQ version of the queue manager. If null, use the latest available | `string` | `null` | no |
184183
| <a name="input_region"></a> [region](#input\_region) | The region to provision the MQ on Cloud instance to. | `string` | n/a | yes |
185184
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The ID of the resource group to provision the MQ on Cloud instance to. | `string` | n/a | yes |
186185
| <a name="input_subscription_id"></a> [subscription\_id](#input\_subscription\_id) | An MQ on Cloud subscsription plan id for customers who have purchased a subscription through an IBM sales representative | `string` | `null` | no |

examples/advanced/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module "mq_on_cloud" {
3232
queue_manager_display_name = "${var.prefix}-qm-display"
3333
queue_manager_name = "${local.prefix}_qm"
3434
queue_manager_size = "xsmall"
35-
queue_manager_version = "9.4.0_3"
3635

3736
applications = {
3837
"app-${local.prefix}" = {

examples/basic/main.tf

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ locals {
2020
prefix = local.prefix_split[local.prefix_offest]
2121
}
2222

23+
# tflint 0.55.1 has an issue https://github.com/terraform-linters/tflint/issues/2243
24+
# Remove certificate features until it is resolved
2325
module "mq_on_cloud" {
2426
source = "../.."
2527
resource_group_id = module.resource_group.resource_group_id
@@ -33,7 +35,7 @@ module "mq_on_cloud" {
3335
queue_manager_display_name = "${var.prefix}-qm-display"
3436
queue_manager_name = "${local.prefix}_qm"
3537
queue_manager_size = "xsmall"
36-
queue_manager_version = "9.4.0_3"
38+
queue_manager_version = "9.4.1_2" # Pinned to current version
3739

3840
applications = {
3941
"app-${local.prefix}" = {
@@ -46,17 +48,17 @@ module "mq_on_cloud" {
4648
email = "user-1@example.com"
4749
}
4850
}
49-
keystore_certificates = var.keystore_certificate == null ? {} : {
50-
"${var.prefix}-ks-cert" = {
51-
certificate = var.keystore_certificate
52-
label = "ks_cert_1"
53-
}
54-
}
55-
truststore_certificates = var.truststore_certificate == null ? {} : {
56-
"${var.prefix}-ts-cert" = {
57-
certificate = var.truststore_certificate
58-
label = "ts_cert_1"
59-
}
60-
}
51+
#keystore_certificates = var.keystore_certificate == null ? {} : {
52+
# "${var.prefix}-ks-cert" = {
53+
# certificate = var.keystore_certificate
54+
# label = "ks_cert_1"
55+
# }
56+
#}
57+
#truststore_certificates = var.truststore_certificate == null ? {} : {
58+
# "${var.prefix}-ts-cert" = {
59+
# certificate = var.truststore_certificate
60+
# label = "ts_cert_1"
61+
# }
62+
#}
6163

6264
}

examples/basic/variables.tf

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,18 @@ variable "subscription_id" {
4444
default = null
4545
}
4646

47-
variable "keystore_certificate" {
48-
type = string
49-
description = "Base64 encoded string containing keystore certificate"
50-
default = null
51-
sensitive = true
52-
}
53-
54-
variable "truststore_certificate" {
55-
type = string
56-
description = "Base64 encoded string containing truststore certificate"
57-
default = null
58-
sensitive = true
59-
}
47+
# tflint 0.55.1 has an issue https://github.com/terraform-linters/tflint/issues/2243
48+
# Remove certificate features until it is resolved
49+
#variable "keystore_certificate" {
50+
# type = string
51+
# description = "Base64 encoded string containing keystore certificate"
52+
# default = null
53+
# sensitive = true
54+
#}
55+
56+
#variable "truststore_certificate" {
57+
# type = string
58+
# default = null
59+
# description = "Base64 encoded string containing truststore certificate"
60+
# sensitive = true
61+
#}

ibm_catalog.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
],
5151
"configuration" : [
5252
{
53-
"key": "ibmcloud_api_key",
54-
"required": true
53+
"key": "ibmcloud_api_key"
5554
},
5655
{
5756
"key": "use_existing_resource_group"
@@ -126,6 +125,9 @@
126125
{
127126
"key": "existing_secrets_manager_crn"
128127
},
128+
{
129+
"key": "secrets_manager_endpoint_type"
130+
},
129131
{
130132
"key": "existing_secret_group_id"
131133
},

modules/queue-manager/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module "queue_manager" {
1313
name = "qm"
1414
service_instance_crn = "crn:<...>" # MQ on Cloud deployment instance crn
1515
size = "xsmall"
16-
queue_manager_version = "9.4.0_3"
1716
}
1817
```
1918

@@ -35,6 +34,7 @@ No modules.
3534
| Name | Type |
3635
|------|------|
3736
| [ibm_mqcloud_queue_manager.mqcloud_queue_manager](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/mqcloud_queue_manager) | resource |
37+
| [ibm_mqcloud_queue_manager_options.options](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/mqcloud_queue_manager_options) | data source |
3838

3939
### Inputs
4040

@@ -43,7 +43,7 @@ No modules.
4343
| <a name="input_display_name"></a> [display\_name](#input\_display\_name) | A displayable name for the queue manager. | `string` | n/a | yes |
4444
| <a name="input_location"></a> [location](#input\_location) | The locations in which the queue manager would be deployed. | `string` | n/a | yes |
4545
| <a name="input_name"></a> [name](#input\_name) | A queue manager name conforming to MQ restrictions. 1 to 48 characters matching regular expression '/^[a-zA-Z0-9.\_]*$/' . | `string` | n/a | yes |
46-
| <a name="input_queue_manager_version"></a> [queue\_manager\_version](#input\_queue\_manager\_version) | The MQ version of the queue manager. | `string` | `"9.4.0_3"` | no |
46+
| <a name="input_queue_manager_version"></a> [queue\_manager\_version](#input\_queue\_manager\_version) | The MQ version of the queue manager. If no value set, use the latest available | `string` | `null` | no |
4747
| <a name="input_service_instance_crn"></a> [service\_instance\_crn](#input\_service\_instance\_crn) | The CRN that uniquely identifies the MQ on Cloud deployment service instance. | `string` | n/a | yes |
4848
| <a name="input_size"></a> [size](#input\_size) | The queue manager deployment sizes. Valid values are `xsmall`, `small`, `medium`, `large`. | `string` | `"xsmall"` | no |
4949

modules/queue-manager/main.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ locals {
1010
existing_mq_deployment_guid = length(local.split_deployment_crn) >= 8 ? local.split_deployment_crn[7] : null
1111
}
1212

13+
data "ibm_mqcloud_queue_manager_options" "options" {
14+
service_instance_guid = local.existing_mq_deployment_guid
15+
}
16+
17+
locals {
18+
queue_manager_version = var.queue_manager_version == null ? data.ibm_mqcloud_queue_manager_options.options.latest_version : var.queue_manager_version
19+
}
20+
1321
resource "ibm_mqcloud_queue_manager" "mqcloud_queue_manager" {
1422
display_name = var.display_name
1523
location = var.location
1624
name = var.name
1725
service_instance_guid = local.existing_mq_deployment_guid
1826
size = var.size
19-
version = var.queue_manager_version
27+
version = local.queue_manager_version
2028
}

modules/queue-manager/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ variable "name" {
1919

2020
# version is reserved attribute on modules
2121
variable "queue_manager_version" {
22-
description = "The MQ version of the queue manager."
22+
description = "The MQ version of the queue manager. If no value set, use the latest available"
2323
type = string
24-
default = "9.4.0_3"
24+
default = null
2525
}
2626

2727
variable "service_instance_crn" {

solutions/standard/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,14 @@ data "ibm_mqcloud_truststore_certificate" "root_ca_certificate" {
154154

155155
module "experimental_certificate" {
156156
source = "../../modules/experimental-certificate"
157+
depends_on = [module.experimental_connection]
157158
ibmcloud_api_key = var.ibmcloud_api_key
158159
href = data.ibm_mqcloud_truststore_certificate.certificate[0].trust_store[0].href
159160
}
160161

161162
module "experimental_certificate_root" {
162163
source = "../../modules/experimental-certificate"
164+
depends_on = [module.experimental_certificate]
163165
ibmcloud_api_key = var.ibmcloud_api_key
164166
href = data.ibm_mqcloud_truststore_certificate.root_ca_certificate[0].trust_store[0].href
165167
}

0 commit comments

Comments
 (0)