Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 0 additions & 4 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@
"key": "existing_secrets_manager_crn",
"required": true
},
{
"key": "prefix",
"required": true
},
{
"key": "secrets_manager_region",
"required": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"ibmcloud_api_key": $VALIDATION_APIKEY,
"existing_secrets_manager_crn": $SM_CRN,
"prefix": $PREFIX,
"acme_letsencrypt_private_key": $ACME_KEY,
"internet_services_crn": $CIS_ID
}
3 changes: 1 addition & 2 deletions solutions/fully-configurable/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
########################################################################################################################

locals {
prefix = var.prefix != null ? trimspace(var.prefix) != "" ? "${var.prefix}-" : "" : ""
parse_acme_lets_encrypt_private_key = var.acme_letsencrypt_private_key_secrets_manager_secret_crn != null ? 1 : 0
}

Expand Down Expand Up @@ -41,7 +40,7 @@ module "secrets_manager_public_cert_engine" {
cis_account_id = var.internet_services_account_id
internet_service_domain_id = var.internet_service_domain_id
dns_config_name = var.dns_config_name
ca_config_name = "${local.prefix}${var.ca_config_name}"
ca_config_name = var.ca_config_name
lets_encrypt_environment = var.lets_encrypt_environment
acme_letsencrypt_private_key = var.acme_letsencrypt_private_key
service_endpoints = var.service_endpoints
Expand Down
31 changes: 2 additions & 29 deletions solutions/fully-configurable/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,6 @@ variable "existing_secrets_manager_crn" {
description = "CRN of an existing secrets manager instance to create the secret engine in."
}

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)."

validation {
# - null and empty string is allowed
# - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0
# - Starts with a lowercase letter: [a-z]
# - Contains only lowercase letters (a–z), digits (0–9), and hyphens (-)
# - Must not end with a hyphen (-): [a-z0-9]
condition = (var.prefix == null || var.prefix == "" ? true :
alltrue([
can(regex("^[a-z][-a-z0-9]*[a-z0-9]$", var.prefix)),
length(regexall("--", var.prefix)) == 0
])
)
error_message = "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 ('--')."
}

validation {
# must not exceed 16 characters in length
condition = var.prefix == null || var.prefix == "" ? true : length(var.prefix) <= 16
error_message = "Prefix must not exceed 16 characters."
}
}

variable "service_endpoints" {
type = string
description = "The service endpoint type to communicate with the provided secrets manager instance."
Expand Down Expand Up @@ -91,8 +64,8 @@ variable "dns_config_name" {

variable "ca_config_name" {
type = string
description = "Name of the CA config for the public certificate secrets engine. If a prefix input variable is specified, it is added to the value in the `<prefix>-value` format. [Learn more](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli#secrets-manager-configurations-cli)."
default = "cert-auth"
description = "Name of the CA config for the public certificate secrets engine. [Learn more](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli#secrets-manager-configurations-cli)."
default = null
}

variable "lets_encrypt_environment" {
Expand Down