Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,14 @@
},
{
"key": "existing_secrets_manager_crn",
"required": true
"required": true,
"value_constraints": [
{
"type": "regex",
"description": "The value provided for 'existing_secrets_manager_crn' is not valid.",
"value": "^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
}
]
},
{
"key": "prefix",
Expand Down Expand Up @@ -262,7 +269,14 @@
"key": "ibmcloud_cis_api_key"
},
{
"key": "internet_services_crn"
"key": "internet_services_crn",
"value_constraints": [
{
"type": "regex",
"description": "The value provided for 'internet_services_crn' is not valid.",
"value": "^__NULL__$|^crn:(.*:){3}internet-svcs:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
}
]
},
{
"key": "internet_services_account_id"
Expand Down Expand Up @@ -294,7 +308,14 @@
"required": true
},
{
"key": "acme_letsencrypt_private_key_secrets_manager_secret_crn"
"key": "acme_letsencrypt_private_key_secrets_manager_secret_crn",
"value_constraints": [
{
"type": "regex",
"description": "The value provided for 'acme_letsencrypt_private_key_secrets_manager_secret_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}:secret:[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"
}
]
},
{
"key": "skip_iam_authorization_policy"
Expand Down
25 changes: 24 additions & 1 deletion solutions/fully-configurable/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ variable "provider_visibility" {

variable "existing_secrets_manager_crn" {
type = string
nullable = false
description = "CRN of an existing secrets manager instance to create the secret engine in."

validation {
condition = can(regex("^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$", var.existing_secrets_manager_crn))
error_message = "The value provided for 'existing_secrets_manager_crn' is not valid.'"
}
}

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-us-south. [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
Expand Down Expand Up @@ -64,6 +70,15 @@ variable "internet_services_crn" {
type = string
description = "The CRN of the Internet Service instance to authorize Secrets Manager against. For creating a public certificate, if using Cloud Internet Service for DNS then `internet_service_crn` is a required input. [Learn more](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli#secrets-manager-configurations-cli)."
default = null

validation {
condition = anytrue([
can(regex("^crn:(.*:){3}internet-svcs:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$", var.internet_services_crn)),
var.internet_services_crn == null,
])
error_message = "The value provided for 'internet_services_crn' is not valid."

}
}

variable "internet_services_account_id" {
Expand Down Expand Up @@ -131,4 +146,12 @@ variable "acme_letsencrypt_private_key_secrets_manager_secret_crn" {
)
error_message = "If `acme_letsencrypt_private_key` is not set, you must provide a value for `acme_letsencrypt_private_key_secrets_manager_secret_crn`."
}
validation {
condition = anytrue([
can(regex("^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:secret:[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", var.acme_letsencrypt_private_key_secrets_manager_secret_crn)),
var.acme_letsencrypt_private_key_secrets_manager_secret_crn == null,
])
error_message = "The value provided for 'acme_letsencrypt_private_key_secrets_manager_secret_crn' is not valid."

}
}