From 9543465dddd653c1c7529a5f39ba007e5e52d009 Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Tue, 16 Sep 2025 21:35:58 +0530 Subject: [PATCH 1/2] feat: add support for user tags --- ibm_catalog.json | 4 ++++ solutions/fully-configurable/main.tf | 8 ++++++++ solutions/fully-configurable/variables.tf | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/ibm_catalog.json b/ibm_catalog.json index 2152dad..72b41e7 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -318,6 +318,10 @@ } ], "hidden": true + }, + { + "key": "IC_SCHEMATICS_WORKSPACE_ID", + "hidden": true } ], "terraform_version": "1.10.5" diff --git a/solutions/fully-configurable/main.tf b/solutions/fully-configurable/main.tf index cc01edf..6bee031 100644 --- a/solutions/fully-configurable/main.tf +++ b/solutions/fully-configurable/main.tf @@ -49,3 +49,11 @@ module "logs_agent" { log_filters = var.log_filters max_unavailable = var.max_unavailable } + +# Attach user tags to the cluster with details of the cloud logs and workspace +resource "ibm_resource_tag" "user_tags" { + count = var.IC_SCHEMATICS_WORKSPACE_ID != null ? 1 : 0 + resource_id = local.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].crn : data.ibm_container_cluster.cluster[0].crn + tags = ["logging-instance:${coalescelist(split(".", var.cloud_logs_ingress_endpoint))[0]}", "logging-workspace:${var.IC_SCHEMATICS_WORKSPACE_ID}"] + tag_type = "user" +} diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 245ce84..6cdd2b6 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -272,3 +272,14 @@ variable "provider_visibility" { error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." } } + +############################################################################## +# Schematics Output +############################################################################## + +# tflint-ignore: terraform_naming_convention +variable "IC_SCHEMATICS_WORKSPACE_ID" { + default = "" + type = string + description = "leave blank if running locally. This variable will be automatically populated if running from an IBM Cloud Schematics workspace" +} From 8872a57a12396afeaae19ff084020af0d985207f Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Tue, 16 Sep 2025 22:22:20 +0530 Subject: [PATCH 2/2] update --- solutions/fully-configurable/main.tf | 2 +- solutions/fully-configurable/variables.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solutions/fully-configurable/main.tf b/solutions/fully-configurable/main.tf index 6bee031..74c67c3 100644 --- a/solutions/fully-configurable/main.tf +++ b/solutions/fully-configurable/main.tf @@ -52,7 +52,7 @@ module "logs_agent" { # Attach user tags to the cluster with details of the cloud logs and workspace resource "ibm_resource_tag" "user_tags" { - count = var.IC_SCHEMATICS_WORKSPACE_ID != null ? 1 : 0 + count = var.IC_SCHEMATICS_WORKSPACE_ID != "" ? 1 : 0 resource_id = local.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].crn : data.ibm_container_cluster.cluster[0].crn tags = ["logging-instance:${coalescelist(split(".", var.cloud_logs_ingress_endpoint))[0]}", "logging-workspace:${var.IC_SCHEMATICS_WORKSPACE_ID}"] tag_type = "user" diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 6cdd2b6..5fd49dc 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -274,12 +274,12 @@ variable "provider_visibility" { } ############################################################################## -# Schematics Output +# Schematics ############################################################################## # tflint-ignore: terraform_naming_convention variable "IC_SCHEMATICS_WORKSPACE_ID" { default = "" type = string - description = "leave blank if running locally. This variable will be automatically populated if running from an IBM Cloud Schematics workspace" + description = "leave blank if running locally. This variable will be automatically populated if running from an IBM Cloud Schematics workspace." }