Skip to content

Commit 21b87a9

Browse files
authored
feat: added a new Logs Routing variation (#260)
1 parent 5ef62df commit 21b87a9

File tree

13 files changed

+292
-7
lines changed

13 files changed

+292
-7
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ offerings:
1717
install_type: extension
1818
pre_validation: "tests/scripts/pre-validation-deploy-slz-roks-and-obs-instances.sh"
1919
post_validation: "tests/scripts/post-validation-destroy-slz-roks-and-obs-instances.sh"
20+
- name: logs-routing
21+
mark_ready: true
22+
install_type: fullstack

ibm_catalog.json

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@
149149
{
150150
"key": "cloud_logs_provision"
151151
},
152+
{
153+
"key": "cloud_logs_policies"
154+
},
152155
{
153156
"key": "cloud_logs_instance_name"
154157
},
@@ -158,6 +161,9 @@
158161
{
159162
"key": "cloud_logs_access_tags"
160163
},
164+
{
165+
"key": "manage_log_archive_cos_bucket"
166+
},
161167
{
162168
"key": "cloud_logs_retention_period",
163169
"options": [
@@ -235,6 +241,12 @@
235241
{
236242
"key": "cloud_monitoring_tags"
237243
},
244+
{
245+
"key": "cos_resource_group_name"
246+
},
247+
{
248+
"key": "cos_region"
249+
},
238250
{
239251
"key": "cos_instance_name"
240252
},
@@ -397,12 +409,6 @@
397409
{
398410
"key": "existing_cos_instance_crn"
399411
},
400-
{
401-
"key": "existing_log_archive_cos_bucket_name"
402-
},
403-
{
404-
"key": "existing_log_archive_cos_bucket_endpoint"
405-
},
406412
{
407413
"key": "existing_at_cos_target_bucket_name"
408414
},
@@ -443,6 +449,12 @@
443449
{
444450
"key": "cos_key_ring_name"
445451
},
452+
{
453+
"key": "ibmcloud_cos_api_key"
454+
},
455+
{
456+
"key": "ibmcloud_kms_api_key"
457+
},
446458
{
447459
"key": "kms_endpoint_type",
448460
"options": [
@@ -456,6 +468,9 @@
456468
}
457469
]
458470
},
471+
{
472+
"key": "enable_platform_metrics"
473+
},
459474
{
460475
"key": "enable_metrics_routing_to_cloud_monitoring"
461476
},
@@ -620,6 +635,9 @@
620635
{
621636
"key": "cloud_monitoring_metrics_filter"
622637
},
638+
{
639+
"key": "cloud_monitoring_container_filter"
640+
},
623641
{
624642
"key": "cloud_monitoring_agent_tags"
625643
},
@@ -714,6 +732,76 @@
714732
}
715733
]
716734
}
735+
},
736+
{
737+
"label": "Logs Routing",
738+
"name": "logs-routing",
739+
"install_type": "fullstack",
740+
"working_directory": "solutions/logs-routing",
741+
"iam_permissions": [
742+
{
743+
"service_name": "logs-router",
744+
"role_crns": [
745+
"crn:v1:bluemix:public:iam::::serviceRole:Manager"
746+
]
747+
}
748+
],
749+
"dependencies": [
750+
{
751+
"flavors": [
752+
"instances"
753+
],
754+
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
755+
"id": "a3137d28-79e0-479d-8a24-758ebd5a0eab-global",
756+
"name": "deploy-arch-ibm-observability",
757+
"version": ">=v1.3.1",
758+
"optional": true
759+
}
760+
],
761+
"configuration": [
762+
{
763+
"key": "ibmcloud_api_key"
764+
},
765+
{
766+
"key": "provider_visibility",
767+
"options": [
768+
{
769+
"displayname": "private",
770+
"value": "private"
771+
},
772+
{
773+
"displayname": "public",
774+
"value": "public"
775+
},
776+
{
777+
"displayname": "public-and-private",
778+
"value": "public-and-private"
779+
}
780+
]
781+
},
782+
{
783+
"key": "tenant_configuration"
784+
}
785+
],
786+
"architecture": {
787+
"descriptions": "This architecture supports the deployment of Log Router Tenant for routing logs to cloud logs instance",
788+
"features": [
789+
{
790+
"title": "Creates Log Router Tenant for routing logs to cloud logs instance",
791+
"description": "Creates Log Router Tenant for routing logs to cloud logs instance"
792+
}
793+
],
794+
"diagrams": [
795+
{
796+
"diagram": {
797+
"caption": "logs-router",
798+
"url": "https://github.com/terraform-ibm-modules/terraform-ibm-observability-da/blob/main/reference-architecture/deployable-architecture-logs-routing.svg",
799+
"type": "image/svg+xml"
800+
},
801+
"description": "Log Router Tenant for routing logs to cloud logs instance"
802+
}
803+
]
804+
}
717805
}
718806
]
719807
}

