Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Update the logic for prefix variable. #269

Merged
merged 8 commits into from
Jan 15, 2025
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
3 changes: 2 additions & 1 deletion ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
]
},
{
"key": "prefix"
"key": "prefix",
"required": true
},
{
"key": "skip_iam_account_settings"
Expand Down
4 changes: 2 additions & 2 deletions solutions/account-infrastructure-base/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ variable "region" {
variable "prefix" {
type = string
description = "An optional prefix to append to all resources created by this solution. If `provision_atracker_cos` is true, this value will be converted to lowercase in all instances."
arya-girish-k marked this conversation as resolved.
Show resolved Hide resolved
default = null
default = "acc-infra-base"

# prefix restriction due to limitations when using multiple DAs in stacks
# this value was determined based on the lowest prefix restriction located here:
# https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone/blob/main/patterns/roks/variables.tf#L11
validation {
condition = var.prefix == null || can(length(var.prefix)) && length(var.prefix) <= 13
condition = var.prefix == null || var.prefix == "" || can(length(var.prefix)) && length(var.prefix) <= 13
arya-girish-k marked this conversation as resolved.
Show resolved Hide resolved
error_message = "`prefix` length must be 13 characters or less or null."
arya-girish-k marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down