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..74c67c3 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 != "" ? 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..5fd49dc 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 +############################################################################## + +# 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." +}