reference-architecture/deployable-architecture-logs-routing.svg

Lines changed: 4 additions & 0 deletions
Loading

solutions/logs-routing/DA-types.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Configuring Tenants for Log Routing to Cloud Logs Instances
2+
3+
When you create a log router tenant from the IBM cloud catalog you can configure in which region you want to create the router tenant
4+
5+
and which cloud logs instance you want to target and give names to the tenant and the target
6+
7+
### Options for tenant configuration
8+
- `tenant_region` (required): The region in which the tenant will be created
9+
- `tenant_name` (required): The name of the tenant which has to be created
10+
- `target_name` (required): The name to be given to the target inside the tenant
11+
- `log_sink_crn` (required): The Cloud Resource Name (CRN) of the cloud logs instance where logs will be routed.
12+
13+
### Example log router tenant configuration
14+
15+
```hcl
16+
tenant_configuration = [
17+
{
18+
tenant_region = "eu-de"
19+
tenant_name = "test-tenant-1"
20+
target_name = "test-target-1"
21+
log_sink_crn = "crn:v1:bluemix:public:logs:us-south::2fde707d-7cb6-4aed-80df-ab038599872c::"
22+
},
23+
{
24+
tenant_region = "br-sao"
25+
tenant_name = "test-tenant-2"
26+
target_name = "test-target-2"
27+
log_sink_crn = "crn:v1:bluemix:public:logs:us-south::2fde707d-7cb6-4aed-80df-ab038599872c::"
28+
}
29+
]
30+
```

solutions/logs-routing/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Creating Tenants for Log Routing to Cloud Logs Intances
2+
3+
This architecture supports creating Cloud Logs tenants
4+
5+
## Before you begin
6+
7+
* Make sure that the observability instances (Cloud Logs) for which specific tenants are required are deployed.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"ibmcloud_api_key": $VALIDATION_APIKEY,
3+
"tenant_configuration": "[{\"tenant_region\": \"eu-de\", \"tenant_name\": \"test-tenant\", \"target_name\": \"test-target\", \"log_sink_crn\": \"crn:v1:bluemix:public:logs:us-east:a/abac0df06b644a9cabc6e44f55b3880e:6e931667-0f47-4c59-be2e-fa9b9f13f1a4::\"}]"
4+
}

solutions/logs-routing/main.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module "icl_crn_parser" {
2+
for_each = { for idx, tenant in var.tenant_configuration : idx => tenant }
3+
source = "terraform-ibm-modules/common-utilities/ibm//modules/crn-parser"
4+
version = "1.1.0"
5+
crn = each.value.log_sink_crn
6+
}
7+
8+
data "ibm_resource_instance" "icl_instance" {
9+
for_each = { for idx, tenant in var.tenant_configuration : idx => tenant }
10+
identifier = module.icl_crn_parser[each.key].service_instance
11+
}
12+
13+
resource "ibm_logs_router_tenant" "logs_router_tenant_instances" {
14+
for_each = { for idx, tenant in var.tenant_configuration : idx => tenant }
15+
name = each.value.tenant_name
16+
region = each.value.tenant_region
17+
targets {
18+
log_sink_crn = each.value.log_sink_crn
19+
name = each.value.target_name
20+
parameters {
21+
host = data.ibm_resource_instance.icl_instance[each.key].extensions.external_ingress_private
22+
port = 443
23+
}
24+
}
25+
}

solutions/logs-routing/outputs.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
##############################################################################
2+
# Outputs
3+
##############################################################################
4+
5+
6+
##############################################################################
7+
8+
output "tenants_details" {
9+
10+
value = {
11+
for idx, tenant in var.tenant_configuration : idx => {
12+
"name" : var.tenant_configuration[idx].tenant_name,
13+
"id" : ibm_logs_router_tenant.logs_router_tenant_instances[idx].id,
14+
"crn" : ibm_logs_router_tenant.logs_router_tenant_instances[idx].crn
15+
}
16+
}
17+
description = "Details of tenant created through this configuration"
18+
}

solutions/logs-routing/provider.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
########################################################################################################################
2+
# Provider config
3+
########################################################################################################################
4+
5+
provider "ibm" {
6+
ibmcloud_api_key = var.ibmcloud_api_key
7+
visibility = var.provider_visibility
8+
}

0 commit comments

Comments
 (0)