diff --git a/ibm_catalog.json b/ibm_catalog.json index 115d11e2..b752dbf1 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -147,7 +147,18 @@ "description": "The name of an existing resource group to provision the resources." }, { - "key": "prefix" + "key": "prefix", + "default_value": "dev", + "random_string": { + "length": 4 + }, + "value_constraints": [ + { + "type": "regex", + "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.", + "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" + } + ] }, { "key": "region", @@ -330,7 +341,14 @@ "key": "admin_pass" }, { - "key": "existing_secrets_manager_instance_crn" + "key": "existing_secrets_manager_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_secrets_manager_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "existing_secrets_manager_endpoint_type", @@ -374,10 +392,24 @@ "key": "kms_encryption_enabled" }, { - "key": "existing_kms_instance_crn" + "key": "existing_kms_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_kms_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { - "key": "existing_kms_key_crn" + "key": "existing_kms_key_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_kms_key_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:key:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + } + ] }, { "key": "kms_endpoint_type", @@ -400,10 +432,24 @@ "key": "key_name" }, { - "key": "backup_crn" + "key": "backup_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'backup_crn' is not valid.", + "value": "^__NULL__$|^crn:.*:backup:" + } + ] }, { - "key": "existing_backup_kms_key_crn" + "key": "existing_backup_kms_key_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_backup_kms_key_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:key:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + } + ] }, { "key": "use_default_backup_encryption_key" @@ -412,7 +458,14 @@ "key": "skip_elasticsearch_kms_auth_policy" }, { - "key": "existing_elasticsearch_instance_crn" + "key": "existing_elasticsearch_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_elasticsearch_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}databases-for-elasticsearch:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "enable_elser_model" @@ -453,7 +506,14 @@ "key": "kibana_registry_namespace_image" }, { - "key": "kibana_image_digest" + "key": "kibana_image_digest", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'kibana_image_digest' is not valid.", + "value": "^__NULL__$|^sha256:" + } + ] }, { "key": "kibana_image_port" @@ -592,7 +652,18 @@ "description": "The name of an existing resource group to provision the resources." }, { - "key": "prefix" + "key": "prefix", + "default_value": "dev", + "random_string": { + "length": 4 + }, + "value_constraints": [ + { + "type": "regex", + "description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.", + "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" + } + ] }, { "key": "region", @@ -755,7 +826,14 @@ "key": "admin_pass" }, { - "key": "existing_secrets_manager_instance_crn" + "key": "existing_secrets_manager_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_secrets_manager_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "skip_elasticsearch_to_secrets_manager_auth_policy" @@ -783,10 +861,24 @@ }, { "key": "existing_kms_instance_crn", - "required": true + "required": true, + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_kms_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { - "key": "existing_kms_key_crn" + "key": "existing_kms_key_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_kms_key_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:key:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + } + ] }, { "key": "key_ring_name" @@ -795,16 +887,37 @@ "key": "key_name" }, { - "key": "backup_crn" + "key": "backup_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'backup_crn' is not valid.", + "value": "^__NULL__$|^crn:.*:backup:" + } + ] }, { - "key": "existing_backup_kms_key_crn" + "key": "existing_backup_kms_key_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_backup_kms_key_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:key:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" + } + ] }, { "key": "skip_elasticsearch_kms_auth_policy" }, { - "key": "existing_elasticsearch_instance_crn" + "key": "existing_elasticsearch_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_elasticsearch_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}databases-for-elasticsearch:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "enable_elser_model" @@ -842,7 +955,14 @@ "key": "kibana_registry_namespace_image" }, { - "key": "kibana_image_digest" + "key": "kibana_image_digest", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'kibana_image_digest' must start with 'sha256:'.", + "value": "^__NULL__$|^sha256:" + } + ] }, { "key": "kibana_image_port" diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index af657131..cf70e977 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -17,7 +17,7 @@ variable "existing_resource_group_name" { variable "prefix" { type = string nullable = true - description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-cos. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." + description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." validation { # - null and empty string is allowed diff --git a/solutions/security-enforced/variables.tf b/solutions/security-enforced/variables.tf index 73f2f046..24747677 100644 --- a/solutions/security-enforced/variables.tf +++ b/solutions/security-enforced/variables.tf @@ -17,7 +17,7 @@ variable "existing_resource_group_name" { variable "prefix" { type = string nullable = true - description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-cos. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." + description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." validation { # - null and empty string is allowed