Skip to content

Commit c267702

Browse files
authored
feat: exposed ability to enable/disable platform metrics/logs<br>* added dropdown and grouped related input variables (#42)
1 parent 9a7ef53 commit c267702

File tree

5 files changed

+263
-4
lines changed

5 files changed

+263
-4
lines changed

ibm_catalog.json

Lines changed: 241 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@
6060
},
6161
"configuration" : [
6262
{
63-
"key": "existing_cos_kms_key_crn",
64-
"required": true
63+
"key": "ibmcloud_api_key"
64+
},
65+
{
66+
"key": "prefix"
67+
},
68+
{
69+
"key": "use_existing_resource_group"
70+
},
71+
{
72+
"key": "resource_group_name"
6573
},
6674
{
6775
"key": "region",
@@ -101,6 +109,237 @@
101109
"value": "us-east"
102110
}
103111
]
112+
},
113+
{
114+
"key": "log_analysis_instance_name"
115+
},
116+
{
117+
"key": "log_analysis_plan",
118+
"options": [
119+
{
120+
"displayname": "lite",
121+
"value": "lite"
122+
},
123+
{
124+
"displayname": "7-day",
125+
"value": "7-day"
126+
},
127+
{
128+
"displayname": "14-day",
129+
"value": "14-day"
130+
},
131+
{
132+
"displayname": "30-day",
133+
"value": "30-day"
134+
},
135+
{
136+
"displayname": "hipaa-30-day",
137+
"value": "hipaa-30-day"
138+
}
139+
]
140+
},
141+
{
142+
"key": "log_analysis_service_endpoints",
143+
"options": [
144+
{
145+
"displayname": "public",
146+
"value": "public"
147+
},
148+
{
149+
"displayname": "private",
150+
"value": "private"
151+
},
152+
{
153+
"displayname": "public-and-private",
154+
"value": "public-and-private"
155+
}
156+
]
157+
},
158+
{
159+
"key": "log_analysis_tags"
160+
},
161+
{
162+
"key": "enable_log_archive"
163+
},
164+
{
165+
"key": "log_archive_api_key"
166+
},
167+
{
168+
"key": "enable_platform_logs"
169+
},
170+
{
171+
"key": "cloud_monitoring_instance_name"
172+
},
173+
{
174+
"key": "cloud_monitoring_plan",
175+
"options": [
176+
{
177+
"displayname": "lite",
178+
"value": "lite"
179+
},
180+
{
181+
"displayname": "graduated-tier",
182+
"value": "graduated-tier"
183+
}
184+
]
185+
},
186+
{
187+
"key": "cloud_monitoring_service_endpoints",
188+
"options": [
189+
{
190+
"displayname": "public",
191+
"value": "public"
192+
},
193+
{
194+
"displayname": "private",
195+
"value": "private"
196+
},
197+
{
198+
"displayname": "public-and-private",
199+
"value": "public-and-private"
200+
}
201+
]
202+
},
203+
{
204+
"key": "cloud_monitoring_tags"
205+
},
206+
{
207+
"key": "enable_platform_metrics"
208+
},
209+
{
210+
"key": "cos_instance_name"
211+
},
212+
{
213+
"key": "cos_instance_tags"
214+
},
215+
{
216+
"key": "cos_instance_access_tags"
217+
},
218+
{
219+
"key": "add_bucket_name_suffix"
220+
},
221+
{
222+
"key": "log_archive_cos_bucket_name"
223+
},
224+
{
225+
"key": "archive_bucket_access_tags"
226+
},
227+
{
228+
"key": "log_archive_cos_bucket_class",
229+
"options": [
230+
{
231+
"displayname": "standard",
232+
"value": "standard"
233+
},
234+
{
235+
"displayname": "vault",
236+
"value": "vault"
237+
},
238+
{
239+
"displayname": "cold",
240+
"value": "cold"
241+
},
242+
{
243+
"displayname": "smart",
244+
"value": "smart"
245+
},
246+
{
247+
"displayname": "onerate_active",
248+
"value": "onerate_active"
249+
}
250+
]
251+
},
252+
{
253+
"key": "at_cos_target_bucket_name"
254+
},
255+
{
256+
"key": "at_cos_bucket_access_tags"
257+
},
258+
{
259+
"key": "at_cos_target_bucket_class",
260+
"options": [
261+
{
262+
"displayname": "standard",
263+
"value": "standard"
264+
},
265+
{
266+
"displayname": "vault",
267+
"value": "vault"
268+
},
269+
{
270+
"displayname": "cold",
271+
"value": "cold"
272+
},
273+
{
274+
"displayname": "smart",
275+
"value": "smart"
276+
},
277+
{
278+
"displayname": "onerate_active",
279+
"value": "onerate_active"
280+
}
281+
]
282+
},
283+
{
284+
"key": "management_endpoint_type_for_bucket",
285+
"options": [
286+
{
287+
"displayname": "public",
288+
"value": "public"
289+
},
290+
{
291+
"displayname": "private",
292+
"value": "private"
293+
},
294+
{
295+
"displayname": "direct",
296+
"value": "direct"
297+
}
298+
]
299+
},
300+
{
301+
"key": "existing_cos_instance_crn"
302+
},
303+
{
304+
"key": "existing_log_archive_cos_bucket_name"
305+
},
306+
{
307+
"key": "existing_log_archive_cos_bucket_endpoint"
308+
},
309+
{
310+
"key": "existing_at_cos_target_bucket_name"
311+
},
312+
{
313+
"key": "existing_at_cos_target_bucket_endpoint"
314+
},
315+
{
316+
"key": "skip_cos_kms_auth_policy"
317+
},
318+
{
319+
"key": "existing_cos_kms_key_crn",
320+
"required": true
321+
},
322+
{
323+
"key": "existing_kms_instance_crn"
324+
},
325+
{
326+
"key": "cos_key_name"
327+
},
328+
{
329+
"key": "cos_key_ring_name"
330+
},
331+
{
332+
"key": "kms_endpoint_type",
333+
"options": [
334+
{
335+
"displayname": "public",
336+
"value": "public"
337+
},
338+
{
339+
"displayname": "private",
340+
"value": "private"
341+
}
342+
]
104343
}
105344
],
106345
"architecture": {

solutions/instances/catalogValidationValues.json.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"ibmcloud_api_key": $VALIDATION_APIKEY,
33
"resource_group_name": $PREFIX,
44
"existing_kms_instance_crn": $HPCS_US_SOUTH_CRN,
5-
"region": "us-south"
5+
"region": "us-south",
6+
"enable_platform_logs": false,
7+
"enable_platform_metrics": false
68
}

