Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 4902385

Browse files
authored
feat: enabled COS bucket monitoring and activity tracking by default for instances DA (#143)
1 parent 4701fb8 commit 4902385

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

solutions/instances/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This solution supports provisioning and configuring the following infrastructure
2424

2525
| Name | Source | Version |
2626
|------|--------|---------|
27-
| <a name="module_cos"></a> [cos](#module\_cos) | terraform-ibm-modules/cos/ibm//modules/fscloud | 8.5.3 |
27+
| <a name="module_cos"></a> [cos](#module\_cos) | terraform-ibm-modules/cos/ibm//modules/fscloud | 8.6.1 |
2828
| <a name="module_create_profile_attachment"></a> [create\_profile\_attachment](#module\_create\_profile\_attachment) | terraform-ibm-modules/scc/ibm//modules/attachment | 1.6.3 |
2929
| <a name="module_kms"></a> [kms](#module\_kms) | terraform-ibm-modules/kms-all-inclusive/ibm | 4.13.4 |
3030
| <a name="module_resource_group"></a> [resource\_group](#module\_resource\_group) | terraform-ibm-modules/resource-group/ibm | 1.1.6 |
@@ -49,11 +49,11 @@ This solution supports provisioning and configuring the following infrastructure
4949
| <a name="input_cos_instance_name"></a> [cos\_instance\_name](#input\_cos\_instance\_name) | The name for the Object Storage instance. If a prefix input variable is specified, the prefix is added to the name in the `<prefix>-<name>` format. | `string` | `"base-security-services-cos"` | no |
5050
| <a name="input_cos_instance_tags"></a> [cos\_instance\_tags](#input\_cos\_instance\_tags) | The list of tags to add to the Object Storage instance. Applies only if not specifying an existing instance. | `list(string)` | `[]` | no |
5151
| <a name="input_cos_region"></a> [cos\_region](#input\_cos\_region) | The region for the Object Storage instance. | `string` | `"us-south"` | no |
52-
| <a name="input_existing_activity_tracker_crn"></a> [existing\_activity\_tracker\_crn](#input\_existing\_activity\_tracker\_crn) | The CRN of an existing Activity Tracker instance. Used to send Security and Compliance Center Object Storage bucket log data and all object write events to Activity Tracker. Only used if not supplying an existing Object Storage bucket. | `string` | `null` | no |
52+
| <a name="input_existing_activity_tracker_crn"></a> [existing\_activity\_tracker\_crn](#input\_existing\_activity\_tracker\_crn) | The CRN of an Activity Tracker instance to send Security and Compliance Object Storage bucket events to. If no value passed, events are sent to the instance associated to the container's location unless otherwise specified in the Activity Tracker Event Routing service configuration. Ignored if using existing Object Storage bucket. | `string` | `null` | no |
5353
| <a name="input_existing_cos_instance_crn"></a> [existing\_cos\_instance\_crn](#input\_existing\_cos\_instance\_crn) | The CRN of an existing Object Storage instance. If not specified, an instance is created. | `string` | `null` | no |
5454
| <a name="input_existing_en_crn"></a> [existing\_en\_crn](#input\_existing\_en\_crn) | The CRN of an Event Notification instance. Used to integrate with Security and Compliance Center. | `string` | `null` | no |
5555
| <a name="input_existing_kms_instance_crn"></a> [existing\_kms\_instance\_crn](#input\_existing\_kms\_instance\_crn) | The CRN of the existing Hyper Protect Crypto Services or Key Protect instance. Applies only if not supplying an existing KMS root key and if `skip_cos_kms_auth_policy` is true. | `string` | `null` | no |
56-
| <a name="input_existing_monitoring_crn"></a> [existing\_monitoring\_crn](#input\_existing\_monitoring\_crn) | The CRN of an existing IBM Cloud Monitoring instance. Used to send all Object Storage bucket request and usage metrics to, as well as Workload Protection data. Ignored if using existing Object Storage bucket and not provisioning Workload Protection. | `string` | `null` | no |
56+
| <a name="input_existing_monitoring_crn"></a> [existing\_monitoring\_crn](#input\_existing\_monitoring\_crn) | The CRN of an IBM Cloud Monitoring instance to to send Security and Compliance Object Storage bucket metrics to, as well as Workload Protection data. If no value passed, metrics are sent to the instance associated to the container's location unless otherwise specified in the Metrics Router service configuration. Ignored if using existing Object Storage bucket and not provisioning Workload Protection. | `string` | `null` | no |
5757
| <a name="input_existing_scc_cos_bucket_name"></a> [existing\_scc\_cos\_bucket\_name](#input\_existing\_scc\_cos\_bucket\_name) | The name of an existing bucket inside the existing Object Storage instance to use for Security and Compliance Center. If not specified, a bucket is created. | `string` | `null` | no |
5858
| <a name="input_existing_scc_cos_kms_key_crn"></a> [existing\_scc\_cos\_kms\_key\_crn](#input\_existing\_scc\_cos\_kms\_key\_crn) | The CRN of an existing KMS key to use to encrypt the Security and Compliance Center Object Storage bucket. If no value is set for this variable, specify a value for either the `existing_kms_instance_crn` variable to create a key ring and key, or for the `existing_scc_cos_bucket_name` variable to use an existing bucket. | `string` | `null` | no |
5959
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud API key to deploy resources. | `string` | n/a | yes |

solutions/instances/main.tf

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ locals {
8080
cos_instance_crn = var.existing_cos_instance_crn != null ? var.existing_cos_instance_crn : module.cos[0].cos_instance_crn
8181
cos_bucket_name = var.existing_scc_cos_bucket_name != null ? var.existing_scc_cos_bucket_name : module.cos[0].buckets[local.scc_cos_bucket_name].bucket_name
8282

83-
activity_tracking = var.existing_activity_tracker_crn != null ? {
84-
read_data_events = true
85-
write_data_events = true
86-
activity_tracker_crn = var.existing_activity_tracker_crn
87-
} : null
88-
89-
metrics_monitoring = var.existing_monitoring_crn != null ? {
90-
usage_metrics_enabled = true
91-
request_metrics_enabled = true
92-
metrics_monitoring_crn = var.existing_monitoring_crn
93-
} : null
9483
}
9584

9685
module "cos" {
@@ -99,7 +88,7 @@ module "cos" {
9988
}
10089
count = var.existing_scc_cos_bucket_name == null ? 1 : 0 # no need to call COS module if consumer is passing existing COS bucket
10190
source = "terraform-ibm-modules/cos/ibm//modules/fscloud"
102-
version = "8.5.3"
91+
version = "8.6.1"
10392
resource_group_id = module.resource_group.resource_group_id
10493
create_cos_instance = var.existing_cos_instance_crn == null ? true : false # don't create instance if existing one passed in
10594
cos_instance_name = local.cos_instance_name
@@ -120,8 +109,17 @@ module "cos" {
120109
resource_instance_id = local.cos_instance_crn
121110
region_location = var.cos_region
122111
force_delete = true
123-
activity_tracking = local.activity_tracking
124-
metrics_monitoring = local.metrics_monitoring
112+
activity_tracking = {
113+
read_data_events = true
114+
write_data_events = true
115+
management_events = true
116+
activity_tracker_crn = var.existing_activity_tracker_crn
117+
}
118+
metrics_monitoring = {
119+
usage_metrics_enabled = true
120+
request_metrics_enabled = true
121+
metrics_monitoring_crn = var.existing_monitoring_crn
122+
}
125123
}]
126124

127125
}

solutions/instances/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ variable "existing_monitoring_crn" {
2323
type = string
2424
nullable = true
2525
default = null
26-
description = "The CRN of an existing IBM Cloud Monitoring instance. Used to send all Object Storage bucket request and usage metrics to, as well as Workload Protection data. Ignored if using existing Object Storage bucket and not provisioning Workload Protection."
26+
description = "The CRN of an IBM Cloud Monitoring instance to to send Security and Compliance Object Storage bucket metrics to, as well as Workload Protection data. If no value passed, metrics are sent to the instance associated to the container's location unless otherwise specified in the Metrics Router service configuration. Ignored if using existing Object Storage bucket and not provisioning Workload Protection."
2727
}
2828

2929
variable "prefix" {
@@ -160,7 +160,7 @@ variable "existing_activity_tracker_crn" {
160160
type = string
161161
nullable = true
162162
default = null
163-
description = "The CRN of an existing Activity Tracker instance. Used to send Security and Compliance Center Object Storage bucket log data and all object write events to Activity Tracker. Only used if not supplying an existing Object Storage bucket."
163+
description = "The CRN of an Activity Tracker instance to send Security and Compliance Object Storage bucket events to. If no value passed, events are sent to the instance associated to the container's location unless otherwise specified in the Activity Tracker Event Routing service configuration. Ignored if using existing Object Storage bucket."
164164
}
165165

166166
########################################################################################################################

tests/resources/existing-resources/agents/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module "resource_group" {
1515
##############################################################################
1616

1717
module "landing_zone" {
18-
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone//patterns//roks//module?ref=v5.24.7"
18+
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone//patterns//roks//module?ref=v5.25.1"
1919
region = var.region
2020
prefix = var.prefix
2121
tags = var.resource_tags

0 commit comments

Comments
 (0)