Skip to content

Commit d0c093c

Browse files
authored
fix: updated the DA dependency config (#69)
1 parent 8cf5c59 commit d0c093c

File tree

5 files changed

+53
-116
lines changed

5 files changed

+53
-116
lines changed

ibm_catalog.json

Lines changed: 23 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@
111111
"required": true
112112
},
113113
{
114-
"key": "existing_resource_group_name"
114+
"key": "existing_resource_group_name",
115+
"type": "string",
116+
"description": "The name of an existing resource group to provision the resources. If not provided the default resource group will be used.",
117+
"virtual": true,
118+
"default_value": "__NULL__"
115119
},
116120
{
117121
"key": "region",
@@ -155,14 +159,6 @@
155159
}
156160
]
157161
},
158-
{
159-
"key": "cloud_logs_instance_name",
160-
"required": true,
161-
"type": "string",
162-
"description": "Name of the cloud logs instance to be created.",
163-
"virtual": true,
164-
"default_value": "__NOT_SET__"
165-
},
166162
{
167163
"key": "existing_cloud_logs_instance_crn"
168164
},
@@ -319,10 +315,8 @@
319315
"name": "deploy-arch-ibm-cos",
320316
"description": "Enable this to create an IBM Cloud Object Storage(COS) instance. The buckets to store events will be created by the Activity Tracker Event Routing deployable architecture.",
321317
"id": "68921490-2778-4930-ac6d-bae7be6cd958-global",
322-
"version": "v9.0.2",
323-
"flavors": [
324-
"instance"
325-
],
318+
"version": "v10.2.1",
319+
"flavors": ["instance"],
326320
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
327321
"optional": true,
328322
"on_by_default": true,
@@ -340,17 +334,19 @@
340334
"dependency_input": "prefix",
341335
"version_input": "prefix",
342336
"reference_version": true
337+
},
338+
{
339+
"version_input": "enable_activity_tracker_event_routing_to_cos_bucket",
340+
"value": true
343341
}
344342
]
345343
},
346344
{
347345
"name": "deploy-arch-ibm-kms",
348346
"description": "Enable when you want to create your own managed keys to encrypt the buckets. Select only if existing KMS instance or Key is not provided. ",
349347
"id": "2cad4789-fa90-4886-9c9e-857081c273ee-global",
350-
"version": "v5.1.4",
351-
"flavors": [
352-
"fully-configurable"
353-
],
348+
"version": "v5.1.19",
349+
"flavors": ["fully-configurable"],
354350
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
355351
"optional": true,
356352
"on_by_default": true,
@@ -375,73 +371,16 @@
375371
}
376372
]
377373
},
378-
{
379-
"name": "deploy-arch-ibm-account-infra-base",
380-
"description": "Enable to create a resource groups by default where all the resources will be provisioned and, when you enable the “with Account Settings” option, it also applies baseline security and governance settings. When disabled, provide an existing resource group as input.",
381-
"id": "63641cec-6093-4b4f-b7b0-98d2f4185cd6-global",
382-
"version": "v3.0.7",
383-
"flavors": [
384-
"resource-group-only",
385-
"resource-groups-with-account-settings"
386-
],
387-
"default_flavor": "resource-group-only",
388-
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
389-
"optional": true,
390-
"on_by_default": false,
391-
"input_mapping": [
392-
{
393-
"dependency_input": "prefix",
394-
"version_input": "prefix",
395-
"reference_version": true
396-
},
397-
{
398-
"dependency_output": "observability_resource_group_name",
399-
"version_input": "existing_resource_group_name"
400-
}
401-
]
402-
},
403374
{
404375
"name": "deploy-arch-ibm-cloud-logs",
405376
"description": "Enable this to create an IBM Cloud Logs (ICL) Instance which can be used for storage and analysis of events ingested by Activity Tracker. ",
406377
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
407-
"flavors": [
408-
"fully-configurable"
409-
],
378+
"flavors": ["fully-configurable"],
410379
"id": "63d8ae58-fbf3-41ce-b844-0fb5b85882ab-global",
411-
"version": "v1.5.6",
380+
"version": "v1.6.11",
412381
"optional": true,
413382
"on_by_default": true,
414383
"input_mapping": [
415-
{
416-
"dependency_input": "cloud_logs_instance_name",
417-
"version_input": "cloud_logs_instance_name",
418-
"reference_version": true
419-
},
420-
{
421-
"dependency_input": "existing_cos_instance_crn",
422-
"version_input": "existing_cos_instance_crn",
423-
"reference_version": true
424-
},
425-
{
426-
"dependency_input": "existing_monitoring_crn",
427-
"version_input": "existing_monitoring_crn",
428-
"reference_version": true
429-
},
430-
{
431-
"dependency_input": "existing_kms_instance_crn",
432-
"version_input": "existing_kms_instance_crn",
433-
"reference_version": true
434-
},
435-
{
436-
"dependency_input": "kms_encryption_enabled_buckets",
437-
"version_input": "kms_encryption_enabled_buckets",
438-
"reference_version": true
439-
},
440-
{
441-
"dependency_input": "existing_kms_key_crn",
442-
"version_input": "existing_cos_kms_key_crn",
443-
"reference_version": true
444-
},
445384
{
446385
"dependency_input": "prefix",
447386
"version_input": "prefix",
@@ -455,17 +394,19 @@
455394
{
456395
"dependency_output": "cloud_logs_crn",
457396
"version_input": "existing_cloud_logs_instance_crn"
397+
},
398+
{
399+
"version_input": "enable_activity_tracker_event_routing_to_cloud_logs",
400+
"value": true
458401
}
459402
]
460403
},
461404
{
462405
"name": "deploy-arch-ibm-cloud-monitoring",
463406
"description": "Enable IBM Cloud Monitoring to gain operational visibility into your cloud storage buckets. ",
464407
"id": "73debdbf-894f-4c14-81c7-5ece3a70b67d-global",
465-
"version": "v1.3.0",
466-
"flavors": [
467-
"fully-configurable"
468-
],
408+
"version": "v1.6.4",
409+
"flavors": ["fully-configurable"],
469410
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
470411
"optional": true,
471412
"on_by_default": true,
@@ -569,15 +510,11 @@
569510
"iam_permissions": [
570511
{
571512
"service_name": "All account management services",
572-
"role_crns": [
573-
"crn:v1:bluemix:public:iam::::role:Administrator"
574-
]
513+
"role_crns": ["crn:v1:bluemix:public:iam::::role:Administrator"]
575514
},
576515
{
577516
"service_name": "atracker",
578-
"role_crns": [
579-
"crn:v1:bluemix:public:iam::::role:Administrator"
580-
]
517+
"role_crns": ["crn:v1:bluemix:public:iam::::role:Administrator"]
581518
}
582519
],
583520
"architecture": {

solutions/fully-configurable/catalogValidationValues.json.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"region": "us-south",
66
"prefix": $PREFIX,
77
"existing_cos_instance_crn": $COS_INSTANCE_CRN,
8-
"existing_resource_group_name": "geretain-test-resources"
8+
"enable_activity_tracker_event_routing_to_cloud_logs": true,
9+
"enable_activity_tracker_event_routing_to_cos_bucket": true
910
}

solutions/fully-configurable/main.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ locals {
7676

7777
}
7878

79-
#######################################################################################################################
80-
# Resource Group
81-
#######################################################################################################################
82-
83-
module "resource_group" {
84-
source = "terraform-ibm-modules/resource-group/ibm"
85-
version = "1.3.0"
86-
existing_resource_group_name = var.existing_resource_group_name
87-
}
88-
89-
9079
#######################################################################################################################
9180
# Activity Tracker
9281
#######################################################################################################################

solutions/fully-configurable/variables.tf

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ variable "ibmcloud_kms_api_key" {
2222
default = null
2323
}
2424

25-
26-
variable "existing_resource_group_name" {
27-
type = string
28-
description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used."
29-
default = null
30-
}
31-
32-
3325
variable "region" {
3426
type = string
3527
description = "The region to provision all resources in. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/region) about how to select different regions for different services."
@@ -84,7 +76,7 @@ variable "existing_cloud_logs_instance_crn" {
8476
type = string
8577
nullable = true
8678
default = null
87-
description = "The CRN of an existing Cloud logs instance."
79+
description = "The CRN of an existing Cloud Logs instance. This value is required and cannot be null if `enable_activity_tracker_event_routing_to_cloud_logs` is set to true."
8880
}
8981

9082

@@ -94,14 +86,30 @@ variable "existing_cloud_logs_instance_crn" {
9486

9587
variable "enable_activity_tracker_event_routing_to_cos_bucket" {
9688
type = bool
97-
description = "Whether to enable event routing from Activity Tracker to the Object Storage bucket."
98-
default = true
89+
description = "When set to `true`, you must provide a value for `existing_cos_instance_crn` to enable event routing from Activity Tracker to a Object Storage bucket."
90+
default = false
91+
92+
validation {
93+
condition = var.enable_activity_tracker_event_routing_to_cos_bucket ? var.existing_cos_instance_crn != null : true
94+
error_message = "If 'enable_activity_tracker_event_routing_to_cos_bucket' is set to true, you must provide a value for 'existing_cos_instance_crn'."
95+
}
96+
97+
validation {
98+
condition = var.enable_activity_tracker_event_routing_to_cos_bucket || var.enable_activity_tracker_event_routing_to_cloud_logs
99+
error_message = "At least one of 'enable_activity_tracker_event_routing_to_cos_bucket' or 'enable_activity_tracker_event_routing_to_cloud_logs' must be true to route audit events to COS bucket or Cloud Logs instance."
100+
}
101+
99102
}
100103

101104
variable "enable_activity_tracker_event_routing_to_cloud_logs" {
102105
type = bool
103-
description = "Whether to enable event routing from Activity Tracker to Cloud Logs instance."
104-
default = true
106+
description = "When set to `true`, you must provide a value for `existing_cloud_logs_instance_crn` to enable event routing from Activity Tracker to a Cloud Logs instance."
107+
default = false
108+
109+
validation {
110+
condition = var.enable_activity_tracker_event_routing_to_cloud_logs ? var.existing_cloud_logs_instance_crn != null : true
111+
error_message = "If 'enable_activity_tracker_event_routing_to_cloud_logs' is set to true, you must provide a value for 'existing_cloud_logs_instance_crn'."
112+
}
105113
}
106114

107115
variable "cos_target_name" {
@@ -182,11 +190,11 @@ variable "activity_tracker_cos_target_bucket_class" {
182190
}
183191
}
184192

185-
186193
variable "existing_cos_instance_crn" {
187194
type = string
188-
description = "The CRN of an existing Cloud Object Storage instance."
189-
nullable = false
195+
nullable = true
196+
default = null
197+
description = "The CRN of an existing Cloud Object Storage instance. This value is required and cannot be null if `enable_activity_tracker_event_routing_to_cos_bucket` is set to true."
190198
}
191199

192200

tests/pr_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ func TestFullyConfigurableInSchematics(t *testing.T) {
135135
}()
136136
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
137137
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
138-
{Name: "existing_resource_group_name", Value: "Default", DataType: "string"},
139138
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
140139
{Name: "existing_cos_instance_crn", Value: permanentResources["general_test_storage_cos_instance_crn"], DataType: "string"},
141140
{Name: "existing_cloud_logs_instance_crn", Value: terraform.Output(t, existingTerraformOptions, "icl_crn"), DataType: "string"},
141+
{Name: "enable_activity_tracker_event_routing_to_cloud_logs", Value: true, DataType: "bool"},
142+
{Name: "enable_activity_tracker_event_routing_to_cos_bucket", Value: true, DataType: "bool"},
142143
{Name: "kms_encryption_enabled_buckets", Value: true, DataType: "bool"},
143144
{Name: "prefix", Value: options.Prefix, DataType: "string"},
144145
{Name: "region", Value: options.Region, DataType: "string"},
@@ -193,10 +194,11 @@ func TestFullyConfigurableUpgradeInSchematics(t *testing.T) {
193194

194195
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
195196
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
196-
{Name: "existing_resource_group_name", Value: "Default", DataType: "string"},
197197
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
198198
{Name: "existing_cos_instance_crn", Value: permanentResources["general_test_storage_cos_instance_crn"], DataType: "string"},
199199
{Name: "existing_cloud_logs_instance_crn", Value: terraform.Output(t, existingTerraformOptions, "icl_crn"), DataType: "string"},
200+
{Name: "enable_activity_tracker_event_routing_to_cloud_logs", Value: true, DataType: "bool"},
201+
{Name: "enable_activity_tracker_event_routing_to_cos_bucket", Value: true, DataType: "bool"},
200202
{Name: "kms_encryption_enabled_buckets", Value: true, DataType: "bool"},
201203
{Name: "prefix", Value: options.Prefix, DataType: "string"},
202204
{Name: "region", Value: options.Region, DataType: "string"},

0 commit comments

Comments
 (0)