diff --git a/README.md b/README.md index 47bd716..b4a66fd 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ statement instead the previous block. | [access\_tags](#input\_access\_tags) | A list of access tags to apply to the SCC WP instance created by the module. For more information, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial. | `list(string)` | `[]` | no | | [app\_config\_crn](#input\_app\_config\_crn) | The CRN of an existing App Config instance to use with the SCC Workload Protection instance. Required if `cspm_enabled` is true. NOTE: Ensure the App Config instance has configuration aggregator enabled. | `string` | `null` | no | | [cbr\_rules](#input\_cbr\_rules) | The context-based restrictions rule to create. Only one rule is allowed. |
list(object({
description = string
account_id = string
tags = optional(list(object({
name = string
value = string
})), [])
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
}))
| `[]` | no | -| [cloud\_monitoring\_instance\_crn](#input\_cloud\_monitoring\_instance\_crn) | To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create a connection between instances. Both instances must be in the same region. | `string` | `null` | no | +| [cloud\_monitoring\_instance\_crn](#input\_cloud\_monitoring\_instance\_crn) | To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create the connection. Once the connection is created, the Monitoring instance CRN cannot be changed. | `string` | `null` | no | | [cspm\_enabled](#input\_cspm\_enabled) | Enable Cloud Security Posture Management (CSPM) for the Workload Protection instance. This will create a trusted profile associated with the SCC Workload Protection instance that has viewer / reader access to the App Config service and viewer access to the Enterprise service. [Learn more](https://cloud.ibm.com/docs/workload-protection?topic=workload-protection-about). | `bool` | `true` | no | | [name](#input\_name) | The name to give the SCC Workload Protection instance that will be provisioned by this module. | `string` | n/a | yes | | [region](#input\_region) | IBM Cloud region where all resources will be deployed | `string` | `"us-south"` | no | diff --git a/main.tf b/main.tf index 032f93c..d96eb86 100644 --- a/main.tf +++ b/main.tf @@ -20,7 +20,12 @@ resource "ibm_resource_instance" "scc_wp" { location = var.region tags = var.resource_tags parameters = { - cloud_monitoring_connected_instance : var.cloud_monitoring_instance_crn + cloud_monitoring_connected_instance = var.cloud_monitoring_instance_crn + } + lifecycle { + ignore_changes = [ + parameters["cloud_monitoring_connected_instance"] + ] } } diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 3cde8a6..7337a55 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -18,7 +18,7 @@ variable "existing_monitoring_crn" { type = string nullable = true default = null - description = "To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create a connection between instances. Both instances must be in the same region. [Learn more](https://www.ibm.com/products/cloud-monitoring)" + description = "To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create the connection. Once the connection is created, the Monitoring instance CRN cannot be changed. Learn more](https://www.ibm.com/products/cloud-monitoring)" validation { condition = anytrue([ diff --git a/variables.tf b/variables.tf index 61d05d8..a1a0a52 100644 --- a/variables.tf +++ b/variables.tf @@ -69,7 +69,7 @@ variable "access_tags" { variable "cloud_monitoring_instance_crn" { type = string - description = "To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create a connection between instances. Both instances must be in the same region." + description = "To collect and analyze metrics and security data on hosts using both Monitoring and Workload Protection, pass the CRN of an existing IBM Cloud Monitoring instance to create the connection. Once the connection is created, the Monitoring instance CRN cannot be changed." default = null validation {