Skip to content

Commit daf3778

Browse files
committed
rebase with redis
1 parent 8037a1f commit daf3778

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

ibm_catalog.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@
6565
"iam_permissions": [
6666
{
6767
"role_crns": [
68-
"crn:v1:bluemix:public:iam::::role:Administrator"
68+
"crn:v1:bluemix:public:iam::::role:Viewer"
6969
],
70-
"service_name": "all-account-management-services"
70+
"service_name": "Resource group only",
71+
"notes": "Viewer access is required in the resource group you want to provision in."
7172
},
7273
{
7374
"role_crns": [
@@ -93,7 +94,7 @@
9394
"architecture": {
9495
"features": [
9596
{
96-
"title": " Creates an instance of Databases for MongoDB",
97+
"title": " ",
9798
"description": "Configured to use IBM secure by default standards, but can be edited to fit your use case."
9899
}
99100
],
@@ -399,15 +400,21 @@
399400
]
400401
},
401402
"iam_permissions": [
403+
{
404+
"role_crns": [
405+
"crn:v1:bluemix:public:iam::::role:Viewer"
406+
],
407+
"service_name": "Resource group only",
408+
"notes": "Viewer access is required in the resource group you want to provision in."
409+
},
402410
{
403411
"role_crns": [
404412
"crn:v1:bluemix:public:iam::::role:Editor"
405413
],
406414
"service_name": "databases-for-mongodb"
407415
},
408-
{
416+
{
409417
"role_crns": [
410-
"crn:v1:bluemix:public:iam::::serviceRole:Manager",
411418
"crn:v1:bluemix:public:iam::::role:Editor"
412419
],
413420
"service_name": "kms",
@@ -418,13 +425,13 @@
418425
"crn:v1:bluemix:public:iam::::role:Editor"
419426
],
420427
"service_name": "hs-crypto",
421-
"notes": "[Optional] Editor access is required to create keys in HPCS. It is required only if KMS encryption is enabled."
428+
"notes": "[Optional] Editor access is required to create keys in HPCS. It is only required when using HPCS for encryption."
422429
}
423430
],
424431
"architecture": {
425432
"features": [
426433
{
427-
"title": " Creates an instance of Databases for MongoDB",
434+
"title": " ",
428435
"description": "Configured to use IBM secure by default standards that can't be changed."
429436
}
430437
],
@@ -445,7 +452,7 @@
445452
},
446453
{
447454
"key": "existing_resource_group_name",
448-
"required": true,
455+
"display_name": "resource_group",
449456
"custom_config": {
450457
"type": "resource_group",
451458
"grouping": "deployment",
@@ -621,7 +628,8 @@
621628
"key": "ibmcloud_kms_api_key"
622629
},
623630
{
624-
"key": "existing_kms_instance_crn"
631+
"key": "existing_kms_instance_crn",
632+
"required": true
625633
},
626634
{
627635
"key": "existing_kms_key_crn"

solutions/fully-configurable/variables.tf

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ variable "plan" {
7474
}
7575
}
7676

77+
78+
##############################################################################
79+
# ICD hosting model properties
80+
##############################################################################
81+
7782
variable "service_endpoints" {
7883
type = string
7984
description = "The type of endpoint of the database instance. Possible values: `public`, `private`, `public-and-private`."
@@ -85,11 +90,6 @@ variable "service_endpoints" {
8590
}
8691
}
8792

88-
89-
##############################################################################
90-
# ICD hosting model properties
91-
##############################################################################
92-
9393
variable "members" {
9494
type = number
9595
description = "The number of members that are allocated. [Learn more](https://cloud.ibm.com/docs/databases-for-mongodb?topic=databases-for-mongodb-resources-scaling)."
@@ -172,23 +172,18 @@ variable "kms_encryption_enabled" {
172172
default = false
173173

174174
validation {
175-
condition = (
176-
!var.kms_encryption_enabled ||
175+
condition = (!var.kms_encryption_enabled ||
177176
var.existing_mongodb_instance_crn != null ||
178-
(
179-
var.existing_kms_instance_crn != null ||
180-
var.existing_kms_key_crn != null ||
181-
var.existing_backup_kms_key_crn != null
182-
)
177+
var.existing_kms_instance_crn != null ||
178+
var.existing_kms_key_crn != null ||
179+
var.existing_backup_kms_key_crn != null
183180
)
184-
error_message = "When 'kms_encryption_enabled' is true and setting values for 'existing_kms_instance_crn', 'existing_kms_key_crn' or 'existing_backup_kms_key_crn'."
181+
error_message = "When 'kms_encryption_enabled' is true, you must provide either 'existing_backup_kms_key_crn', 'existing_kms_instance_crn' (to create a new key) or 'existing_kms_key_crn' (to use an existing key)."
185182
}
186183

187184
validation {
188-
condition = (
189-
!var.kms_encryption_enabled ? length(compact([var.existing_kms_instance_crn, var.existing_kms_key_crn, var.existing_backup_kms_key_crn])) == 0 : true
190-
)
191-
error_message = "When using ibm owned encryption keys by setting input 'kms_encryption_enabled' to false, 'existing_kms_instance_crn', 'existing_kms_key_crn' and 'existing_backup_kms_key_crn' should not be set."
185+
condition = (var.existing_kms_instance_crn == null && var.existing_kms_key_crn == null && var.existing_backup_kms_key_crn == null) || var.kms_encryption_enabled
186+
error_message = "When either 'existing_kms_instance_crn', 'existing_kms_key_crn' or 'existing_backup_kms_key_crn' is set then 'kms_encryption_enabled' must be set to true."
192187
}
193188
}
194189

@@ -263,7 +258,7 @@ variable "existing_backup_kms_key_crn" {
263258

264259
variable "use_default_backup_encryption_key" {
265260
type = bool
266-
description = "When `use_ibm_owned_encryption_key` is set to false, backups will be encrypted with either the key specified in `existing_kms_key_crn`, in `existing_backup_kms_key_crn`, or with a new key that will be created in the instance specified in the `existing_kms_instance_crn` input. 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."
261+
description = "When `kms_encryption_enabled` is set to true, backups will be encrypted with either the key specified in `existing_kms_key_crn`, in `existing_backup_kms_key_crn`, or with a new key that will be created in the instance specified in the `existing_kms_instance_crn` input. 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 `kms_encryption_enabled` to false to use the default encryption for both backups and deployment data."
267262
default = false
268263
}
269264

solutions/security-enforced/variables.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ variable "existing_kms_key_crn" {
165165
default = null
166166

167167
validation {
168-
condition = var.existing_mongodb_instance_crn != null ? var.existing_kms_key_crn == null : true
169-
error_message = "When using an existing mongodb instance 'existing_kms_key_crn' should not be set"
168+
condition = (
169+
(var.existing_kms_key_crn != null && var.existing_kms_instance_crn == null) ||
170+
(var.existing_kms_key_crn == null && var.existing_kms_instance_crn != null)
171+
)
172+
error_message = "Either existing_kms_key_crn or existing_kms_instance_crn must be set, but not both."
170173
}
171174
}
172175

0 commit comments

Comments
 (0)