solutions/instances/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ module "observability_instance" {
9494
log_analysis_cos_instance_id = local.cos_instance_crn
9595
log_analysis_cos_bucket_name = local.archive_cos_bucket_name
9696
log_analysis_cos_bucket_endpoint = local.archive_cos_bucket_endpoint
97+
enable_platform_logs = var.enable_platform_logs
9798
# IBM Cloud Monitoring
9899
cloud_monitoring_provision = true
99100
cloud_monitoring_instance_name = var.prefix != null ? "${var.prefix}-${var.cloud_monitoring_instance_name}" : var.cloud_monitoring_instance_name
100101
cloud_monitoring_plan = var.cloud_monitoring_plan
101102
cloud_monitoring_tags = var.cloud_monitoring_tags
102103
cloud_monitoring_service_endpoints = var.cloud_monitoring_service_endpoints
104+
enable_platform_metrics = var.enable_platform_metrics
103105

104106
# Activity Tracker
105107
activity_tracker_provision = false

solutions/instances/variables.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ variable "log_archive_api_key" {
8686
default = null
8787
}
8888

89+
variable "enable_platform_logs" {
90+
type = bool
91+
description = "Receive platform logs in the provisioned IBM Cloud Logging instance."
92+
default = true
93+
}
94+
8995
##############################################################################
9096
# Cloud Monitoring Variables
9197
##############################################################################
@@ -123,6 +129,12 @@ variable "cloud_monitoring_service_endpoints" {
123129
}
124130
}
125131

132+
variable "enable_platform_metrics" {
133+
type = bool
134+
description = "Receive platform metrics in the provisioned IBM Cloud Monitoring instance."
135+
default = true
136+
}
137+
126138
########################################################################################################################
127139
# COS variables
128140
########################################################################################################################
@@ -265,7 +277,7 @@ variable "existing_kms_instance_crn" {
265277
variable "existing_cos_kms_key_crn" {
266278
type = string
267279
default = null
268-
description = "The CRN of an existing KMS key to be used to encrypt both the COS bucket i.e 'log-archive-bucket' and 'at-target-cos-bucket'. If not supplied, a new key ring and key will be created in the provided KMS instance."
280+
description = "(OPTIONAL) The CRN of an existing KMS key to be used to encrypt the Cloud Object Storage buckets created by this solution. If no value is passed, a value must be passed for either the existing_kms_instance_crn input variable if you want to create a new key ring and key, or the existing_log_archive_cos_bucket_name and existing_at_cos_target_bucket_name input variables if you want to use existing buckets."
269281
}
270282

271283
variable "kms_endpoint_type" {

tests/pr_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ func TestInstancesInSchematics(t *testing.T) {
8383
{Name: "cos_region", Value: region, DataType: "string"},
8484
{Name: "cos_instance_tags", Value: options.Tags, DataType: "list(string)"},
8585
{Name: "log_analysis_tags", Value: options.Tags, DataType: "list(string)"},
86+
{Name: "enable_platform_logs", Value: false, DataType: "bool"},
8687
{Name: "cloud_monitoring_tags", Value: options.Tags, DataType: "list(string)"},
88+
{Name: "enable_platform_metrics", Value: false, DataType: "bool"},
8789
{Name: "cos_instance_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
8890
{Name: "archive_bucket_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
8991
{Name: "at_cos_bucket_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
@@ -112,6 +114,8 @@ func TestRunUpgradeSolutionInstances(t *testing.T) {
112114
"management_endpoint_type_for_bucket": "public",
113115
"log_analysis_service_endpoints": "public-and-private",
114116
"cloud_monitoring_service_endpoints": "public",
117+
"enable_platform_logs": "false",
118+
"enable_platform_metrics": "false",
115119
}
116120

117121
output, err := options.RunTestUpgrade()

0 commit comments

Comments
 (0)